id
stringlengths 25
25
| content
stringlengths 649
72.1k
| max_stars_repo_path
stringlengths 91
133
|
|---|---|---|
d2a_code_trace_data_42954
|
static inline void skip_remaining(BitstreamContext *bc, unsigned n)
{
#ifdef BITSTREAM_READER_LE
bc->bits >>= n;
#else
bc->bits <<= n;
#endif
bc->bits_left -= n;
}
libavcodec/mpc8.c:263: error: Integer Overflow L2
([0, 64] - [0, 64]):unsigned32 by call to `bitstream_skip`.
libavcodec/mpc8.c:262:5: Call
260. c->last_bits_used = 0;
261. }
262. bitstream_init(bc, buf, buf_size * 8);
^
263. bitstream_skip(bc, c->last_bits_used & 7);
264.
libavcodec/bitstream.h:85:9: Assignment
83. bc->buffer =
84. bc->ptr = NULL;
85. bc->bits_left = 0;
^
86. return AVERROR_INVALIDDATA;
87. }
libavcodec/mpc8.c:263:5: Call
261. }
262. bitstream_init(bc, buf, buf_size * 8);
263. bitstream_skip(bc, c->last_bits_used & 7);
^
264.
265. if(keyframe)
libavcodec/bitstream.h:241:1: Parameter `n`
239.
240. /* Skip n bits in the buffer. */
241. static inline void bitstream_skip(BitstreamContext *bc, unsigned n)
^
242. {
243. if (n <= bc->bits_left)
libavcodec/bitstream.h:247:9: Call
245. else {
246. n -= bc->bits_left;
247. skip_remaining(bc, bc->bits_left);
^
248. if (n >= 64) {
249. unsigned skip = n / 8;
libavcodec/bitstream.h:230:1: <LHS trace>
228. }
229.
230. static inline void skip_remaining(BitstreamContext *bc, unsigned n)
^
231. {
232. #ifdef BITSTREAM_READER_LE
libavcodec/bitstream.h:230:1: Parameter `bc->bits_left`
228. }
229.
230. static inline void skip_remaining(BitstreamContext *bc, unsigned n)
^
231. {
232. #ifdef BITSTREAM_READER_LE
libavcodec/bitstream.h:230:1: <RHS trace>
228. }
229.
230. static inline void skip_remaining(BitstreamContext *bc, unsigned n)
^
231. {
232. #ifdef BITSTREAM_READER_LE
libavcodec/bitstream.h:230:1: Parameter `n`
228. }
229.
230. static inline void skip_remaining(BitstreamContext *bc, unsigned n)
^
231. {
232. #ifdef BITSTREAM_READER_LE
libavcodec/bitstream.h:237:5: Binary operation: ([0, 64] - [0, 64]):unsigned32 by call to `bitstream_skip`
235. bc->bits <<= n;
236. #endif
237. bc->bits_left -= n;
^
238. }
239.
|
https://github.com/libav/libav/blob/562ef82d6a7f96f6b9da1219a5aaf7d9d7056f1b/libavcodec/bitstream.h/#L237
|
d2a_code_trace_data_42955
|
void RAND_add(const void *buf, int num, double randomness)
{
const RAND_METHOD *meth = RAND_get_rand_method();
if (meth->add != NULL)
meth->add(buf, num, randomness);
}
crypto/rand/rand_lib.c:847: error: NULL_DEREFERENCE
pointer `meth` last assigned on line 845 could be null and is dereferenced at line 847, column 9.
Showing all 6 steps of the trace
crypto/rand/rand_lib.c:843:1: start of procedure RAND_add()
841. }
842.
843. > void RAND_add(const void *buf, int num, double randomness)
844. {
845. const RAND_METHOD *meth = RAND_get_rand_method();
crypto/rand/rand_lib.c:845:5:
843. void RAND_add(const void *buf, int num, double randomness)
844. {
845. > const RAND_METHOD *meth = RAND_get_rand_method();
846.
847. if (meth->add != NULL)
crypto/rand/rand_lib.c:775:1: start of procedure RAND_get_rand_method()
773. #endif
774.
775. > const RAND_METHOD *RAND_get_rand_method(void)
776. {
777. #ifdef FIPS_MODE
crypto/rand/rand_lib.c:778:5:
776. {
777. #ifdef FIPS_MODE
778. > return NULL;
779. #else
780. const RAND_METHOD *tmp_meth = NULL;
crypto/rand/rand_lib.c:807:1: return from a call to RAND_get_rand_method
805. return tmp_meth;
806. #endif
807. > }
808.
809. #if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODE)
crypto/rand/rand_lib.c:847:9:
845. const RAND_METHOD *meth = RAND_get_rand_method();
846.
847. > if (meth->add != NULL)
848. meth->add(buf, num, randomness);
849. }
|
https://github.com/openssl/openssl/blob/fa3eb248e29ca8031e6a14e8a2c6f3cd58b5450e/crypto/rand/rand_lib.c/#L847
|
d2a_code_trace_data_42956
|
static int avi_read_idx1(AVFormatContext *s, int size)
{
AVIContext *avi = s->priv_data;
ByteIOContext *pb = s->pb;
int nb_index_entries, i;
AVStream *st;
AVIStream *ast;
unsigned int index, tag, flags, pos, len;
unsigned last_pos= -1;
nb_index_entries = size / 16;
if (nb_index_entries <= 0)
return -1;
for(i = 0; i < nb_index_entries; i++) {
tag = get_le32(pb);
flags = get_le32(pb);
pos = get_le32(pb);
len = get_le32(pb);
#if defined(DEBUG_SEEK)
av_log(NULL, AV_LOG_DEBUG, "%d: tag=0x%x flags=0x%x pos=0x%x len=%d/",
i, tag, flags, pos, len);
#endif
if(i==0 && pos > avi->movi_list)
avi->movi_list= 0;
pos += avi->movi_list;
index = ((tag & 0xff) - '0') * 10;
index += ((tag >> 8) & 0xff) - '0';
if (index >= s->nb_streams)
continue;
st = s->streams[index];
ast = st->priv_data;
#if defined(DEBUG_SEEK)
av_log(NULL, AV_LOG_DEBUG, "%d cum_len=%"PRId64"\n", len, ast->cum_len);
#endif
if(last_pos == pos)
avi->non_interleaved= 1;
else
av_add_index_entry(st, pos, ast->cum_len / FFMAX(1, ast->sample_size), len, 0, (flags&AVIIF_INDEX) ? AVINDEX_KEYFRAME : 0);
if(ast->sample_size)
ast->cum_len += len;
else
ast->cum_len ++;
last_pos= pos;
}
return 0;
}
libavformat/avidec.c:884: error: Integer Overflow L2
([0, 255] - 48):unsigned32.
libavformat/avidec.c:872:15: <LHS trace>
870. /* read the entries and sort them in each stream component */
871. for(i = 0; i < nb_index_entries; i++) {
872. tag = get_le32(pb);
^
873. flags = get_le32(pb);
874. pos = get_le32(pb);
libavformat/avidec.c:872:15: Call
870. /* read the entries and sort them in each stream component */
871. for(i = 0; i < nb_index_entries; i++) {
872. tag = get_le32(pb);
^
873. flags = get_le32(pb);
874. pos = get_le32(pb);
libavformat/aviobuf.c:446:11: Call
444. {
445. unsigned int val;
446. val = get_le16(s);
^
447. val |= get_le16(s) << 16;
448. return val;
libavformat/aviobuf.c:430:11: Call
428. {
429. unsigned int val;
430. val = get_byte(s);
^
431. val |= get_byte(s) << 8;
432. return val;
libavformat/aviobuf.c:348:13: Assignment
346. return *s->buf_ptr++;
347. else
348. return 0;
^
349. }
350. }
libavformat/aviobuf.c:430:5: Assignment
428. {
429. unsigned int val;
430. val = get_byte(s);
^
431. val |= get_byte(s) << 8;
432. return val;
libavformat/aviobuf.c:431:5: Assignment
429. unsigned int val;
430. val = get_byte(s);
431. val |= get_byte(s) << 8;
^
432. return val;
433. }
libavformat/aviobuf.c:432:5: Assignment
430. val = get_byte(s);
431. val |= get_byte(s) << 8;
432. return val;
^
433. }
434.
libavformat/aviobuf.c:446:5: Assignment
444. {
445. unsigned int val;
446. val = get_le16(s);
^
447. val |= get_le16(s) << 16;
448. return val;
libavformat/aviobuf.c:447:5: Assignment
445. unsigned int val;
446. val = get_le16(s);
447. val |= get_le16(s) << 16;
^
448. return val;
449. }
libavformat/aviobuf.c:448:5: Assignment
446. val = get_le16(s);
447. val |= get_le16(s) << 16;
448. return val;
^
449. }
450.
libavformat/avidec.c:872:9: Assignment
870. /* read the entries and sort them in each stream component */
871. for(i = 0; i < nb_index_entries; i++) {
872. tag = get_le32(pb);
^
873. flags = get_le32(pb);
874. pos = get_le32(pb);
libavformat/avidec.c:884:9: Binary operation: ([0, 255] - 48):unsigned32
882. pos += avi->movi_list;
883.
884. index = ((tag & 0xff) - '0') * 10;
^
885. index += ((tag >> 8) & 0xff) - '0';
886. if (index >= s->nb_streams)
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavformat/avidec.c/#L884
|
d2a_code_trace_data_42957
|
static void contract(OPENSSL_LHASH *lh)
{
OPENSSL_LH_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 = OPENSSL_realloc(lh->b,
(unsigned int)(sizeof(OPENSSL_LH_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;
}
}
crypto/store/store_locl.h:59: error: BUFFER_OVERRUN_L3
Offset: [-1, +oo] Size: [1, +oo] by call to `OPENSSL_LH_delete`.
Showing all 10 steps of the trace
crypto/store/store_locl.h:59:1: Parameter `lh->pmax`
57. OSSL_STORE_close_fn close;
58. };
59. > DEFINE_LHASH_OF(OSSL_STORE_LOADER);
60.
61. const OSSL_STORE_LOADER *ossl_store_get0_loader_int(const char *scheme);
crypto/store/store_locl.h:59:1: Call
57. OSSL_STORE_close_fn close;
58. };
59. > DEFINE_LHASH_OF(OSSL_STORE_LOADER);
60.
61. const OSSL_STORE_LOADER *ossl_store_get0_loader_int(const char *scheme);
crypto/lhash/lhash.c:106:1: Parameter `lh->pmax`
104. }
105.
106. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data)
107. {
108. unsigned long hash;
crypto/lhash/lhash.c:129:9: Call
127. if ((lh->num_nodes > MIN_NODES) &&
128. (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
129. contract(lh);
^
130.
131. return (ret);
crypto/lhash/lhash.c:236:1: <Offset trace>
234. }
235.
236. > static void contract(OPENSSL_LHASH *lh)
237. {
238. OPENSSL_LH_NODE **n, *n1, *np;
crypto/lhash/lhash.c:236:1: Parameter `lh->p`
234. }
235.
236. > static void contract(OPENSSL_LHASH *lh)
237. {
238. OPENSSL_LH_NODE **n, *n1, *np;
crypto/lhash/lhash.c:256:9: Assignment
254. lh->b = n;
255. } else
256. lh->p--;
^
257.
258. lh->num_nodes--;
crypto/lhash/lhash.c:236:1: <Length trace>
234. }
235.
236. > static void contract(OPENSSL_LHASH *lh)
237. {
238. OPENSSL_LH_NODE **n, *n1, *np;
crypto/lhash/lhash.c:236:1: Parameter `*lh->b`
234. }
235.
236. > static void contract(OPENSSL_LHASH *lh)
237. {
238. OPENSSL_LH_NODE **n, *n1, *np;
crypto/lhash/lhash.c:261:10: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `OPENSSL_LH_delete`
259. lh->num_contracts++;
260.
261. n1 = lh->b[(int)lh->p];
^
262. if (n1 == NULL)
263. lh->b[(int)lh->p] = np;
|
https://github.com/openssl/openssl/blob/e1613d9f253329e033c62d1ed7d0b7826bf82965/crypto/lhash/lhash.c/#L261
|
d2a_code_trace_data_42958
|
void ERR_set_error_data(char *data, int flags)
{
ERR_STATE *es;
int i;
es = ERR_get_state();
if (es == NULL)
return;
i = es->top;
err_clear_data(es, i);
es->err_data[i] = data;
es->err_data_flags[i] = flags;
}
crypto/err/err.c:724: error: MEMORY_LEAK
memory dynamically allocated by call to `ERR_get_state()` at line 716, column 10 is not reachable after line 724, column 5.
Showing all 56 steps of the trace
crypto/err/err.c:711:1: start of procedure ERR_set_error_data()
709. }
710.
711. > void ERR_set_error_data(char *data, int flags)
712. {
713. ERR_STATE *es;
crypto/err/err.c:716:5:
714. int i;
715.
716. > es = ERR_get_state();
717. if (es == NULL)
718. return;
crypto/err/err.c:662:1: start of procedure ERR_get_state()
660. }
661.
662. > ERR_STATE *ERR_get_state(void)
663. {
664. ERR_STATE *state = NULL;
crypto/err/err.c:664:5:
662. ERR_STATE *ERR_get_state(void)
663. {
664. > ERR_STATE *state = NULL;
665.
666. if (!RUN_ONCE(&err_init, err_do_init))
crypto/err/err.c:666:10:
664. ERR_STATE *state = NULL;
665.
666. > if (!RUN_ONCE(&err_init, err_do_init))
667. return NULL;
668.
crypto/threads_pthread.c:105:1: start of procedure CRYPTO_THREAD_run_once()
103. }
104.
105. > int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))
106. {
107. if (pthread_once(once, init) != 0)
crypto/threads_pthread.c:107:9: Taking false branch
105. int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))
106. {
107. if (pthread_once(once, init) != 0)
^
108. return 0;
109.
crypto/threads_pthread.c:110:5:
108. return 0;
109.
110. > return 1;
111. }
112.
crypto/threads_pthread.c:111:1: return from a call to CRYPTO_THREAD_run_once
109.
110. return 1;
111. > }
112.
113. int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *))
crypto/err/err.c:666:10: Condition is true
664. ERR_STATE *state = NULL;
665.
666. if (!RUN_ONCE(&err_init, err_do_init))
^
667. return NULL;
668.
crypto/err/err.c:666:10: Taking false branch
664. ERR_STATE *state = NULL;
665.
666. if (!RUN_ONCE(&err_init, err_do_init))
^
667. return NULL;
668.
crypto/err/err.c:674:10: Taking false branch
672. * Needed on any platform that doesn't define OPENSSL_USE_NODELETE.
673. */
674. if (!OPENSSL_init_crypto(0, NULL))
^
675. return NULL;
676.
crypto/err/err.c:677:5:
675. return NULL;
676.
677. > state = CRYPTO_THREAD_get_local(&err_thread_local);
678.
679. if (state == NULL) {
crypto/threads_pthread.c:121:1: start of procedure CRYPTO_THREAD_get_local()
119. }
120.
121. > void *CRYPTO_THREAD_get_local(CRYPTO_THREAD_LOCAL *key)
122. {
123. return pthread_getspecific(*key);
crypto/threads_pthread.c:123:5: Skipping pthread_getspecific(): method has no implementation
121. void *CRYPTO_THREAD_get_local(CRYPTO_THREAD_LOCAL *key)
122. {
123. return pthread_getspecific(*key);
^
124. }
125.
crypto/threads_pthread.c:124:1: return from a call to CRYPTO_THREAD_get_local
122. {
123. return pthread_getspecific(*key);
124. > }
125.
126. int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val)
crypto/err/err.c:679:9: Taking true branch
677. state = CRYPTO_THREAD_get_local(&err_thread_local);
678.
679. if (state == NULL) {
^
680. state = OPENSSL_zalloc(sizeof(*state));
681. if (state == NULL)
crypto/err/err.c:680:9:
678.
679. if (state == NULL) {
680. > state = OPENSSL_zalloc(sizeof(*state));
681. if (state == NULL)
682. return NULL;
crypto/mem.c:228:1: start of procedure CRYPTO_zalloc()
226. }
227.
228. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
229. {
230. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:230:5:
228. void *CRYPTO_zalloc(size_t num, const char *file, int line)
229. {
230. > void *ret = CRYPTO_malloc(num, file, line);
231.
232. FAILTEST();
crypto/mem.c:192:1: start of procedure CRYPTO_malloc()
190. #endif
191.
192. > void *CRYPTO_malloc(size_t num, const char *file, int line)
193. {
194. void *ret = NULL;
crypto/mem.c:194:5:
192. void *CRYPTO_malloc(size_t num, const char *file, int line)
193. {
194. > void *ret = NULL;
195.
196. INCREMENT(malloc_count);
crypto/mem.c:197:9: Taking false branch
195.
196. INCREMENT(malloc_count);
197. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
^
198. return malloc_impl(num, file, line);
199.
crypto/mem.c:200:9: Taking false branch
198. return malloc_impl(num, file, line);
199.
200. if (num == 0)
^
201. return NULL;
202.
crypto/mem.c:204:9: Taking true branch
202.
203. FAILTEST();
204. if (allow_customize) {
^
205. /*
206. * Disallow customization after the first allocation. We only set this
crypto/mem.c:210:9:
208. * allocation.
209. */
210. > allow_customize = 0;
211. }
212. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
crypto/mem.c:221:5:
219. }
220. #else
221. > (void)(file); (void)(line);
222. ret = malloc(num);
223. #endif
crypto/mem.c:221:19:
219. }
220. #else
221. > (void)(file); (void)(line);
222. ret = malloc(num);
223. #endif
crypto/mem.c:222:5:
220. #else
221. (void)(file); (void)(line);
222. > ret = malloc(num);
223. #endif
224.
crypto/mem.c:225:5:
223. #endif
224.
225. > return ret;
226. }
227.
crypto/mem.c:226:1: return from a call to CRYPTO_malloc
224.
225. return ret;
226. > }
227.
228. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:233:9: Taking true branch
231.
232. FAILTEST();
233. if (ret != NULL)
^
234. memset(ret, 0, num);
235. return ret;
crypto/mem.c:234:9:
232. FAILTEST();
233. if (ret != NULL)
234. > memset(ret, 0, num);
235. return ret;
236. }
crypto/mem.c:235:5:
233. if (ret != NULL)
234. memset(ret, 0, num);
235. > return ret;
236. }
237.
crypto/mem.c:236:1: return from a call to CRYPTO_zalloc
234. memset(ret, 0, num);
235. return ret;
236. > }
237.
238. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/err/err.c:681:13: Taking false branch
679. if (state == NULL) {
680. state = OPENSSL_zalloc(sizeof(*state));
681. if (state == NULL)
^
682. return NULL;
683.
crypto/err/err.c:684:14: Taking false branch
682. return NULL;
683.
684. if (!ossl_init_thread_start(OPENSSL_INIT_THREAD_ERR_STATE)
^
685. || !CRYPTO_THREAD_set_local(&err_thread_local, state)) {
686. ERR_STATE_free(state);
crypto/err/err.c:685:17:
683.
684. if (!ossl_init_thread_start(OPENSSL_INIT_THREAD_ERR_STATE)
685. > || !CRYPTO_THREAD_set_local(&err_thread_local, state)) {
686. ERR_STATE_free(state);
687. 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/err/err.c:685:17: Taking false branch
683.
684. if (!ossl_init_thread_start(OPENSSL_INIT_THREAD_ERR_STATE)
685. || !CRYPTO_THREAD_set_local(&err_thread_local, state)) {
^
686. ERR_STATE_free(state);
687. return NULL;
crypto/err/err.c:691:9: Skipping OPENSSL_init_crypto(): empty list of specs
689.
690. /* Ignore failures from these */
691. OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
^
692. }
693.
crypto/err/err.c:694:5:
692. }
693.
694. > return state;
695. }
696.
crypto/err/err.c:695:1: return from a call to ERR_get_state
693.
694. return state;
695. > }
696.
697. int ERR_get_next_error_library(void)
crypto/err/err.c:717:9: Taking false branch
715.
716. es = ERR_get_state();
717. if (es == NULL)
^
718. return;
719.
crypto/err/err.c:720:5:
718. return;
719.
720. > i = es->top;
721.
722. err_clear_data(es, i);
crypto/err/err.c:722:5: Taking true branch
720. i = es->top;
721.
722. err_clear_data(es, i);
^
723. es->err_data[i] = data;
724. es->err_data_flags[i] = flags;
crypto/mem.c:295:1: start of procedure CRYPTO_free()
293. }
294.
295. > void CRYPTO_free(void *str, const char *file, int line)
296. {
297. INCREMENT(free_count);
crypto/mem.c:298:9: Taking false branch
296. {
297. INCREMENT(free_count);
298. if (free_impl != NULL && free_impl != &CRYPTO_free) {
^
299. free_impl(str, file, line);
300. return;
crypto/mem.c:312:5:
310. }
311. #else
312. > free(str);
313. #endif
314. }
crypto/mem.c:314:1: return from a call to CRYPTO_free
312. free(str);
313. #endif
314. > }
315.
316. void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)
crypto/err/err.c:722:5: Loop condition is false. Leaving loop
720. i = es->top;
721.
722. err_clear_data(es, i);
^
723. es->err_data[i] = data;
724. es->err_data_flags[i] = flags;
crypto/err/err.c:723:5:
721.
722. err_clear_data(es, i);
723. > es->err_data[i] = data;
724. es->err_data_flags[i] = flags;
725. }
crypto/err/err.c:724:5:
722. err_clear_data(es, i);
723. es->err_data[i] = data;
724. > es->err_data_flags[i] = flags;
725. }
726.
|
https://github.com/openssl/openssl/blob/f770d75b1cac264d6280ec7326277daff6965cbb/crypto/err/err.c/#L724
|
d2a_code_trace_data_42959
|
int ssl3_write_pending(SSL *s, int type, const unsigned char *buf, size_t len,
size_t *written)
{
int i;
SSL3_BUFFER *wb = s->rlayer.wbuf;
size_t currbuf = 0;
size_t tmpwrit = 0;
if ((s->rlayer.wpend_tot > len)
|| ((s->rlayer.wpend_buf != buf) &&
!(s->mode & SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER))
|| (s->rlayer.wpend_type != type)) {
SSLerr(SSL_F_SSL3_WRITE_PENDING, SSL_R_BAD_WRITE_RETRY);
return -1;
}
for (;;) {
if (SSL3_BUFFER_get_left(&wb[currbuf]) == 0
&& currbuf < s->rlayer.numwpipes - 1) {
currbuf++;
continue;
}
clear_sys_error();
if (s->wbio != NULL) {
s->rwstate = SSL_WRITING;
i = BIO_write(s->wbio, (char *)
&(SSL3_BUFFER_get_buf(&wb[currbuf])
[SSL3_BUFFER_get_offset(&wb[currbuf])]),
(unsigned int)SSL3_BUFFER_get_left(&wb[currbuf]));
if (i >= 0)
tmpwrit = i;
} else {
SSLerr(SSL_F_SSL3_WRITE_PENDING, SSL_R_BIO_NOT_SET);
i = -1;
}
if (i > 0 && tmpwrit == SSL3_BUFFER_get_left(&wb[currbuf])) {
SSL3_BUFFER_set_left(&wb[currbuf], 0);
SSL3_BUFFER_add_offset(&wb[currbuf], tmpwrit);
if (currbuf + 1 < s->rlayer.numwpipes)
continue;
s->rwstate = SSL_NOTHING;
*written = s->rlayer.wpend_ret;
return 1;
} else if (i <= 0) {
if (SSL_IS_DTLS(s)) {
SSL3_BUFFER_set_left(&wb[currbuf], 0);
}
return (i);
}
SSL3_BUFFER_add_offset(&wb[currbuf], tmpwrit);
SSL3_BUFFER_sub_left(&wb[currbuf], tmpwrit);
}
}
ssl/statem/statem.c:806: error: INTEGER_OVERFLOW_L2
([0, +oo] - 1):unsigned64 by call to `statem_do_write`.
Showing all 13 steps of the trace
ssl/statem/statem.c:711:1: Parameter `s->rlayer.numwpipes`
709. * result in an NBIO event.
710. */
711. > static SUB_STATE_RETURN write_state_machine(SSL *s)
712. {
713. OSSL_STATEM *st = &s->statem;
ssl/statem/statem.c:806:19: Call
804. dtls1_start_timer(s);
805. }
806. ret = statem_do_write(s);
^
807. if (ret <= 0) {
808. return SUB_STATE_ERROR;
ssl/statem/statem.c:655:1: Parameter `s->rlayer.numwpipes`
653. * Send a previously constructed message to the peer.
654. */
655. > static int statem_do_write(SSL *s)
656. {
657. OSSL_STATEM *st = &s->statem;
ssl/statem/statem.c:662:20: Call
660. || st->hand_state == TLS_ST_SW_CHANGE) {
661. if (SSL_IS_DTLS(s))
662. return dtls1_do_write(s, SSL3_RT_CHANGE_CIPHER_SPEC);
^
663. else
664. return ssl3_do_write(s, SSL3_RT_CHANGE_CIPHER_SPEC);
ssl/statem/statem_dtls.c:109:1: Parameter `s->rlayer.numwpipes`
107. * SSL3_RT_CHANGE_CIPHER_SPEC)
108. */
109. > int dtls1_do_write(SSL *s, int type)
110. {
111. int ret;
ssl/statem/statem_dtls.c:239:15: Call
237. }
238.
239. ret = dtls1_write_bytes(s, type, &s->init_buf->data[s->init_off], len,
^
240. &written);
241. if (ret < 0) {
ssl/record/rec_layer_d1.c:730:1: Parameter `s->rlayer.numwpipes`
728. * not all data has been sent or non-blocking IO.
729. */
730. > int dtls1_write_bytes(SSL *s, int type, const void *buf, size_t len,
731. size_t *written)
732. {
ssl/record/rec_layer_d1.c:740:9: Call
738. }
739. s->rwstate = SSL_NOTHING;
740. i = do_dtls1_write(s, type, buf, len, 0, written);
^
741. return i;
742. }
ssl/record/rec_layer_d1.c:744:1: Parameter `s->rlayer.numwpipes`
742. }
743.
744. > int do_dtls1_write(SSL *s, int type, const unsigned char *buf,
745. size_t len, int create_empty_fragment, size_t *written)
746. {
ssl/record/rec_layer_d1.c:936:12: Call
934.
935. /* we now just need to write the buffer */
936. return ssl3_write_pending(s, type, buf, len, written);
^
937. err:
938. return -1;
ssl/record/rec_layer_s3.c:1058:1: <LHS trace>
1056. * Return values are as per SSL_write()
1057. */
1058. > int ssl3_write_pending(SSL *s, int type, const unsigned char *buf, size_t len,
1059. size_t *written)
1060. {
ssl/record/rec_layer_s3.c:1058:1: Parameter `s->rlayer.numwpipes`
1056. * Return values are as per SSL_write()
1057. */
1058. > int ssl3_write_pending(SSL *s, int type, const unsigned char *buf, size_t len,
1059. size_t *written)
1060. {
ssl/record/rec_layer_s3.c:1077:16: Binary operation: ([0, +oo] - 1):unsigned64 by call to `statem_do_write`
1075. /* Loop until we find a buffer we haven't written out yet */
1076. if (SSL3_BUFFER_get_left(&wb[currbuf]) == 0
1077. && currbuf < s->rlayer.numwpipes - 1) {
^
1078. currbuf++;
1079. continue;
|
https://github.com/openssl/openssl/blob/7f7eb90b8ac55997c5c825bb3ebcfe28611e06f5/ssl/record/rec_layer_s3.c/#L1077
|
d2a_code_trace_data_42960
|
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:4113: error: Null Dereference
pointer `today` last assigned on line 4111 could be null and is dereferenced at line 4113, column 69.
ffmpeg.c:4107:1: start of procedure opt_vstats()
4105. }
4106.
4107. static void opt_vstats (void)
^
4108. {
4109. char filename[40];
ffmpeg.c:4110:5:
4108. {
4109. char filename[40];
4110. time_t today2 = time(NULL);
^
4111. struct tm *today = localtime(&today2);
4112.
ffmpeg.c:4111:5:
4109. char filename[40];
4110. time_t today2 = time(NULL);
4111. struct tm *today = localtime(&today2);
^
4112.
4113. snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min,
ffmpeg.c:4113:5:
4111. struct tm *today = localtime(&today2);
4112.
4113. snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min,
^
4114. today->tm_sec);
4115. opt_vstats_file(filename);
|
https://github.com/libav/libav/blob/f4c79d1e0b2e797012304db57903e4091b0c2d7c/ffmpeg.c/#L4113
|
d2a_code_trace_data_42961
|
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:1689: error: INTEGER_OVERFLOW_L2
([1, +oo] - [0, 17728]):unsigned64 by call to `ssl3_cbc_copy_mac`.
Showing all 10 steps of the trace
ssl/record/ssl3_record.c:1553:1: Parameter `s->rlayer.rrec.length`
1551. }
1552.
1553. > int dtls1_process_record(SSL *s, DTLS1_BITMAP *bitmap)
1554. {
1555. int i;
ssl/record/ssl3_record.c:1593:5: Assignment
1591. /* decrypt in place in 'rr->input' */
1592. rr->data = rr->input;
1593. rr->orig_len = rr->length;
^
1594.
1595. if (SSL_READ_ETM(s) && s->read_hash) {
ssl/record/ssl3_record.c:1689:18: Call
1687. */
1688. mac = mac_tmp;
1689. if (!ssl3_cbc_copy_mac(mac_tmp, rr, mac_size)) {
^
1690. SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_DTLS1_PROCESS_RECORD,
1691. ERR_R_INTERNAL_ERROR);
ssl/record/ssl3_record.c:1478:1: Parameter `md_size`
1476. #define CBC_MAC_ROTATE_IN_PLACE
1477.
1478. > int ssl3_cbc_copy_mac(unsigned char *out,
1479. const SSL3_RECORD *rec, size_t md_size)
1480. {
ssl/record/ssl3_record.c:1526:14: Call
1524. rotate_offset |= j & mac_started;
1525. rotated_mac[j++] |= b & in_mac;
1526. j &= constant_time_lt_s(j, md_size);
^
1527. }
1528.
include/internal/constant_time_locl.h:119:1: <LHS trace>
117. }
118.
119. > static ossl_inline size_t constant_time_lt_s(size_t a, size_t b)
120. {
121. return constant_time_msb_s(a ^ ((a ^ b) | ((a - b) ^ b)));
include/internal/constant_time_locl.h:119:1: Parameter `a`
117. }
118.
119. > static ossl_inline size_t constant_time_lt_s(size_t a, size_t b)
120. {
121. return constant_time_msb_s(a ^ ((a ^ b) | ((a - b) ^ b)));
include/internal/constant_time_locl.h:119:1: <RHS trace>
117. }
118.
119. > static ossl_inline size_t constant_time_lt_s(size_t a, size_t b)
120. {
121. return constant_time_msb_s(a ^ ((a ^ b) | ((a - b) ^ b)));
include/internal/constant_time_locl.h:119:1: Parameter `b`
117. }
118.
119. > static ossl_inline size_t constant_time_lt_s(size_t a, size_t b)
120. {
121. return constant_time_msb_s(a ^ ((a ^ b) | ((a - b) ^ b)));
include/internal/constant_time_locl.h:121:12: Binary operation: ([1, +oo] - [0, 17728]):unsigned64 by call to `ssl3_cbc_copy_mac`
119. static ossl_inline size_t constant_time_lt_s(size_t a, size_t b)
120. {
121. return constant_time_msb_s(a ^ ((a ^ b) | ((a - b) ^ b)));
^
122. }
123.
|
https://github.com/openssl/openssl/blob/a8ea8018fa187e22fb4989450b550589e20f62c2/include/internal/constant_time_locl.h/#L121
|
d2a_code_trace_data_42962
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
crypto/bn/bn_prime.c:215: error: BUFFER_OVERRUN_L3
Offset: [-1, +oo] Size: [1, +oo] by call to `BN_MONT_CTX_set`.
Showing all 46 steps of the trace
crypto/bn/bn_prime.c:151:1: Parameter `ctx_passed->stack.depth`
149. }
150.
151. > int BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed,
152. int do_trial_division, BN_GENCB *cb)
153. {
crypto/bn/bn_prime.c:188:5: Call
186. else if ((ctx = BN_CTX_new()) == NULL)
187. goto err;
188. BN_CTX_start(ctx);
^
189.
190. A1 = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth`
169. }
170.
171. > void BN_CTX_start(BN_CTX *ctx)
172. {
173. CTXDBG("ENTER BN_CTX_start()", ctx);
crypto/bn/bn_prime.c:215:10: Call
213. if (mont == NULL)
214. goto err;
215. if (!BN_MONT_CTX_set(mont, a, ctx))
^
216. goto err;
217.
crypto/bn/bn_mont.c:263:1: Parameter `ctx->stack.depth`
261. }
262.
263. > int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
264. {
265. int i, ret = 0;
crypto/bn/bn_mont.c:271:5: Call
269. return 0;
270.
271. BN_CTX_start(ctx);
^
272. if ((Ri = BN_CTX_get(ctx)) == NULL)
273. goto err;
crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth`
169. }
170.
171. > void BN_CTX_start(BN_CTX *ctx)
172. {
173. CTXDBG("ENTER BN_CTX_start()", ctx);
crypto/bn/bn_mont.c:272:15: Call
270.
271. BN_CTX_start(ctx);
272. if ((Ri = BN_CTX_get(ctx)) == NULL)
^
273. goto err;
274. R = &(mont->RR); /* grab RR as a temp */
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/bn/bn_mont.c:351:19: Call
349. if (BN_is_one(&tmod))
350. BN_zero(Ri);
351. else if ((BN_mod_inverse(Ri, R, &tmod, ctx)) == NULL)
^
352. goto err;
353. if (!BN_lshift(Ri, Ri, BN_BITS2))
crypto/bn/bn_gcd.c:124:1: Parameter `ctx->stack.depth`
122. BN_CTX *ctx);
123.
124. > BIGNUM *BN_mod_inverse(BIGNUM *in,
125. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx)
126. {
crypto/bn/bn_gcd.c:129:10: Call
127. BIGNUM *rv;
128. int noinv;
129. rv = int_bn_mod_inverse(in, a, n, ctx, &noinv);
^
130. if (noinv)
131. BNerr(BN_F_BN_MOD_INVERSE, BN_R_NO_INVERSE);
crypto/bn/bn_gcd.c:135:1: Parameter `ctx->stack.depth`
133. }
134.
135. > BIGNUM *int_bn_mod_inverse(BIGNUM *in,
136. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx,
137. int *pnoinv)
crypto/bn/bn_gcd.c:155:16: Call
153. if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0)
154. || (BN_get_flags(n, BN_FLG_CONSTTIME) != 0)) {
155. return BN_mod_inverse_no_branch(in, a, n, ctx);
^
156. }
157.
crypto/bn/bn_gcd.c:458:1: Parameter `ctx->stack.depth`
456. * not contain branches that may leak sensitive information.
457. */
458. > static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
459. const BIGNUM *a, const BIGNUM *n,
460. BN_CTX *ctx)
crypto/bn/bn_gcd.c:469:5: Call
467. bn_check_top(n);
468.
469. BN_CTX_start(ctx);
^
470. A = BN_CTX_get(ctx);
471. B = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth`
169. }
170.
171. > void BN_CTX_start(BN_CTX *ctx)
172. {
173. CTXDBG("ENTER BN_CTX_start()", ctx);
crypto/bn/bn_gcd.c:470:9: Call
468.
469. BN_CTX_start(ctx);
470. A = BN_CTX_get(ctx);
^
471. B = BN_CTX_get(ctx);
472. X = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/bn/bn_gcd.c:471:9: Call
469. BN_CTX_start(ctx);
470. A = BN_CTX_get(ctx);
471. B = BN_CTX_get(ctx);
^
472. X = BN_CTX_get(ctx);
473. D = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/bn/bn_gcd.c:472:9: Call
470. A = BN_CTX_get(ctx);
471. B = BN_CTX_get(ctx);
472. X = BN_CTX_get(ctx);
^
473. D = BN_CTX_get(ctx);
474. M = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/bn/bn_gcd.c:473:9: Call
471. B = BN_CTX_get(ctx);
472. X = BN_CTX_get(ctx);
473. D = BN_CTX_get(ctx);
^
474. M = BN_CTX_get(ctx);
475. Y = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/bn/bn_gcd.c:474:9: Call
472. X = BN_CTX_get(ctx);
473. D = BN_CTX_get(ctx);
474. M = BN_CTX_get(ctx);
^
475. Y = BN_CTX_get(ctx);
476. T = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/bn/bn_gcd.c:475:9: Call
473. D = BN_CTX_get(ctx);
474. M = BN_CTX_get(ctx);
475. Y = BN_CTX_get(ctx);
^
476. T = BN_CTX_get(ctx);
477. if (T == NULL)
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/bn/bn_gcd.c:476:9: Call
474. M = BN_CTX_get(ctx);
475. Y = BN_CTX_get(ctx);
476. T = BN_CTX_get(ctx);
^
477. if (T == NULL)
478. goto err;
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/bn/bn_gcd.c:504:18: Call
502. bn_init(&local_B);
503. BN_with_flags(&local_B, B, BN_FLG_CONSTTIME);
504. if (!BN_nnmod(B, &local_B, A, ctx))
^
505. goto err;
506. /* Ensure local_B goes out of scope before any further use of B */
crypto/bn/bn_mod.c:13:1: Parameter `ctx->stack.depth`
11. #include "bn_lcl.h"
12.
13. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx)
14. {
15. /*
crypto/bn/bn_mod.c:20:11: Call
18. */
19.
20. if (!(BN_mod(r, m, d, ctx)))
^
21. return 0;
22. if (!r->neg)
crypto/bn/bn_div.c:209:1: Parameter `ctx->stack.depth`
207. * If 'dv' or 'rm' is NULL, the respective value is not returned.
208. */
209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
210. BN_CTX *ctx)
211. {
crypto/bn/bn_div.c:229:11: Call
227. }
228.
229. ret = bn_div_fixed_top(dv, rm, num, divisor, ctx);
^
230.
231. if (ret) {
crypto/bn/bn_div.c:280:5: Call
278. bn_check_top(rm);
279.
280. BN_CTX_start(ctx);
^
281. res = (dv == NULL) ? BN_CTX_get(ctx) : dv;
282. tmp = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:171:1: Parameter `*ctx->stack.indexes`
169. }
170.
171. > void BN_CTX_start(BN_CTX *ctx)
172. {
173. CTXDBG("ENTER BN_CTX_start()", ctx);
crypto/bn/bn_div.c:450:5: Call
448. if (rm != NULL)
449. bn_rshift_fixed_top(rm, snum, norm_shift);
450. BN_CTX_end(ctx);
^
451. return 1;
452. err:
crypto/bn/bn_ctx.c:185:1: Parameter `*ctx->stack.indexes`
183. }
184.
185. > void BN_CTX_end(BN_CTX *ctx)
186. {
187. CTXDBG("ENTER BN_CTX_end()", ctx);
crypto/bn/bn_ctx.c:191:27: Call
189. ctx->err_stack--;
190. else {
191. unsigned int fp = BN_STACK_pop(&ctx->stack);
^
192. /* Does this stack frame have anything to release? */
193. if (fp < ctx->used)
crypto/bn/bn_ctx.c:266:1: <Offset trace>
264. }
265.
266. > static unsigned int BN_STACK_pop(BN_STACK *st)
267. {
268. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:266:1: Parameter `st->depth`
264. }
265.
266. > static unsigned int BN_STACK_pop(BN_STACK *st)
267. {
268. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:266:1: <Length trace>
264. }
265.
266. > static unsigned int BN_STACK_pop(BN_STACK *st)
267. {
268. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:266:1: Parameter `*st->indexes`
264. }
265.
266. > static unsigned int BN_STACK_pop(BN_STACK *st)
267. {
268. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:268:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_MONT_CTX_set`
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_42963
|
void RAND_add(const void *buf, int num, double randomness)
{
const RAND_METHOD *meth = RAND_get_rand_method();
if (meth->add != NULL)
meth->add(buf, num, randomness);
}
crypto/rand/rand_lib.c:138: error: NULL_DEREFERENCE
pointer `meth` last assigned on line 136 could be null and is dereferenced at line 138, column 9.
Showing all 14 steps of the trace
crypto/rand/rand_lib.c:134:1: start of procedure RAND_add()
132. }
133.
134. > void RAND_add(const void *buf, int num, double randomness)
135. {
136. const RAND_METHOD *meth = RAND_get_rand_method();
crypto/rand/rand_lib.c:136:5:
134. void RAND_add(const void *buf, int num, double randomness)
135. {
136. > const RAND_METHOD *meth = RAND_get_rand_method();
137.
138. if (meth->add != NULL)
crypto/rand/rand_lib.c:70:1: start of procedure RAND_get_rand_method()
68. }
69.
70. > const RAND_METHOD *RAND_get_rand_method(void)
71. {
72. const RAND_METHOD *tmp_meth = NULL;
crypto/rand/rand_lib.c:72:5:
70. const RAND_METHOD *RAND_get_rand_method(void)
71. {
72. > const RAND_METHOD *tmp_meth = NULL;
73.
74. if (!RUN_ONCE(&rand_init, do_rand_init))
crypto/rand/rand_lib.c:74:10:
72. const RAND_METHOD *tmp_meth = NULL;
73.
74. > if (!RUN_ONCE(&rand_init, do_rand_init))
75. return NULL;
76.
crypto/threads_pthread.c:105:1: start of procedure CRYPTO_THREAD_run_once()
103. }
104.
105. > int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))
106. {
107. if (pthread_once(once, init) != 0)
crypto/threads_pthread.c:107:9: Taking true branch
105. int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))
106. {
107. if (pthread_once(once, init) != 0)
^
108. return 0;
109.
crypto/threads_pthread.c:108:9:
106. {
107. if (pthread_once(once, init) != 0)
108. > return 0;
109.
110. return 1;
crypto/threads_pthread.c:111:1: return from a call to CRYPTO_THREAD_run_once
109.
110. return 1;
111. > }
112.
113. int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *))
crypto/rand/rand_lib.c:74:10: Condition is false
72. const RAND_METHOD *tmp_meth = NULL;
73.
74. if (!RUN_ONCE(&rand_init, do_rand_init))
^
75. return NULL;
76.
crypto/rand/rand_lib.c:74:10: Taking true branch
72. const RAND_METHOD *tmp_meth = NULL;
73.
74. if (!RUN_ONCE(&rand_init, do_rand_init))
^
75. return NULL;
76.
crypto/rand/rand_lib.c:75:9:
73.
74. if (!RUN_ONCE(&rand_init, do_rand_init))
75. > return NULL;
76.
77. CRYPTO_THREAD_write_lock(rand_meth_lock);
crypto/rand/rand_lib.c:98:1: return from a call to RAND_get_rand_method
96. CRYPTO_THREAD_unlock(rand_meth_lock);
97. return tmp_meth;
98. > }
99.
100. #ifndef OPENSSL_NO_ENGINE
crypto/rand/rand_lib.c:138:9:
136. const RAND_METHOD *meth = RAND_get_rand_method();
137.
138. > if (meth->add != NULL)
139. meth->add(buf, num, randomness);
140. }
|
https://github.com/openssl/openssl/blob/12fb8c3d2dd00f3d4f1b084385403d26ed64a596/crypto/rand/rand_lib.c/#L138
|
d2a_code_trace_data_42964
|
static int ec_bits(const EVP_PKEY *pkey)
{
BIGNUM *order = BN_new();
const EC_GROUP *group;
int ret;
if (order == NULL) {
ERR_clear_error();
return 0;
}
group = EC_KEY_get0_group(pkey->pkey.ec);
if (!EC_GROUP_get_order(group, order, NULL)) {
ERR_clear_error();
return 0;
}
ret = BN_num_bits(order);
BN_free(order);
return ret;
}
crypto/ec/ec_ameth.c:373: error: MEMORY_LEAK
memory dynamically allocated by call to `BN_new()` at line 358, column 21 is not reachable after line 373, column 5.
Showing all 65 steps of the trace
crypto/ec/ec_ameth.c:356:1: start of procedure ec_bits()
354. }
355.
356. > static int ec_bits(const EVP_PKEY *pkey)
357. {
358. BIGNUM *order = BN_new();
crypto/ec/ec_ameth.c:358:5:
356. static int ec_bits(const EVP_PKEY *pkey)
357. {
358. > BIGNUM *order = BN_new();
359. const EC_GROUP *group;
360. int ret;
crypto/bn/bn_lib.c:277:1: start of procedure BN_new()
275. }
276.
277. > BIGNUM *BN_new(void)
278. {
279. BIGNUM *ret;
crypto/bn/bn_lib.c:281:9:
279. BIGNUM *ret;
280.
281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
155. }
156.
157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:159:5:
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. > void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:161:9: Taking true branch
159. void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
^
162. memset(ret, 0, num);
163. return ret;
crypto/mem.c:162:9:
160.
161. if (ret != NULL)
162. > memset(ret, 0, num);
163. return ret;
164. }
crypto/mem.c:163:5:
161. if (ret != NULL)
162. memset(ret, 0, num);
163. > return ret;
164. }
165.
crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
162. memset(ret, 0, num);
163. return ret;
164. > }
165.
166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/bn/bn_lib.c:281:9: Taking false branch
279. BIGNUM *ret;
280.
281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
^
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/bn/bn_lib.c:285:5:
283. return (NULL);
284. }
285. > ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. return (ret);
crypto/bn/bn_lib.c:287:5:
285. ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. > return (ret);
288. }
289.
crypto/bn/bn_lib.c:288:1: return from a call to BN_new
286. bn_check_top(ret);
287. return (ret);
288. > }
289.
290. BIGNUM *BN_secure_new(void)
crypto/ec/ec_ameth.c:362:9: Taking false branch
360. int ret;
361.
362. if (order == NULL) {
^
363. ERR_clear_error();
364. return 0;
crypto/ec/ec_ameth.c:366:5:
364. return 0;
365. }
366. > group = EC_KEY_get0_group(pkey->pkey.ec);
367. if (!EC_GROUP_get_order(group, order, NULL)) {
368. ERR_clear_error();
crypto/ec/ec_key.c:450:1: start of procedure EC_KEY_get0_group()
448. }
449.
450. > const EC_GROUP *EC_KEY_get0_group(const EC_KEY *key)
451. {
452. return key->group;
crypto/ec/ec_key.c:452:5:
450. const EC_GROUP *EC_KEY_get0_group(const EC_KEY *key)
451. {
452. > return key->group;
453. }
454.
crypto/ec/ec_key.c:453:1: return from a call to EC_KEY_get0_group
451. {
452. return key->group;
453. > }
454.
455. int EC_KEY_set_group(EC_KEY *key, const EC_GROUP *group)
crypto/ec/ec_ameth.c:367:10:
365. }
366. group = EC_KEY_get0_group(pkey->pkey.ec);
367. > if (!EC_GROUP_get_order(group, order, NULL)) {
368. ERR_clear_error();
369. return 0;
crypto/ec/ec_lib.c:313:1: start of procedure EC_GROUP_get_order()
311. }
312.
313. > int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx)
314. {
315. if (!BN_copy(order, group->order))
crypto/ec/ec_lib.c:315:10: Taking false branch
313. int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx)
314. {
315. if (!BN_copy(order, group->order))
^
316. return 0;
317.
crypto/ec/ec_lib.c:318:13:
316. return 0;
317.
318. > return !BN_is_zero(order);
319. }
320.
crypto/bn/bn_lib.c:899:1: start of procedure BN_is_zero()
897. }
898.
899. > int BN_is_zero(const BIGNUM *a)
900. {
901. return a->top == 0;
crypto/bn/bn_lib.c:901:12: Condition is false
899. int BN_is_zero(const BIGNUM *a)
900. {
901. return a->top == 0;
^
902. }
903.
crypto/bn/bn_lib.c:901:5:
899. int BN_is_zero(const BIGNUM *a)
900. {
901. > return a->top == 0;
902. }
903.
crypto/bn/bn_lib.c:902:1: return from a call to BN_is_zero
900. {
901. return a->top == 0;
902. > }
903.
904. int BN_is_one(const BIGNUM *a)
crypto/ec/ec_lib.c:318:13: Condition is false
316. return 0;
317.
318. return !BN_is_zero(order);
^
319. }
320.
crypto/ec/ec_lib.c:318:12:
316. return 0;
317.
318. > return !BN_is_zero(order);
319. }
320.
crypto/ec/ec_lib.c:318:5:
316. return 0;
317.
318. > return !BN_is_zero(order);
319. }
320.
crypto/ec/ec_lib.c:319:1: return from a call to EC_GROUP_get_order
317.
318. return !BN_is_zero(order);
319. > }
320.
321. int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor,
crypto/ec/ec_ameth.c:367:10: Taking false branch
365. }
366. group = EC_KEY_get0_group(pkey->pkey.ec);
367. if (!EC_GROUP_get_order(group, order, NULL)) {
^
368. ERR_clear_error();
369. return 0;
crypto/ec/ec_ameth.c:372:5:
370. }
371.
372. > ret = BN_num_bits(order);
373. BN_free(order);
374. return ret;
crypto/bn/bn_lib.c:215:1: start of procedure BN_num_bits()
213. }
214.
215. > int BN_num_bits(const BIGNUM *a)
216. {
217. int i = a->top - 1;
crypto/bn/bn_lib.c:217:5:
215. int BN_num_bits(const BIGNUM *a)
216. {
217. > int i = a->top - 1;
218. bn_check_top(a);
219.
crypto/bn/bn_lib.c:220:9:
218. bn_check_top(a);
219.
220. > if (BN_is_zero(a))
221. return 0;
222. return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));
crypto/bn/bn_lib.c:899:1: start of procedure BN_is_zero()
897. }
898.
899. > int BN_is_zero(const BIGNUM *a)
900. {
901. return a->top == 0;
crypto/bn/bn_lib.c:901:12: Condition is false
899. int BN_is_zero(const BIGNUM *a)
900. {
901. return a->top == 0;
^
902. }
903.
crypto/bn/bn_lib.c:901:5:
899. int BN_is_zero(const BIGNUM *a)
900. {
901. > return a->top == 0;
902. }
903.
crypto/bn/bn_lib.c:902:1: return from a call to BN_is_zero
900. {
901. return a->top == 0;
902. > }
903.
904. int BN_is_one(const BIGNUM *a)
crypto/bn/bn_lib.c:220:9: Taking false branch
218. bn_check_top(a);
219.
220. if (BN_is_zero(a))
^
221. return 0;
222. return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));
crypto/bn/bn_lib.c:222:5: Skipping BN_num_bits_word(): empty list of specs
220. if (BN_is_zero(a))
221. return 0;
222. return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));
^
223. }
224.
crypto/bn/bn_lib.c:223:1: return from a call to BN_num_bits
221. return 0;
222. return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));
223. > }
224.
225. static void bn_free_d(BIGNUM *a)
crypto/ec/ec_ameth.c:373:5:
371.
372. ret = BN_num_bits(order);
373. > BN_free(order);
374. return ret;
375. }
crypto/bn/bn_lib.c:252:1: start of procedure BN_free()
250. }
251.
252. > void BN_free(BIGNUM *a)
253. {
254. if (a == NULL)
crypto/bn/bn_lib.c:254:9: Taking false branch
252. void BN_free(BIGNUM *a)
253. {
254. if (a == NULL)
^
255. return;
256. bn_check_top(a);
crypto/bn/bn_lib.c:257:10:
255. return;
256. bn_check_top(a);
257. > if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
258. bn_free_d(a);
259. if (a->flags & BN_FLG_MALLOCED)
crypto/bn/bn_lib.c:965:1: start of procedure BN_get_flags()
963. }
964.
965. > int BN_get_flags(const BIGNUM *b, int n)
966. {
967. return b->flags & n;
crypto/bn/bn_lib.c:967:5:
965. int BN_get_flags(const BIGNUM *b, int n)
966. {
967. > return b->flags & n;
968. }
969.
crypto/bn/bn_lib.c:968:1: return from a call to BN_get_flags
966. {
967. return b->flags & n;
968. > }
969.
970. /* Populate a BN_GENCB structure with an "old"-style callback */
crypto/bn/bn_lib.c:257:10: Taking false branch
255. return;
256. bn_check_top(a);
257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
^
258. bn_free_d(a);
259. if (a->flags & BN_FLG_MALLOCED)
crypto/bn/bn_lib.c:259:9: Taking false branch
257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
258. bn_free_d(a);
259. if (a->flags & BN_FLG_MALLOCED)
^
260. OPENSSL_free(a);
261. else {
crypto/bn/bn_lib.c:263:9:
261. else {
262. #if OPENSSL_API_COMPAT < 0x00908000L
263. > a->flags |= BN_FLG_FREE;
264. #endif
265. a->d = NULL;
crypto/bn/bn_lib.c:265:9:
263. a->flags |= BN_FLG_FREE;
264. #endif
265. > a->d = NULL;
266. }
267. }
crypto/bn/bn_lib.c:259:5:
257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
258. bn_free_d(a);
259. > if (a->flags & BN_FLG_MALLOCED)
260. OPENSSL_free(a);
261. else {
crypto/bn/bn_lib.c:267:1: return from a call to BN_free
265. a->d = NULL;
266. }
267. > }
268.
269. void bn_init(BIGNUM *a)
|
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/crypto/ec/ec_ameth.c/#L373
|
d2a_code_trace_data_42965
|
static void unpack_input(const unsigned char *input, unsigned int *output)
{
unsigned int outbuffer[28];
unsigned short inbuffer[10];
unsigned int x;
unsigned int *ptr;
for (x=0;x<20;x+=2)
inbuffer[x/2]=(input[x]<<8)+input[x+1];
ptr=outbuffer;
*(ptr++)=27;
*(ptr++)=(inbuffer[0]>>10)&0x3f;
*(ptr++)=(inbuffer[0]>>5)&0x1f;
*(ptr++)=inbuffer[0]&0x1f;
*(ptr++)=(inbuffer[1]>>12)&0xf;
*(ptr++)=(inbuffer[1]>>8)&0xf;
*(ptr++)=(inbuffer[1]>>5)&7;
*(ptr++)=(inbuffer[1]>>2)&7;
*(ptr++)=((inbuffer[1]<<1)&6)|((inbuffer[2]>>15)&1);
*(ptr++)=(inbuffer[2]>>12)&7;
*(ptr++)=(inbuffer[2]>>10)&3;
*(ptr++)=(inbuffer[2]>>5)&0x1f;
*(ptr++)=((inbuffer[2]<<2)&0x7c)|((inbuffer[3]>>14)&3);
*(ptr++)=(inbuffer[3]>>6)&0xff;
*(ptr++)=((inbuffer[3]<<1)&0x7e)|((inbuffer[4]>>15)&1);
*(ptr++)=(inbuffer[4]>>8)&0x7f;
*(ptr++)=(inbuffer[4]>>1)&0x7f;
*(ptr++)=((inbuffer[4]<<7)&0x80)|((inbuffer[5]>>9)&0x7f);
*(ptr++)=(inbuffer[5]>>2)&0x7f;
*(ptr++)=((inbuffer[5]<<5)&0x60)|((inbuffer[6]>>11)&0x1f);
*(ptr++)=(inbuffer[6]>>4)&0x7f;
*(ptr++)=((inbuffer[6]<<4)&0xf0)|((inbuffer[7]>>12)&0xf);
*(ptr++)=(inbuffer[7]>>5)&0x7f;
*(ptr++)=((inbuffer[7]<<2)&0x7c)|((inbuffer[8]>>14)&3);
*(ptr++)=(inbuffer[8]>>7)&0x7f;
*(ptr++)=((inbuffer[8]<<1)&0xfe)|((inbuffer[9]>>15)&1);
*(ptr++)=(inbuffer[9]>>8)&0x7f;
*(ptr++)=(inbuffer[9]>>1)&0x7f;
*(output++)=outbuffer[11];
for (x=1;x<11;*(output++)=outbuffer[x++]);
ptr=outbuffer+12;
for (x=0;x<16;x+=4)
{
*(output++)=ptr[x];
*(output++)=ptr[x+2];
*(output++)=ptr[x+3];
*(output++)=ptr[x+1];
}
}
libavcodec/ra144.c:282: error: Uninitialized Value
The value read from inbuffer[_] was never initialized.
libavcodec/ra144.c:282:3:
280. *(ptr++)=(inbuffer[3]>>6)&0xff;
281. *(ptr++)=((inbuffer[3]<<1)&0x7e)|((inbuffer[4]>>15)&1);
282. *(ptr++)=(inbuffer[4]>>8)&0x7f;
^
283. *(ptr++)=(inbuffer[4]>>1)&0x7f;
284. *(ptr++)=((inbuffer[4]<<7)&0x80)|((inbuffer[5]>>9)&0x7f);
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/ra144.c/#L282
|
d2a_code_trace_data_42966
|
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:795: error: NULL_DEREFERENCE
pointer `x` last assigned on line 794 could be null and is dereferenced by call to `X509_get1_ocsp()` at line 795, column 8.
Showing all 31 steps of the trace
apps/s_server.c:768:1: start of procedure cert_status_cb()
766. */
767.
768. > static int cert_status_cb(SSL *s, void *arg)
769. {
770. tlsextstatusctx *srctx = arg;
apps/s_server.c:770:2:
768. static int cert_status_cb(SSL *s, void *arg)
769. {
770. > tlsextstatusctx *srctx = arg;
771. BIO *err = srctx->err;
772. char *host, *port, *path;
apps/s_server.c:771:2:
769. {
770. tlsextstatusctx *srctx = arg;
771. > BIO *err = srctx->err;
772. char *host, *port, *path;
773. int use_ssl;
apps/s_server.c:774:2:
772. char *host, *port, *path;
773. int use_ssl;
774. > unsigned char *rspder = NULL;
775. int rspderlen;
776. STACK_OF(OPENSSL_STRING) *aia = NULL;
apps/s_server.c:776:2:
774. unsigned char *rspder = NULL;
775. int rspderlen;
776. > STACK_OF(OPENSSL_STRING) *aia = NULL;
777. X509 *x = NULL;
778. X509_STORE_CTX inctx;
apps/s_server.c:777:2:
775. int rspderlen;
776. STACK_OF(OPENSSL_STRING) *aia = NULL;
777. > X509 *x = NULL;
778. X509_STORE_CTX inctx;
779. X509_OBJECT obj;
apps/s_server.c:780:2:
778. X509_STORE_CTX inctx;
779. X509_OBJECT obj;
780. > OCSP_REQUEST *req = NULL;
781. OCSP_RESPONSE *resp = NULL;
782. OCSP_CERTID *id = NULL;
apps/s_server.c:781:2:
779. X509_OBJECT obj;
780. OCSP_REQUEST *req = NULL;
781. > OCSP_RESPONSE *resp = NULL;
782. OCSP_CERTID *id = NULL;
783. STACK_OF(X509_EXTENSION) *exts;
apps/s_server.c:782:2:
780. OCSP_REQUEST *req = NULL;
781. OCSP_RESPONSE *resp = NULL;
782. > OCSP_CERTID *id = NULL;
783. STACK_OF(X509_EXTENSION) *exts;
784. int ret = SSL_TLSEXT_ERR_NOACK;
apps/s_server.c:784:2:
782. OCSP_CERTID *id = NULL;
783. STACK_OF(X509_EXTENSION) *exts;
784. > int ret = SSL_TLSEXT_ERR_NOACK;
785. int i;
786. #if 0
apps/s_server.c:791:6: Taking true branch
789. BIO_printf(err, "cert_status: received %d ids\n", sk_OCSP_RESPID_num(ids));
790. #endif
791. if (srctx->verbose)
^
792. BIO_puts(err, "cert_status: callback called\n");
793. /* Build up OCSP query from server certificate */
apps/s_server.c:792:3:
790. #endif
791. if (srctx->verbose)
792. > BIO_puts(err, "cert_status: callback called\n");
793. /* Build up OCSP query from server certificate */
794. 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:794:2:
792. BIO_puts(err, "cert_status: callback called\n");
793. /* Build up OCSP query from server certificate */
794. > x = SSL_get_certificate(s);
795. aia = X509_get1_ocsp(x);
796. if (aia)
ssl/ssl_lib.c:2781:1: start of procedure SSL_get_certificate()
2779.
2780. /* Fix this function so that it takes an optional type parameter */
2781. > X509 *SSL_get_certificate(const SSL *s)
2782. {
2783. if (s->cert != NULL)
ssl/ssl_lib.c:2783:6: Taking false branch
2781. X509 *SSL_get_certificate(const SSL *s)
2782. {
2783. if (s->cert != NULL)
^
2784. return(s->cert->key->x509);
2785. else
ssl/ssl_lib.c:2786:3:
2784. return(s->cert->key->x509);
2785. else
2786. > return(NULL);
2787. }
2788.
ssl/ssl_lib.c:2787:2: return from a call to SSL_get_certificate
2785. else
2786. return(NULL);
2787. }
^
2788.
2789. /* Fix this function so that it takes an optional type parameter */
apps/s_server.c:795:2:
793. /* Build up OCSP query from server certificate */
794. x = SSL_get_certificate(s);
795. > aia = X509_get1_ocsp(x);
796. if (aia)
797. {
|
https://github.com/openssl/openssl/blob/d674bb4bc84e6e8cf510adfe7049cb19a2c29cf8/apps/s_server.c/#L795
|
d2a_code_trace_data_42967
|
static int stream_reqbody_read(proxy_http_req_t *req, apr_bucket_brigade *bb,
int nonblocking)
{
request_rec *r = req->r;
proxy_conn_rec *p_conn = req->backend;
apr_bucket_alloc_t *bucket_alloc = req->bucket_alloc;
apr_read_type_e block = nonblocking ? APR_NONBLOCK_READ : APR_BLOCK_READ;
apr_status_t status;
int rv;
for (;;) {
status = ap_get_brigade(r->input_filters, bb, AP_MODE_READBYTES,
block, HUGE_STRING_LEN);
if (block == APR_BLOCK_READ
|| (!APR_STATUS_IS_EAGAIN(status)
&& (status != APR_SUCCESS || !APR_BRIGADE_EMPTY(bb)))) {
break;
}
apr_brigade_cleanup(bb);
rv = ap_proxy_pass_brigade(bucket_alloc, r, p_conn, req->origin, bb, 1);
if (rv != OK) {
return rv;
}
block = APR_BLOCK_READ;
}
if (status != APR_SUCCESS) {
conn_rec *c = r->connection;
ap_log_rerror(APLOG_MARK, APLOG_ERR, status, r, APLOGNO(02608)
"read request body failed to %pI (%s)"
" from %s (%s)", p_conn->addr,
p_conn->hostname ? p_conn->hostname: "",
c->client_ip, c->remote_host ? c->remote_host: "");
return ap_map_http_request_error(status, HTTP_BAD_REQUEST);
}
return OK;
}
modules/proxy/mod_proxy_http.c:293: error: UNINITIALIZED_VALUE
The value read from status was never initialized.
modules/proxy/mod_proxy_http.c:293:9:
291. }
292.
293. if (status != APR_SUCCESS) {
^
294. conn_rec *c = r->connection;
295. ap_log_rerror(APLOG_MARK, APLOG_ERR, status, r, APLOGNO(02608)
|
https://github.com/apache/httpd/blob/04b4d0f94f75bdcc6338baf129b08c9c6c6ce87e/modules/proxy/mod_proxy_http.c/#L293
|
d2a_code_trace_data_42968
|
int SSL_CTX_use_serverinfo_file(SSL_CTX *ctx, const char *file)
{
unsigned char *serverinfo = NULL;
unsigned char *tmp;
size_t serverinfo_length = 0;
unsigned char *extension = 0;
long extension_length = 0;
char *name = NULL;
char *header = NULL;
char namePrefix1[] = "SERVERINFO FOR ";
char namePrefix2[] = "SERVERINFOV2 FOR ";
int ret = 0;
BIO *bin = NULL;
size_t num_extensions = 0, contextoff = 0;
if (ctx == NULL || file == NULL) {
SSLerr(SSL_F_SSL_CTX_USE_SERVERINFO_FILE, ERR_R_PASSED_NULL_PARAMETER);
goto end;
}
bin = BIO_new(BIO_s_file());
if (bin == NULL) {
SSLerr(SSL_F_SSL_CTX_USE_SERVERINFO_FILE, ERR_R_BUF_LIB);
goto end;
}
if (BIO_read_filename(bin, file) <= 0) {
SSLerr(SSL_F_SSL_CTX_USE_SERVERINFO_FILE, ERR_R_SYS_LIB);
goto end;
}
for (num_extensions = 0;; num_extensions++) {
unsigned int version;
if (PEM_read_bio(bin, &name, &header, &extension, &extension_length)
== 0) {
if (num_extensions == 0) {
SSLerr(SSL_F_SSL_CTX_USE_SERVERINFO_FILE,
SSL_R_NO_PEM_EXTENSIONS);
goto end;
} else
break;
}
if (strlen(name) < strlen(namePrefix1)) {
SSLerr(SSL_F_SSL_CTX_USE_SERVERINFO_FILE, SSL_R_PEM_NAME_TOO_SHORT);
goto end;
}
if (strncmp(name, namePrefix1, strlen(namePrefix1)) == 0) {
version = SSL_SERVERINFOV1;
} else {
if (strlen(name) < strlen(namePrefix2)) {
SSLerr(SSL_F_SSL_CTX_USE_SERVERINFO_FILE,
SSL_R_PEM_NAME_TOO_SHORT);
goto end;
}
if (strncmp(name, namePrefix2, strlen(namePrefix2)) != 0) {
SSLerr(SSL_F_SSL_CTX_USE_SERVERINFO_FILE,
SSL_R_PEM_NAME_BAD_PREFIX);
goto end;
}
version = SSL_SERVERINFOV2;
}
if (version == SSL_SERVERINFOV1) {
if (extension_length < 4
|| (extension[2] << 8) + extension[3]
!= extension_length - 4) {
SSLerr(SSL_F_SSL_CTX_USE_SERVERINFO_FILE, SSL_R_BAD_DATA);
goto end;
}
contextoff = 4;
} else {
if (extension_length < 8
|| (extension[6] << 8) + extension[7]
!= extension_length - 8) {
SSLerr(SSL_F_SSL_CTX_USE_SERVERINFO_FILE, SSL_R_BAD_DATA);
goto end;
}
}
tmp = OPENSSL_realloc(serverinfo, serverinfo_length + extension_length
+ contextoff);
if (tmp == NULL) {
SSLerr(SSL_F_SSL_CTX_USE_SERVERINFO_FILE, ERR_R_MALLOC_FAILURE);
goto end;
}
serverinfo = tmp;
if (contextoff > 0) {
unsigned char *sinfo = serverinfo + serverinfo_length;
sinfo[0] = 0;
sinfo[1] = 0;
sinfo[2] = (SYNTHV1CONTEXT >> 8) & 0xff;
sinfo[3] = SYNTHV1CONTEXT & 0xff;
}
memcpy(serverinfo + serverinfo_length + contextoff,
extension, extension_length);
serverinfo_length += extension_length + contextoff;
OPENSSL_free(name);
name = NULL;
OPENSSL_free(header);
header = NULL;
OPENSSL_free(extension);
extension = NULL;
}
ret = SSL_CTX_use_serverinfo_ex(ctx, SSL_SERVERINFOV2, serverinfo,
serverinfo_length);
end:
OPENSSL_free(name);
OPENSSL_free(header);
OPENSSL_free(extension);
OPENSSL_free(serverinfo);
BIO_free(bin);
return ret;
}
ssl/ssl_rsa.c:993: error: BUFFER_OVERRUN_L3
Offset: 7 Size: [1, +oo].
Showing all 6 steps of the trace
ssl/ssl_rsa.c:942:13: <Length trace>
940. unsigned int version;
941.
942. if (PEM_read_bio(bin, &name, &header, &extension, &extension_length)
^
943. == 0) {
944. /*
ssl/ssl_rsa.c:942:13: Call
940. unsigned int version;
941.
942. if (PEM_read_bio(bin, &name, &header, &extension, &extension_length)
^
943. == 0) {
944. /*
crypto/pem/pem_lib.c:973:1: Parameter `**data`
971. }
972.
973. > int PEM_read_bio(BIO *bp, char **name, char **header, unsigned char **data,
974. long *len)
975. {
crypto/pem/pem_lib.c:976:12: Call
974. long *len)
975. {
976. return PEM_read_bio_ex(bp, name, header, data, len, PEM_FLAG_EAY_COMPATIBLE);
^
977. }
978.
crypto/pem/pem_lib.c:896:1: Parameter `**data`
894. * characters, are malformed input and will be rejected.
895. */
896. > int PEM_read_bio_ex(BIO *bp, char **name_out, char **header,
897. unsigned char **data, long *len_out, unsigned int flags)
898. {
ssl/ssl_rsa.c:993:46: Array access: Offset: 7 Size: [1, +oo]
991. /* 8 byte header: 4 bytes context, 2 bytes type, 2 bytes len */
992. if (extension_length < 8
993. || (extension[6] << 8) + extension[7]
^
994. != extension_length - 8) {
995. SSLerr(SSL_F_SSL_CTX_USE_SERVERINFO_FILE, SSL_R_BAD_DATA);
|
https://github.com/openssl/openssl/blob/7671342e550ed2de676b23c79d0e7f45a381c76e/ssl/ssl_rsa.c/#L993
|
d2a_code_trace_data_42969
|
X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h,
X509_OBJECT *x)
{
int idx, i;
X509_OBJECT *obj;
idx = sk_X509_OBJECT_find(h, x);
if (idx == -1)
return NULL;
if ((x->type != X509_LU_X509) && (x->type != X509_LU_CRL))
return sk_X509_OBJECT_value(h, idx);
for (i = idx; i < sk_X509_OBJECT_num(h); i++) {
obj = sk_X509_OBJECT_value(h, i);
if (x509_object_cmp
((const X509_OBJECT **)&obj, (const X509_OBJECT **)&x))
return NULL;
if (x->type == X509_LU_X509) {
if (!X509_cmp(obj->data.x509, x->data.x509))
return obj;
} else if (x->type == X509_LU_CRL) {
if (!X509_CRL_match(obj->data.crl, x->data.crl))
return obj;
} else
return obj;
}
return NULL;
}
crypto/x509/x509_lu.c:590: error: NULL_DEREFERENCE
pointer `&obj` last assigned on line 589 could be null and is dereferenced by call to `x509_object_cmp()` at line 590, column 13.
Showing all 40 steps of the trace
crypto/x509/x509_lu.c:578:1: start of procedure X509_OBJECT_retrieve_match()
576. }
577.
578. > X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h,
579. X509_OBJECT *x)
580. {
crypto/x509/x509_lu.c:583:5:
581. int idx, i;
582. X509_OBJECT *obj;
583. > idx = sk_X509_OBJECT_find(h, x);
584. if (idx == -1)
585. return NULL;
include/openssl/x509_vfy.h:54:1: start of procedure sk_X509_OBJECT_find()
52.
53. DEFINE_STACK_OF(X509_LOOKUP)
54. > DEFINE_STACK_OF(X509_OBJECT)
55. DEFINE_STACK_OF(X509_VERIFY_PARAM)
56.
crypto/stack/stack.c:197:1: start of procedure OPENSSL_sk_find()
195. }
196.
197. > int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data)
198. {
199. return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);
crypto/stack/stack.c:199:5:
197. int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data)
198. {
199. > return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);
200. }
201.
crypto/stack/stack.c:172:1: start of procedure internal_find()
170. }
171.
172. > static int internal_find(OPENSSL_STACK *st, const void *data,
173. int ret_val_options)
174. {
crypto/stack/stack.c:178:9: Taking false branch
176. int i;
177.
178. if (st == NULL)
^
179. return -1;
180.
crypto/stack/stack.c:181:9: Taking true branch
179. return -1;
180.
181. if (st->comp == NULL) {
^
182. for (i = 0; i < st->num; i++)
183. if (st->data[i] == data)
crypto/stack/stack.c:182:14:
180.
181. if (st->comp == NULL) {
182. > for (i = 0; i < st->num; i++)
183. if (st->data[i] == data)
184. return (i);
crypto/stack/stack.c:182:21: Loop condition is true. Entering loop body
180.
181. if (st->comp == NULL) {
182. for (i = 0; i < st->num; i++)
^
183. if (st->data[i] == data)
184. return (i);
crypto/stack/stack.c:183:17: Taking false branch
181. if (st->comp == NULL) {
182. for (i = 0; i < st->num; i++)
183. if (st->data[i] == data)
^
184. return (i);
185. return (-1);
crypto/stack/stack.c:182:34:
180.
181. if (st->comp == NULL) {
182. > for (i = 0; i < st->num; i++)
183. if (st->data[i] == data)
184. return (i);
crypto/stack/stack.c:182:21: Loop condition is true. Entering loop body
180.
181. if (st->comp == NULL) {
182. for (i = 0; i < st->num; i++)
^
183. if (st->data[i] == data)
184. return (i);
crypto/stack/stack.c:183:17: Taking true branch
181. if (st->comp == NULL) {
182. for (i = 0; i < st->num; i++)
183. if (st->data[i] == data)
^
184. return (i);
185. return (-1);
crypto/stack/stack.c:184:17:
182. for (i = 0; i < st->num; i++)
183. if (st->data[i] == data)
184. > return (i);
185. return (-1);
186. }
crypto/stack/stack.c:195:1: return from a call to internal_find
193. return (-1);
194. return (int)((char **)r - st->data);
195. > }
196.
197. int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data)
crypto/stack/stack.c:200:1: return from a call to OPENSSL_sk_find
198. {
199. return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);
200. > }
201.
202. int OPENSSL_sk_find_ex(OPENSSL_STACK *st, const void *data)
include/openssl/x509_vfy.h:54:1: return from a call to sk_X509_OBJECT_find
52.
53. DEFINE_STACK_OF(X509_LOOKUP)
54. > DEFINE_STACK_OF(X509_OBJECT)
55. DEFINE_STACK_OF(X509_VERIFY_PARAM)
56.
crypto/x509/x509_lu.c:584:9: Taking false branch
582. X509_OBJECT *obj;
583. idx = sk_X509_OBJECT_find(h, x);
584. if (idx == -1)
^
585. return NULL;
586. if ((x->type != X509_LU_X509) && (x->type != X509_LU_CRL))
crypto/x509/x509_lu.c:586:10: Taking false branch
584. if (idx == -1)
585. return NULL;
586. if ((x->type != X509_LU_X509) && (x->type != X509_LU_CRL))
^
587. return sk_X509_OBJECT_value(h, idx);
588. for (i = idx; i < sk_X509_OBJECT_num(h); i++) {
crypto/x509/x509_lu.c:588:10:
586. if ((x->type != X509_LU_X509) && (x->type != X509_LU_CRL))
587. return sk_X509_OBJECT_value(h, idx);
588. > for (i = idx; i < sk_X509_OBJECT_num(h); i++) {
589. obj = sk_X509_OBJECT_value(h, i);
590. if (x509_object_cmp
crypto/x509/x509_lu.c:588:19:
586. if ((x->type != X509_LU_X509) && (x->type != X509_LU_CRL))
587. return sk_X509_OBJECT_value(h, idx);
588. > for (i = idx; i < sk_X509_OBJECT_num(h); i++) {
589. obj = sk_X509_OBJECT_value(h, i);
590. if (x509_object_cmp
include/openssl/x509_vfy.h:54:1: start of procedure sk_X509_OBJECT_num()
52.
53. DEFINE_STACK_OF(X509_LOOKUP)
54. > DEFINE_STACK_OF(X509_OBJECT)
55. DEFINE_STACK_OF(X509_VERIFY_PARAM)
56.
crypto/stack/stack.c:265:1: start of procedure OPENSSL_sk_num()
263. }
264.
265. > int OPENSSL_sk_num(const OPENSSL_STACK *st)
266. {
267. if (st == NULL)
crypto/stack/stack.c:267:9: Taking false branch
265. int OPENSSL_sk_num(const OPENSSL_STACK *st)
266. {
267. if (st == NULL)
^
268. return -1;
269. return st->num;
crypto/stack/stack.c:269:5:
267. if (st == NULL)
268. return -1;
269. > return st->num;
270. }
271.
crypto/stack/stack.c:270:1: return from a call to OPENSSL_sk_num
268. return -1;
269. return st->num;
270. > }
271.
272. void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
include/openssl/x509_vfy.h:54:1: return from a call to sk_X509_OBJECT_num
52.
53. DEFINE_STACK_OF(X509_LOOKUP)
54. > DEFINE_STACK_OF(X509_OBJECT)
55. DEFINE_STACK_OF(X509_VERIFY_PARAM)
56.
crypto/x509/x509_lu.c:588:19: Loop condition is true. Entering loop body
586. if ((x->type != X509_LU_X509) && (x->type != X509_LU_CRL))
587. return sk_X509_OBJECT_value(h, idx);
588. for (i = idx; i < sk_X509_OBJECT_num(h); i++) {
^
589. obj = sk_X509_OBJECT_value(h, i);
590. if (x509_object_cmp
crypto/x509/x509_lu.c:589:9:
587. return sk_X509_OBJECT_value(h, idx);
588. for (i = idx; i < sk_X509_OBJECT_num(h); i++) {
589. > obj = sk_X509_OBJECT_value(h, i);
590. if (x509_object_cmp
591. ((const X509_OBJECT **)&obj, (const X509_OBJECT **)&x))
include/openssl/x509_vfy.h:54:1: start of procedure sk_X509_OBJECT_value()
52.
53. DEFINE_STACK_OF(X509_LOOKUP)
54. > DEFINE_STACK_OF(X509_OBJECT)
55. DEFINE_STACK_OF(X509_VERIFY_PARAM)
56.
crypto/stack/stack.c:272:1: start of procedure OPENSSL_sk_value()
270. }
271.
272. > void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
273. {
274. if (st == NULL || i < 0 || i >= st->num)
crypto/stack/stack.c:274:9: Taking false branch
272. void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
273. {
274. if (st == NULL || i < 0 || i >= st->num)
^
275. return NULL;
276. return st->data[i];
crypto/stack/stack.c:274:23: Taking true branch
272. void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
273. {
274. if (st == NULL || i < 0 || i >= st->num)
^
275. return NULL;
276. return st->data[i];
crypto/stack/stack.c:275:9:
273. {
274. if (st == NULL || i < 0 || i >= st->num)
275. > return NULL;
276. return st->data[i];
277. }
crypto/stack/stack.c:277:1: return from a call to OPENSSL_sk_value
275. return NULL;
276. return st->data[i];
277. > }
278.
279. void *OPENSSL_sk_set(OPENSSL_STACK *st, int i, void *value)
include/openssl/x509_vfy.h:54:1: return from a call to sk_X509_OBJECT_value
52.
53. DEFINE_STACK_OF(X509_LOOKUP)
54. > DEFINE_STACK_OF(X509_OBJECT)
55. DEFINE_STACK_OF(X509_VERIFY_PARAM)
56.
crypto/x509/x509_lu.c:590:13:
588. for (i = idx; i < sk_X509_OBJECT_num(h); i++) {
589. obj = sk_X509_OBJECT_value(h, i);
590. > if (x509_object_cmp
591. ((const X509_OBJECT **)&obj, (const X509_OBJECT **)&x))
592. return NULL;
crypto/x509/x509_lu.c:109:1: start of procedure x509_object_cmp()
107. }
108.
109. > static int x509_object_cmp(const X509_OBJECT *const *a,
110. const X509_OBJECT *const *b)
111. {
crypto/x509/x509_lu.c:114:5:
112. int ret;
113.
114. > ret = ((*a)->type - (*b)->type);
115. if (ret)
116. return ret;
|
https://github.com/openssl/openssl/blob/b2de11c58b57e7f0d58c6f8a1d4177705650647e/crypto/x509/x509_lu.c/#L590
|
d2a_code_trace_data_42970
|
DECLAREContigPutFunc(putRGBcontig16bittile)
{
int samplesperpixel = img->samplesperpixel;
uint16 *wp = (uint16 *)pp;
(void) y;
fromskew *= samplesperpixel;
while (h-- > 0) {
for (x = w; x-- > 0;) {
*cp++ = PACK(img->Bitdepth16To8[wp[0]],
img->Bitdepth16To8[wp[1]],
img->Bitdepth16To8[wp[2]]);
wp += samplesperpixel;
}
cp += toskew;
wp += fromskew;
}
}
libtiff/tif_getimage.c:1306: error: Integer Overflow L2
([0, `w`] - 1):unsigned32.
libtiff/tif_getimage.c:1299:1: <LHS trace>
1297. * 16-bit packed samples => RGB
1298. */
1299. DECLAREContigPutFunc(putRGBcontig16bittile)
^
1300. {
1301. int samplesperpixel = img->samplesperpixel;
libtiff/tif_getimage.c:1299:1: Parameter `w`
1297. * 16-bit packed samples => RGB
1298. */
1299. DECLAREContigPutFunc(putRGBcontig16bittile)
^
1300. {
1301. int samplesperpixel = img->samplesperpixel;
libtiff/tif_getimage.c:1306:8: Assignment
1304. fromskew *= samplesperpixel;
1305. while (h-- > 0) {
1306. for (x = w; x-- > 0;) {
^
1307. *cp++ = PACK(img->Bitdepth16To8[wp[0]],
1308. img->Bitdepth16To8[wp[1]],
libtiff/tif_getimage.c:1306:15: Binary operation: ([0, w] - 1):unsigned32
1304. fromskew *= samplesperpixel;
1305. while (h-- > 0) {
1306. for (x = w; x-- > 0;) {
^
1307. *cp++ = PACK(img->Bitdepth16To8[wp[0]],
1308. img->Bitdepth16To8[wp[1]],
|
https://gitlab.com/libtiff/libtiff/blob/771a4ea0a98c7a218c9f3add9a05e08d29625758/libtiff/tif_getimage.c/#L1306
|
d2a_code_trace_data_42971
|
int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
{
int i, nw, lb, rb;
BN_ULONG *t, *f;
BN_ULONG l;
bn_check_top(r);
bn_check_top(a);
if (n < 0) {
BNerr(BN_F_BN_LSHIFT, BN_R_INVALID_SHIFT);
return 0;
}
r->neg = a->neg;
nw = n / BN_BITS2;
if (bn_wexpand(r, a->top + nw + 1) == NULL)
return (0);
lb = n % BN_BITS2;
rb = BN_BITS2 - lb;
f = a->d;
t = r->d;
t[a->top + nw] = 0;
if (lb == 0)
for (i = a->top - 1; i >= 0; i--)
t[nw + i] = f[i];
else
for (i = a->top - 1; i >= 0; i--) {
l = f[i];
t[nw + i + 1] |= (l >> rb) & BN_MASK2;
t[nw + i] = (l << lb) & BN_MASK2;
}
memset(t, 0, sizeof(*t) * nw);
r->top = a->top + nw + 1;
bn_correct_top(r);
bn_check_top(r);
return (1);
}
test/bntest.c:231: error: BUFFER_OVERRUN_L3
Offset: [1, +oo] Size: [0, 8388607] by call to `BN_lshift`.
Showing all 11 steps of the trace
test/bntest.c:69:1: Assignment
67. } MPITEST;
68.
69. > static const int NUM0 = 100; /* number of tests */
70. static const int NUM1 = 50; /* additional tests for some functions */
71. static FILE *fp;
test/bntest.c:231:13: Call
229. BN_bntest_rand(a, 400, 0, 0);
230. BN_copy(b, a);
231. BN_lshift(a, a, i);
^
232. BN_add_word(a, i);
233. } else
crypto/bn/bn_shift.c:81:1: <Offset trace>
79. }
80.
81. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
82. {
83. int i, nw, lb, rb;
crypto/bn/bn_shift.c:81:1: Parameter `n`
79. }
80.
81. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
82. {
83. int i, nw, lb, rb;
crypto/bn/bn_shift.c:96:5: Assignment
94.
95. r->neg = a->neg;
96. nw = n / BN_BITS2;
^
97. if (bn_wexpand(r, a->top + nw + 1) == NULL)
98. return (0);
crypto/bn/bn_shift.c:81:1: <Length trace>
79. }
80.
81. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
82. {
83. int i, nw, lb, rb;
crypto/bn/bn_shift.c:81:1: Parameter `*r->d`
79. }
80.
81. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
82. {
83. int i, nw, lb, rb;
crypto/bn/bn_shift.c:97:9: Call
95. r->neg = a->neg;
96. nw = n / BN_BITS2;
97. if (bn_wexpand(r, a->top + nw + 1) == NULL)
^
98. return (0);
99. lb = n % BN_BITS2;
crypto/bn/bn_lib.c:1016:1: Parameter `*a->d`
1014. }
1015.
1016. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
1017. {
1018. return (words <= a->dmax) ? a : bn_expand2(a, words);
crypto/bn/bn_shift.c:102:5: Assignment
100. rb = BN_BITS2 - lb;
101. f = a->d;
102. t = r->d;
^
103. t[a->top + nw] = 0;
104. if (lb == 0)
crypto/bn/bn_shift.c:110:13: Array access: Offset: [1, +oo] Size: [0, 8388607] by call to `BN_lshift`
108. for (i = a->top - 1; i >= 0; i--) {
109. l = f[i];
110. t[nw + i + 1] |= (l >> rb) & BN_MASK2;
^
111. t[nw + i] = (l << lb) & BN_MASK2;
112. }
|
https://github.com/openssl/openssl/blob/0282aeb690d63fab73a07191b63300a2fe30d212/crypto/bn/bn_shift.c/#L110
|
d2a_code_trace_data_42972
|
void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic){
int i;
InternalBuffer *buf, *last;
assert(pic->type==FF_BUFFER_TYPE_INTERNAL);
assert(s->internal_buffer_count);
if(s->internal_buffer){
buf = NULL;
for(i=0; i<s->internal_buffer_count; i++){
buf= &((InternalBuffer*)s->internal_buffer)[i];
if(buf->data[0] == pic->data[0])
break;
}
assert(i < s->internal_buffer_count);
s->internal_buffer_count--;
last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count];
FFSWAP(InternalBuffer, *buf, *last);
}
for(i=0; i<4; i++){
pic->data[i]=NULL;
}
if(s->debug&FF_DEBUG_BUFFERS)
av_log(s, AV_LOG_DEBUG, "default_release_buffer called on pic %p, %d buffers used\n", pic, s->internal_buffer_count);
}
libavcodec/utils.c:374: error: Null Dereference
pointer `buf` last assigned on line 364 could be null and is dereferenced at line 374, column 5.
libavcodec/utils.c:356:1: start of procedure avcodec_default_release_buffer()
354. }
355.
356. void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic){
^
357. int i;
358. InternalBuffer *buf, *last;
libavcodec/utils.c:360:5:
358. InternalBuffer *buf, *last;
359.
360. assert(pic->type==FF_BUFFER_TYPE_INTERNAL);
^
361. assert(s->internal_buffer_count);
362.
libavcodec/utils.c:361:5:
359.
360. assert(pic->type==FF_BUFFER_TYPE_INTERNAL);
361. assert(s->internal_buffer_count);
^
362.
363. if(s->internal_buffer){
libavcodec/utils.c:363:8: Taking true branch
361. assert(s->internal_buffer_count);
362.
363. if(s->internal_buffer){
^
364. buf = NULL; /* avoids warning */
365. for(i=0; i<s->internal_buffer_count; i++){ //just 3-5 checks so is not worth to optimize
libavcodec/utils.c:364:5:
362.
363. if(s->internal_buffer){
364. buf = NULL; /* avoids warning */
^
365. for(i=0; i<s->internal_buffer_count; i++){ //just 3-5 checks so is not worth to optimize
366. buf= &((InternalBuffer*)s->internal_buffer)[i];
libavcodec/utils.c:365:9:
363. if(s->internal_buffer){
364. buf = NULL; /* avoids warning */
365. for(i=0; i<s->internal_buffer_count; i++){ //just 3-5 checks so is not worth to optimize
^
366. buf= &((InternalBuffer*)s->internal_buffer)[i];
367. if(buf->data[0] == pic->data[0])
libavcodec/utils.c:365:14: Loop condition is false. Leaving loop
363. if(s->internal_buffer){
364. buf = NULL; /* avoids warning */
365. for(i=0; i<s->internal_buffer_count; i++){ //just 3-5 checks so is not worth to optimize
^
366. buf= &((InternalBuffer*)s->internal_buffer)[i];
367. if(buf->data[0] == pic->data[0])
libavcodec/utils.c:370:5:
368. break;
369. }
370. assert(i < s->internal_buffer_count);
^
371. s->internal_buffer_count--;
372. last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count];
libavcodec/utils.c:371:5:
369. }
370. assert(i < s->internal_buffer_count);
371. s->internal_buffer_count--;
^
372. last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count];
373.
libavcodec/utils.c:372:5:
370. assert(i < s->internal_buffer_count);
371. s->internal_buffer_count--;
372. last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count];
^
373.
374. FFSWAP(InternalBuffer, *buf, *last);
libavcodec/utils.c:374:5:
372. last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count];
373.
374. FFSWAP(InternalBuffer, *buf, *last);
^
375. }
376.
|
https://github.com/libav/libav/blob/6a9c85944427e3c4355bce67d7f677ec69527bff/libavcodec/utils.c/#L374
|
d2a_code_trace_data_42973
|
static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
{
#ifdef BITSTREAM_READER_LE
uint64_t ret = bc->bits & ((UINT64_C(1) << n) - 1);
bc->bits >>= n;
#else
uint64_t ret = bc->bits >> (64 - n);
bc->bits <<= n;
#endif
bc->bits_left -= n;
return ret;
}
libavcodec/mpc8.c:330: error: Integer Overflow L2
([1, +oo] - 6):unsigned32 by call to `bitstream_read`.
libavcodec/mpc8.c:330:26: Call
328. t = bitstream_read_vlc(bc, dscf_vlc[1].table, MPC8_DSCF1_BITS, 2);
329. if(t == 64)
330. t += bitstream_read(bc, 6);
^
331. bands[i].scf_idx[ch][0] = ((bands[i].scf_idx[ch][2] + t - 25) & 0x7F) - 6;
332. }
libavcodec/bitstream.h:183:1: Parameter `n`
181.
182. /* Return n bits from the buffer. n has to be in the 0-32 range. */
183. static inline uint32_t bitstream_read(BitstreamContext *bc, unsigned n)
^
184. {
185. if (!n)
libavcodec/bitstream.h:194:12: Call
192. }
193.
194. return get_val(bc, n);
^
195. }
196.
libavcodec/bitstream.h:130:1: <LHS trace>
128. }
129.
130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
^
131. {
132. #ifdef BITSTREAM_READER_LE
libavcodec/bitstream.h:130:1: Parameter `bc->bits_left`
128. }
129.
130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
^
131. {
132. #ifdef BITSTREAM_READER_LE
libavcodec/bitstream.h:130:1: <RHS trace>
128. }
129.
130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
^
131. {
132. #ifdef BITSTREAM_READER_LE
libavcodec/bitstream.h:130:1: Parameter `n`
128. }
129.
130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
^
131. {
132. #ifdef BITSTREAM_READER_LE
libavcodec/bitstream.h:139:5: Binary operation: ([1, +oo] - 6):unsigned32 by call to `bitstream_read`
137. bc->bits <<= n;
138. #endif
139. bc->bits_left -= n;
^
140.
141. return ret;
|
https://github.com/libav/libav/blob/562ef82d6a7f96f6b9da1219a5aaf7d9d7056f1b/libavcodec/bitstream.h/#L139
|
d2a_code_trace_data_42974
|
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:792: error: MEMORY_LEAK
memory dynamically allocated to `return` by call to `BN_new()` at line 784, column 9 is not reachable after line 792, column 9.
Showing all 172 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 true branch
317. BN_MONT_CTX *ret;
318.
319. if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
^
320. return (NULL);
321.
crypto/bn/bn_mont.c:320:9:
318.
319. if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
320. > return (NULL);
321.
322. BN_MONT_CTX_init(ret);
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 true branch
789.
790. mont = BN_MONT_CTX_new();
791. if (mont == NULL)
^
792. return 0;
793.
test/bntest.c:792:9:
790. mont = BN_MONT_CTX_new();
791. if (mont == NULL)
792. > return 0;
793.
794. BN_zero(n);
|
https://github.com/openssl/openssl/blob/d9e309a675900030d7308e36f614962a344816f9/test/bntest.c/#L792
|
d2a_code_trace_data_42975
|
static int ssl3_send_client_key_exchange(SSL *s)
{
unsigned char *p,*d;
int n;
unsigned long l;
#ifndef NO_RSA
unsigned char *q;
EVP_PKEY *pkey=NULL;
#endif
#ifndef NO_KRB5
KSSL_ERR kssl_err;
#endif
if (s->state == SSL3_ST_CW_KEY_EXCH_A)
{
d=(unsigned char *)s->init_buf->data;
p= &(d[4]);
l=s->s3->tmp.new_cipher->algorithms;
if (0) {}
#ifndef NO_RSA
else if (l & SSL_kRSA)
{
RSA *rsa;
unsigned char tmp_buf[SSL_MAX_MASTER_KEY_LENGTH];
if (s->session->sess_cert->peer_rsa_tmp != NULL)
rsa=s->session->sess_cert->peer_rsa_tmp;
else
{
pkey=X509_get_pubkey(s->session->sess_cert->peer_pkeys[SSL_PKEY_RSA_ENC].x509);
if ((pkey == NULL) ||
(pkey->type != EVP_PKEY_RSA) ||
(pkey->pkey.rsa == NULL))
{
SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE,SSL_R_INTERNAL_ERROR);
goto err;
}
rsa=pkey->pkey.rsa;
EVP_PKEY_free(pkey);
}
tmp_buf[0]=s->client_version>>8;
tmp_buf[1]=s->client_version&0xff;
if (RAND_bytes(&(tmp_buf[2]),SSL_MAX_MASTER_KEY_LENGTH-2) <= 0)
goto err;
s->session->master_key_length=SSL_MAX_MASTER_KEY_LENGTH;
q=p;
if (s->version > SSL3_VERSION)
p+=2;
n=RSA_public_encrypt(SSL_MAX_MASTER_KEY_LENGTH,
tmp_buf,p,rsa,RSA_PKCS1_PADDING);
#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 (n <= 0)
{
SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE,SSL_R_BAD_RSA_ENCRYPT);
goto err;
}
if (s->version > SSL3_VERSION)
{
s2n(n,q);
n+=2;
}
s->session->master_key_length=
s->method->ssl3_enc->generate_master_secret(s,
s->session->master_key,
tmp_buf,SSL_MAX_MASTER_KEY_LENGTH);
memset(tmp_buf,0,SSL_MAX_MASTER_KEY_LENGTH);
}
#endif
#ifndef NO_KRB5
else if (l & SSL_kKRB5)
{
krb5_error_code krb5rc;
KSSL_CTX *kssl_ctx = s->kssl_ctx;
krb5_data krb5_ap_req;
#ifdef KSSL_DEBUG
printf("ssl3_send_client_key_exchange(%lx & %lx)\n",
l, SSL_kKRB5);
#endif
krb5rc = kssl_cget_tkt(kssl_ctx, &krb5_ap_req,
&kssl_err);
#ifdef KSSL_DEBUG
{
printf("kssl_cget_tkt rtn %d\n", krb5rc);
kssl_ctx_show(kssl_ctx);
if (krb5rc && kssl_err.text)
printf("kssl_cget_tkt kssl_err=%s\n", kssl_err.text);
}
#endif
if (krb5rc)
{
ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_HANDSHAKE_FAILURE);
SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE, kssl_err.reason);
goto err;
}
n = krb5_ap_req.length;
memcpy(p, krb5_ap_req.data, krb5_ap_req.length);
if (krb5_ap_req.data)
kssl_krb5_free_data_contents(NULL,&krb5_ap_req);
s->session->master_key_length=
s->method->ssl3_enc->generate_master_secret(s,
s->session->master_key, kssl_ctx->key,kssl_ctx->length);
}
#endif
#ifndef NO_DH
else if (l & (SSL_kEDH|SSL_kDHr|SSL_kDHd))
{
DH *dh_srvr,*dh_clnt;
if (s->session->sess_cert->peer_dh_tmp != NULL)
dh_srvr=s->session->sess_cert->peer_dh_tmp;
else
{
ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_HANDSHAKE_FAILURE);
SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE,SSL_R_UNABLE_TO_FIND_DH_PARAMETERS);
goto err;
}
if ((dh_clnt=DHparams_dup(dh_srvr)) == NULL)
{
SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE,ERR_R_DH_LIB);
goto err;
}
if (!DH_generate_key(dh_clnt))
{
SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE,ERR_R_DH_LIB);
goto err;
}
n=DH_compute_key(p,dh_srvr->pub_key,dh_clnt);
if (n <= 0)
{
SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE,ERR_R_DH_LIB);
goto err;
}
s->session->master_key_length=
s->method->ssl3_enc->generate_master_secret(s,
s->session->master_key,p,n);
memset(p,0,n);
n=BN_num_bytes(dh_clnt->pub_key);
s2n(n,p);
BN_bn2bin(dh_clnt->pub_key,p);
n+=2;
DH_free(dh_clnt);
}
#endif
else
{
ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_HANDSHAKE_FAILURE);
SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE,SSL_R_INTERNAL_ERROR);
goto err;
}
*(d++)=SSL3_MT_CLIENT_KEY_EXCHANGE;
l2n3(n,d);
s->state=SSL3_ST_CW_KEY_EXCH_B;
s->init_num=n+4;
s->init_off=0;
}
return(ssl3_do_write(s,SSL3_RT_HANDSHAKE));
err:
return(-1);
}
ssl/s3_clnt.c:1561: error: UNINITIALIZED_VALUE
The value read from n was never initialized.
Showing all 1 steps of the trace
ssl/s3_clnt.c:1561:3:
1559. s->state=SSL3_ST_CW_KEY_EXCH_B;
1560. /* number of bytes to write */
1561. > s->init_num=n+4;
1562. s->init_off=0;
1563. }
|
https://github.com/openssl/openssl/blob/f9b3bff6f7e38960bb87a5623fbcbc45ee952c49/ssl/s3_clnt.c/#L1561
|
d2a_code_trace_data_42976
|
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:391: error: BUFFER_OVERRUN_L3
Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_add`.
Showing all 32 steps of the trace
crypto/bn/bn_prime.c:365:10: Call
363. goto err;
364.
365. if (!BN_rand(rnd, bits, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ODD))
^
366. goto err;
367.
crypto/bn/bn_rand.c:99:12: Call
97. int BN_rand(BIGNUM *rnd, int bits, int top, int bottom)
98. {
99. return bnrand(NORMAL, rnd, bits, top, bottom);
^
100. }
101.
crypto/bn/bn_rand.c:21:1: Parameter `rnd->top`
19. } BNRAND_FLAG;
20.
21. > static int bnrand(BNRAND_FLAG flag, BIGNUM *rnd, int bits, int top, int bottom)
22. {
23. unsigned char *buf = NULL;
crypto/bn/bn_prime.c:370:10: Call
368. /* we need ((rnd-rem) % add) == 0 */
369.
370. if (!BN_mod(t1, rnd, add, ctx))
^
371. goto err;
372. 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:372:10: Call
370. if (!BN_mod(t1, rnd, add, ctx))
371. goto err;
372. if (!BN_sub(rnd, rnd, t1))
^
373. goto err;
374. 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:375:14: Call
373. goto err;
374. if (rem == NULL) {
375. if (!BN_add_word(rnd, 1))
^
376. goto err;
377. } else {
crypto/bn/bn_word.c:98:1: Parameter `a->top`
96. }
97.
98. > int BN_add_word(BIGNUM *a, BN_ULONG w)
99. {
100. BN_ULONG l;
crypto/bn/bn_prime.c:387:24: Call
385. for (i = 1; i < NUMPRIMES; i++) {
386. /* check that rnd is a prime */
387. BN_ULONG mod = BN_mod_word(rnd, (BN_ULONG)primes[i]);
^
388. if (mod == (BN_ULONG)-1)
389. goto err;
crypto/bn/bn_word.c:13:1: Parameter `a->top`
11. #include "bn_lcl.h"
12.
13. > BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w)
14. {
15. #ifndef BN_LLONG
crypto/bn/bn_prime.c:391:18: Call
389. goto err;
390. if (mod <= 1) {
391. if (!BN_add(rnd, rnd, add))
^
392. goto err;
393. goto loop;
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:23:15: Call
21. if (a->neg == b->neg) {
22. r_neg = a->neg;
23. ret = BN_uadd(r, a, b);
^
24. } else {
25. cmp_res = BN_ucmp(a, b);
crypto/bn/bn_add.c:76:1: Parameter `r->top`
74.
75. /* unsigned add of b to a, r can be equal to a or b. */
76. > int BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
77. {
78. int max, min, dif;
crypto/bn/bn_add.c:96:9: Call
94. dif = max - min;
95.
96. if (bn_wexpand(r, max + 1) == NULL)
^
97. return 0;
98.
crypto/bn/bn_lib.c:960:1: Parameter `a->top`
958. }
959.
960. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
961. {
962. return (words <= a->dmax) ? a : bn_expand2(a, words);
crypto/bn/bn_lib.c:962:37: Call
960. BIGNUM *bn_wexpand(BIGNUM *a, int words)
961. {
962. return (words <= a->dmax) ? a : bn_expand2(a, words);
^
963. }
964.
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/18e1e302452e6dea4500b6f981cee7e151294dea/crypto/bn/bn_lib.c/#L232
|
d2a_code_trace_data_42977
|
void ff_estimate_p_frame_motion(MpegEncContext * s,
int mb_x, int mb_y)
{
MotionEstContext * const c= &s->me;
uint8_t *pix, *ppix;
int sum, mx = 0, my = 0, dmin = 0;
int varc;
int vard;
int P[10][2];
const int shift= 1+s->quarter_sample;
int mb_type=0;
Picture * const pic= &s->current_picture;
init_ref(c, s->new_picture.f->data, s->last_picture.f->data, NULL, 16*mb_x, 16*mb_y, 0);
assert(s->quarter_sample==0 || s->quarter_sample==1);
assert(s->linesize == c->stride);
assert(s->uvlinesize == c->uvstride);
c->penalty_factor = get_penalty_factor(s->lambda, s->lambda2, c->avctx->me_cmp);
c->sub_penalty_factor= get_penalty_factor(s->lambda, s->lambda2, c->avctx->me_sub_cmp);
c->mb_penalty_factor = get_penalty_factor(s->lambda, s->lambda2, c->avctx->mb_cmp);
c->current_mv_penalty= c->mv_penalty[s->f_code] + MAX_MV;
get_limits(s, 16*mb_x, 16*mb_y);
c->skip=0;
pix = c->src[0][0];
sum = s->mpvencdsp.pix_sum(pix, s->linesize);
varc = s->mpvencdsp.pix_norm1(pix, s->linesize) -
(((unsigned) sum * sum) >> 8) + 500;
pic->mb_mean[s->mb_stride * mb_y + mb_x] = (sum+128)>>8;
pic->mb_var [s->mb_stride * mb_y + mb_x] = (varc+128)>>8;
c->mb_var_sum_temp += (varc+128)>>8;
if (s->motion_est != FF_ME_ZERO) {
const int mot_stride = s->b8_stride;
const int mot_xy = s->block_index[0];
P_LEFT[0] = s->current_picture.motion_val[0][mot_xy - 1][0];
P_LEFT[1] = s->current_picture.motion_val[0][mot_xy - 1][1];
if (P_LEFT[0] > (c->xmax << shift))
P_LEFT[0] = c->xmax << shift;
if (!s->first_slice_line) {
P_TOP[0] = s->current_picture.motion_val[0][mot_xy - mot_stride ][0];
P_TOP[1] = s->current_picture.motion_val[0][mot_xy - mot_stride ][1];
P_TOPRIGHT[0] = s->current_picture.motion_val[0][mot_xy - mot_stride + 2][0];
P_TOPRIGHT[1] = s->current_picture.motion_val[0][mot_xy - mot_stride + 2][1];
if (P_TOP[1] > (c->ymax << shift))
P_TOP[1] = c->ymax << shift;
if (P_TOPRIGHT[0] < (c->xmin << shift))
P_TOPRIGHT[0] = c->xmin << shift;
if (P_TOPRIGHT[1] > (c->ymax << shift))
P_TOPRIGHT[1] = c->ymax << shift;
P_MEDIAN[0] = mid_pred(P_LEFT[0], P_TOP[0], P_TOPRIGHT[0]);
P_MEDIAN[1] = mid_pred(P_LEFT[1], P_TOP[1], P_TOPRIGHT[1]);
if (s->out_format == FMT_H263) {
c->pred_x = P_MEDIAN[0];
c->pred_y = P_MEDIAN[1];
} else {
c->pred_x = P_LEFT[0];
c->pred_y = P_LEFT[1];
}
} else {
c->pred_x = P_LEFT[0];
c->pred_y = P_LEFT[1];
}
dmin = ff_epzs_motion_search(s, &mx, &my, P, 0, 0, s->p_mv_table, (1<<16)>>shift, 0, 16);
}
ppix = c->ref[0][0] + (my * s->linesize) + mx;
vard = s->mecc.sse[0](NULL, pix, ppix, s->linesize, 16);
pic->mc_mb_var[s->mb_stride * mb_y + mb_x] = (vard+128)>>8;
c->mc_mb_var_sum_temp += (vard+128)>>8;
if (c->avctx->mb_decision > FF_MB_DECISION_SIMPLE) {
int p_score= FFMIN(vard, varc-500+(s->lambda2>>FF_LAMBDA_SHIFT)*100);
int i_score= varc-500+(s->lambda2>>FF_LAMBDA_SHIFT)*20;
c->scene_change_score+= ff_sqrt(p_score) - ff_sqrt(i_score);
if (vard*2 + 200*256 > varc)
mb_type|= CANDIDATE_MB_TYPE_INTRA;
if (varc*2 + 200*256 > vard || s->qscale > 24){
mb_type|= CANDIDATE_MB_TYPE_INTER;
c->sub_motion_search(s, &mx, &my, dmin, 0, 0, 0, 16);
if (s->mpv_flags & FF_MPV_FLAG_MV0)
if(mx || my)
mb_type |= CANDIDATE_MB_TYPE_SKIPPED;
}else{
mx <<=shift;
my <<=shift;
}
if ((s->avctx->flags & AV_CODEC_FLAG_4MV)
&& !c->skip && varc>50<<8 && vard>10<<8){
if(h263_mv4_search(s, mx, my, shift) < INT_MAX)
mb_type|=CANDIDATE_MB_TYPE_INTER4V;
set_p_mv_tables(s, mx, my, 0);
}else
set_p_mv_tables(s, mx, my, 1);
if ((s->avctx->flags & AV_CODEC_FLAG_INTERLACED_ME)
&& !c->skip){
if(interlaced_search(s, 0, s->p_field_mv_table, s->p_field_select_table, mx, my, 0) < INT_MAX)
mb_type |= CANDIDATE_MB_TYPE_INTER_I;
}
}else{
int intra_score, i;
mb_type= CANDIDATE_MB_TYPE_INTER;
dmin= c->sub_motion_search(s, &mx, &my, dmin, 0, 0, 0, 16);
if(c->avctx->me_sub_cmp != c->avctx->mb_cmp && !c->skip)
dmin= get_mb_score(s, mx, my, 0, 0, 0, 16, 1);
if ((s->avctx->flags & AV_CODEC_FLAG_4MV)
&& !c->skip && varc>50<<8 && vard>10<<8){
int dmin4= h263_mv4_search(s, mx, my, shift);
if(dmin4 < dmin){
mb_type= CANDIDATE_MB_TYPE_INTER4V;
dmin=dmin4;
}
}
if ((s->avctx->flags & AV_CODEC_FLAG_INTERLACED_ME)
&& !c->skip){
int dmin_i= interlaced_search(s, 0, s->p_field_mv_table, s->p_field_select_table, mx, my, 0);
if(dmin_i < dmin){
mb_type = CANDIDATE_MB_TYPE_INTER_I;
dmin= dmin_i;
}
}
set_p_mv_tables(s, mx, my, mb_type!=CANDIDATE_MB_TYPE_INTER4V);
if((c->avctx->mb_cmp&0xFF)==FF_CMP_SSE){
intra_score= varc - 500;
}else{
unsigned mean = (sum+128)>>8;
mean*= 0x01010101;
for(i=0; i<16; i++){
*(uint32_t*)(&c->scratchpad[i*s->linesize+ 0]) = mean;
*(uint32_t*)(&c->scratchpad[i*s->linesize+ 4]) = mean;
*(uint32_t*)(&c->scratchpad[i*s->linesize+ 8]) = mean;
*(uint32_t*)(&c->scratchpad[i*s->linesize+12]) = mean;
}
intra_score= s->mecc.mb_cmp[0](s, c->scratchpad, pix, s->linesize, 16);
}
intra_score += c->mb_penalty_factor*16;
if(intra_score < dmin){
mb_type= CANDIDATE_MB_TYPE_INTRA;
s->current_picture.mb_type[mb_y*s->mb_stride + mb_x] = CANDIDATE_MB_TYPE_INTRA;
}else
s->current_picture.mb_type[mb_y*s->mb_stride + mb_x] = 0;
{
int p_score= FFMIN(vard, varc-500+(s->lambda2>>FF_LAMBDA_SHIFT)*100);
int i_score= varc-500+(s->lambda2>>FF_LAMBDA_SHIFT)*20;
c->scene_change_score+= ff_sqrt(p_score) - ff_sqrt(i_score);
}
}
s->mb_type[mb_y*s->mb_stride + mb_x]= mb_type;
}
libavcodec/motion_est.c:887: error: Null Dereference
pointer `null` is dereferenced by call to `init_ref()` at line 887, column 5.
libavcodec/motion_est.c:874:1: start of procedure ff_estimate_p_frame_motion()
872. }
873.
874. void ff_estimate_p_frame_motion(MpegEncContext * s,
^
875. int mb_x, int mb_y)
876. {
libavcodec/motion_est.c:877:5:
875. int mb_x, int mb_y)
876. {
877. MotionEstContext * const c= &s->me;
^
878. uint8_t *pix, *ppix;
879. int sum, mx = 0, my = 0, dmin = 0;
libavcodec/motion_est.c:879:5:
877. MotionEstContext * const c= &s->me;
878. uint8_t *pix, *ppix;
879. int sum, mx = 0, my = 0, dmin = 0;
^
880. int varc; ///< the variance of the block (sum of squared (p[y][x]-average))
881. int vard; ///< sum of squared differences with the estimated motion vector
libavcodec/motion_est.c:883:5:
881. int vard; ///< sum of squared differences with the estimated motion vector
882. int P[10][2];
883. const int shift= 1+s->quarter_sample;
^
884. int mb_type=0;
885. Picture * const pic= &s->current_picture;
libavcodec/motion_est.c:884:5:
882. int P[10][2];
883. const int shift= 1+s->quarter_sample;
884. int mb_type=0;
^
885. Picture * const pic= &s->current_picture;
886.
libavcodec/motion_est.c:885:5:
883. const int shift= 1+s->quarter_sample;
884. int mb_type=0;
885. Picture * const pic= &s->current_picture;
^
886.
887. init_ref(c, s->new_picture.f->data, s->last_picture.f->data, NULL, 16*mb_x, 16*mb_y, 0);
libavcodec/motion_est.c:887:5:
885. Picture * const pic= &s->current_picture;
886.
887. init_ref(c, s->new_picture.f->data, s->last_picture.f->data, NULL, 16*mb_x, 16*mb_y, 0);
^
888.
889. assert(s->quarter_sample==0 || s->quarter_sample==1);
libavcodec/motion_est.c:86:1: start of procedure init_ref()
84. #define FLAG_DIRECT 4
85.
86. static inline void init_ref(MotionEstContext *c, uint8_t *src[3], uint8_t *ref[3], uint8_t *ref2[3], int x, int y, int ref_index){
^
87. const int offset[3]= {
88. y*c-> stride + x,
libavcodec/motion_est.c:87:5:
85.
86. static inline void init_ref(MotionEstContext *c, uint8_t *src[3], uint8_t *ref[3], uint8_t *ref2[3], int x, int y, int ref_index){
87. const int offset[3]= {
^
88. y*c-> stride + x,
89. ((y*c->uvstride + x)>>1),
libavcodec/motion_est.c:93:9:
91. };
92. int i;
93. for(i=0; i<3; i++){
^
94. c->src[0][i]= src [i] + offset[i];
95. c->ref[0][i]= ref [i] + offset[i];
libavcodec/motion_est.c:93:14: Loop condition is true. Entering loop body
91. };
92. int i;
93. for(i=0; i<3; i++){
^
94. c->src[0][i]= src [i] + offset[i];
95. c->ref[0][i]= ref [i] + offset[i];
libavcodec/motion_est.c:94:9:
92. int i;
93. for(i=0; i<3; i++){
94. c->src[0][i]= src [i] + offset[i];
^
95. c->ref[0][i]= ref [i] + offset[i];
96. }
libavcodec/motion_est.c:95:9:
93. for(i=0; i<3; i++){
94. c->src[0][i]= src [i] + offset[i];
95. c->ref[0][i]= ref [i] + offset[i];
^
96. }
97. if(ref_index){
libavcodec/motion_est.c:93:19:
91. };
92. int i;
93. for(i=0; i<3; i++){
^
94. c->src[0][i]= src [i] + offset[i];
95. c->ref[0][i]= ref [i] + offset[i];
libavcodec/motion_est.c:93:14: Loop condition is true. Entering loop body
91. };
92. int i;
93. for(i=0; i<3; i++){
^
94. c->src[0][i]= src [i] + offset[i];
95. c->ref[0][i]= ref [i] + offset[i];
libavcodec/motion_est.c:94:9:
92. int i;
93. for(i=0; i<3; i++){
94. c->src[0][i]= src [i] + offset[i];
^
95. c->ref[0][i]= ref [i] + offset[i];
96. }
libavcodec/motion_est.c:95:9:
93. for(i=0; i<3; i++){
94. c->src[0][i]= src [i] + offset[i];
95. c->ref[0][i]= ref [i] + offset[i];
^
96. }
97. if(ref_index){
libavcodec/motion_est.c:93:19:
91. };
92. int i;
93. for(i=0; i<3; i++){
^
94. c->src[0][i]= src [i] + offset[i];
95. c->ref[0][i]= ref [i] + offset[i];
libavcodec/motion_est.c:93:14: Loop condition is false. Leaving loop
91. };
92. int i;
93. for(i=0; i<3; i++){
^
94. c->src[0][i]= src [i] + offset[i];
95. c->ref[0][i]= ref [i] + offset[i];
libavcodec/motion_est.c:97:8: Taking true branch
95. c->ref[0][i]= ref [i] + offset[i];
96. }
97. if(ref_index){
^
98. for(i=0; i<3; i++){
99. c->ref[ref_index][i]= ref2[i] + offset[i];
libavcodec/motion_est.c:98:13:
96. }
97. if(ref_index){
98. for(i=0; i<3; i++){
^
99. c->ref[ref_index][i]= ref2[i] + offset[i];
100. }
libavcodec/motion_est.c:98:18: Loop condition is true. Entering loop body
96. }
97. if(ref_index){
98. for(i=0; i<3; i++){
^
99. c->ref[ref_index][i]= ref2[i] + offset[i];
100. }
libavcodec/motion_est.c:99:13:
97. if(ref_index){
98. for(i=0; i<3; i++){
99. c->ref[ref_index][i]= ref2[i] + offset[i];
^
100. }
101. }
|
https://github.com/libav/libav/blob/7a6cf2771414c7ab8bca0811d589f6091a6e2b71/libavcodec/motion_est.c/#L887
|
d2a_code_trace_data_42978
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
crypto/dsa/dsa_key.c:58: error: BUFFER_OVERRUN_L3
Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_exp`.
Showing all 31 steps of the trace
crypto/dsa/dsa_key.c:58:14: Call
56. BN_with_flags(prk, priv_key, BN_FLG_CONSTTIME);
57.
58. if (!BN_mod_exp(pub_key, dsa->g, prk, dsa->p, ctx)) {
^
59. BN_free(prk);
60. goto err;
crypto/bn/bn_exp.c:89:1: Parameter `ctx->stack.depth`
87. }
88.
89. > int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
90. BN_CTX *ctx)
91. {
crypto/bn/bn_exp.c:149:15: Call
147. #ifdef RECP_MUL_MOD
148. {
149. ret = BN_mod_exp_recp(r, a, p, m, ctx);
^
150. }
151. #else
crypto/bn/bn_exp.c:161:1: Parameter `ctx->stack.depth`
159. }
160.
161. > int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
162. const BIGNUM *m, BN_CTX *ctx)
163. {
crypto/bn/bn_exp.c:191:5: Call
189. }
190.
191. BN_CTX_start(ctx);
^
192. aa = BN_CTX_get(ctx);
193. val[0] = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth`
169. }
170.
171. > void BN_CTX_start(BN_CTX *ctx)
172. {
173. CTXDBG("ENTER BN_CTX_start()", ctx);
crypto/bn/bn_exp.c:192:10: Call
190.
191. BN_CTX_start(ctx);
192. aa = BN_CTX_get(ctx);
^
193. val[0] = BN_CTX_get(ctx);
194. if (val[0] == NULL)
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/bn/bn_exp.c:193:14: Call
191. BN_CTX_start(ctx);
192. aa = BN_CTX_get(ctx);
193. val[0] = BN_CTX_get(ctx);
^
194. if (val[0] == NULL)
195. goto err;
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/bn/bn_exp.c:210:10: Call
208. }
209.
210. if (!BN_nnmod(val[0], a, m, ctx))
^
211. goto err; /* 1 */
212. if (BN_is_zero(val[0])) {
crypto/bn/bn_mod.c:13:1: Parameter `ctx->stack.depth`
11. #include "bn_lcl.h"
12.
13. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx)
14. {
15. /*
crypto/bn/bn_mod.c:20:11: Call
18. */
19.
20. if (!(BN_mod(r, m, d, ctx)))
^
21. return 0;
22. if (!r->neg)
crypto/bn/bn_div.c:209:1: Parameter `ctx->stack.depth`
207. * If 'dv' or 'rm' is NULL, the respective value is not returned.
208. */
209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
210. BN_CTX *ctx)
211. {
crypto/bn/bn_exp.c:220:14: Call
218. window = BN_window_bits_for_exponent_size(bits);
219. if (window > 1) {
220. if (!BN_mod_mul_reciprocal(aa, val[0], val[0], &recp, ctx))
^
221. goto err; /* 2 */
222. j = 1 << (window - 1);
crypto/bn/bn_recp.c:55:1: Parameter `ctx->stack.depth`
53. }
54.
55. > int BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y,
56. BN_RECP_CTX *recp, BN_CTX *ctx)
57. {
crypto/bn/bn_recp.c:62:5: Call
60. const BIGNUM *ca;
61.
62. BN_CTX_start(ctx);
^
63. if ((a = BN_CTX_get(ctx)) == NULL)
64. goto err;
crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth`
169. }
170.
171. > void BN_CTX_start(BN_CTX *ctx)
172. {
173. CTXDBG("ENTER BN_CTX_start()", ctx);
crypto/bn/bn_recp.c:63:14: Call
61.
62. BN_CTX_start(ctx);
63. if ((a = BN_CTX_get(ctx)) == NULL)
^
64. goto err;
65. if (y != NULL) {
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/bn/bn_recp.c:77:11: Call
75. ca = x; /* Just do the mod */
76.
77. ret = BN_div_recp(NULL, r, ca, recp, ctx);
^
78. err:
79. BN_CTX_end(ctx);
crypto/bn/bn_recp.c:90:5: Call
88. BIGNUM *a, *b, *d, *r;
89.
90. BN_CTX_start(ctx);
^
91. d = (dv != NULL) ? dv : BN_CTX_get(ctx);
92. r = (rem != NULL) ? rem : BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:171:1: Parameter `*ctx->stack.indexes`
169. }
170.
171. > void BN_CTX_start(BN_CTX *ctx)
172. {
173. CTXDBG("ENTER BN_CTX_start()", ctx);
crypto/bn/bn_recp.c:101:13: Call
99. BN_zero(d);
100. if (!BN_copy(r, m)) {
101. BN_CTX_end(ctx);
^
102. return 0;
103. }
crypto/bn/bn_ctx.c:185:1: Parameter `*ctx->stack.indexes`
183. }
184.
185. > void BN_CTX_end(BN_CTX *ctx)
186. {
187. CTXDBG("ENTER BN_CTX_end()", ctx);
crypto/bn/bn_ctx.c:191:27: Call
189. ctx->err_stack--;
190. else {
191. unsigned int fp = BN_STACK_pop(&ctx->stack);
^
192. /* Does this stack frame have anything to release? */
193. if (fp < ctx->used)
crypto/bn/bn_ctx.c:266:1: <Offset trace>
264. }
265.
266. > static unsigned int BN_STACK_pop(BN_STACK *st)
267. {
268. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:266:1: Parameter `st->depth`
264. }
265.
266. > static unsigned int BN_STACK_pop(BN_STACK *st)
267. {
268. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:266:1: <Length trace>
264. }
265.
266. > static unsigned int BN_STACK_pop(BN_STACK *st)
267. {
268. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:266:1: Parameter `*st->indexes`
264. }
265.
266. > static unsigned int BN_STACK_pop(BN_STACK *st)
267. {
268. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:268:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_exp`
266. static unsigned int BN_STACK_pop(BN_STACK *st)
267. {
268. return st->indexes[--(st->depth)];
^
269. }
270.
|
https://github.com/openssl/openssl/blob/18e1e302452e6dea4500b6f981cee7e151294dea/crypto/bn/bn_ctx.c/#L268
|
d2a_code_trace_data_42979
|
static int mtu_test(SSL_CTX *ctx, const char *cs, int no_etm)
{
SSL *srvr_ssl = NULL, *clnt_ssl = NULL;
BIO *sc_bio = NULL;
int i;
size_t s;
size_t mtus[30];
unsigned char buf[600];
int rv = 0;
memset(buf, 0x5a, sizeof(buf));
if (create_ssl_objects(ctx, ctx, &srvr_ssl, &clnt_ssl, NULL, NULL) != 1)
goto out;
if (no_etm)
SSL_set_options(srvr_ssl, SSL_OP_NO_ENCRYPT_THEN_MAC);
if (SSL_set_cipher_list(srvr_ssl, cs) != 1 ||
SSL_set_cipher_list(clnt_ssl, cs) != 1) {
ERR_print_errors_fp(stdout);
goto out;
}
sc_bio = SSL_get_rbio(srvr_ssl);
if (create_ssl_connection(clnt_ssl, srvr_ssl) != 1)
goto out;
if (debug)
printf("Channel established\n");
for (i = 0; i < 30; i++) {
SSL_set_mtu(clnt_ssl, 500 + i);
mtus[i] = DTLS_get_data_mtu(clnt_ssl);
if (debug)
printf("%s%s payload MTU for record mtu %d = %"OSSLzu"\n",
cs, no_etm ? "-noEtM":"", 500 + i, mtus[i]);
if (mtus[i] == 0) {
fprintf(stderr,
"payload MTU failed with record MTU %d for %s\n",
500 + i, cs);
goto out;
}
}
SSL_set_mtu(clnt_ssl, 1000);
for (s = mtus[0]; s <= mtus[29]; s++) {
size_t reclen;
if (SSL_write(clnt_ssl, buf, s) != (int)s) {
ERR_print_errors_fp(stdout);
goto out;
}
reclen = BIO_read(sc_bio, buf, sizeof(buf));
if (debug)
printf("record %"OSSLzu" for payload %"OSSLzu"\n", reclen, s);
for (i = 0; i < 30; i++) {
if (s <= mtus[i] && reclen > (size_t)(500 + i)) {
fprintf(stderr,
"%s: Payload MTU %"OSSLzu" reported for record MTU %d\n"
"but sending a payload of %"OSSLzu" made a record of %"OSSLzu"(too large)\n",
cs, mtus[i], 500 + i, s, reclen);
goto out;
}
if (s > mtus[i] && reclen <= (size_t)(500 + i)) {
fprintf(stderr,
"%s: Payload MTU %"OSSLzu" reported for record MTU %d\n"
"but sending a payload of %"OSSLzu" made a record of %"OSSLzu" (too small)\n",
cs, mtus[i], 500 + i, s, reclen);
goto out;
}
}
}
rv = 1;
if (SSL_USE_ETM(clnt_ssl))
rv = 2;
out:
SSL_free(clnt_ssl);
SSL_free(srvr_ssl);
return rv;
}
test/dtls_mtu_test.c:117: error: UNINITIALIZED_VALUE
The value read from mtus[_] was never initialized.
Showing all 1 steps of the trace
test/dtls_mtu_test.c:117:17:
115. /* We sent a packet smaller than or equal to mtus[j] and
116. * that made a record *larger* than the record MTU 500+j! */
117. > fprintf(stderr,
118. "%s: Payload MTU %"OSSLzu" reported for record MTU %d\n"
119. "but sending a payload of %"OSSLzu" made a record of %"OSSLzu"(too large)\n",
|
https://github.com/openssl/openssl/blob/8aefa08cfbc7db7cc10765ee9684090e37983f45/test/dtls_mtu_test.c/#L117
|
d2a_code_trace_data_42980
|
static int build_chain(X509_STORE_CTX *ctx)
{
struct dane_st *dane = (struct dane_st *)ctx->dane;
int (*cb) (int, X509_STORE_CTX *) = ctx->verify_cb;
int num = sk_X509_num(ctx->chain);
X509 *cert = sk_X509_value(ctx->chain, num - 1);
int ss = cert_self_signed(cert);
STACK_OF(X509) *sktmp = NULL;
unsigned int search;
int may_trusted = 0;
int may_alternate = 0;
int trust = X509_TRUST_UNTRUSTED;
int alt_untrusted = 0;
int depth;
int ok = 0;
int i;
OPENSSL_assert(num == 1 && ctx->num_untrusted == num);
#define S_DOUNTRUSTED (1 << 0)
#define S_DOTRUSTED (1 << 1)
#define S_DOALTERNATE (1 << 2)
search = (ctx->untrusted != NULL) ? S_DOUNTRUSTED : 0;
if (DANETLS_HAS_PKIX(dane) || !DANETLS_HAS_DANE(dane)) {
if (search == 0 || ctx->param->flags & X509_V_FLAG_TRUSTED_FIRST)
search |= S_DOTRUSTED;
else if (!(ctx->param->flags & X509_V_FLAG_NO_ALT_CHAINS))
may_alternate = 1;
may_trusted = 1;
}
if (ctx->untrusted && (sktmp = sk_X509_dup(ctx->untrusted)) == NULL) {
X509err(X509_F_BUILD_CHAIN, ERR_R_MALLOC_FAILURE);
return 0;
}
if (DANETLS_ENABLED(dane) && dane->certs != NULL) {
for (i = 0; i < sk_X509_num(dane->certs); ++i) {
if (!sk_X509_push(sktmp, sk_X509_value(dane->certs, i))) {
sk_X509_free(sktmp);
X509err(X509_F_BUILD_CHAIN, ERR_R_MALLOC_FAILURE);
return 0;
}
}
}
if (ctx->param->depth > INT_MAX/2)
ctx->param->depth = INT_MAX/2;
depth = ctx->param->depth + 1;
while (search != 0) {
X509 *x;
X509 *xtmp = NULL;
if ((search & S_DOTRUSTED) != 0) {
STACK_OF(X509) *hide = ctx->chain;
i = num = sk_X509_num(ctx->chain);
if ((search & S_DOALTERNATE) != 0) {
i = alt_untrusted;
}
x = sk_X509_value(ctx->chain, i-1);
ctx->chain = NULL;
ok = (depth < num) ? 0 : ctx->get_issuer(&xtmp, ctx, x);
ctx->chain = hide;
if (ok < 0) {
trust = X509_TRUST_REJECTED;
search = 0;
continue;
}
if (ok > 0) {
if ((search & S_DOALTERNATE) != 0) {
OPENSSL_assert(num > i && i > 0 && ss == 0);
search &= ~S_DOALTERNATE;
for (; num > i; --num)
X509_free(sk_X509_pop(ctx->chain));
ctx->num_untrusted = num;
if (DANETLS_ENABLED(dane) &&
dane->mdpth >= ctx->num_untrusted) {
dane->mdpth = -1;
X509_free(dane->mcert);
dane->mcert = NULL;
}
if (DANETLS_ENABLED(dane) &&
dane->pdpth >= ctx->num_untrusted)
dane->pdpth = -1;
}
if (ss == 0) {
if (!sk_X509_push(ctx->chain, x = xtmp)) {
X509_free(xtmp);
X509err(X509_F_BUILD_CHAIN, ERR_R_MALLOC_FAILURE);
trust = X509_TRUST_REJECTED;
search = 0;
continue;
}
ss = cert_self_signed(x);
} else if (num == ctx->num_untrusted) {
if (X509_cmp(x, xtmp) != 0) {
X509_free(xtmp);
ok = 0;
} else {
X509_free(x);
ctx->num_untrusted = --num;
(void) sk_X509_set(ctx->chain, num, x = xtmp);
}
}
if (ok) {
OPENSSL_assert(ctx->num_untrusted <= num);
search &= ~S_DOUNTRUSTED;
switch (trust = check_trust(ctx, num)) {
case X509_TRUST_TRUSTED:
case X509_TRUST_REJECTED:
search = 0;
continue;
}
if (ss == 0)
continue;
}
}
if ((search & S_DOUNTRUSTED) == 0) {
if ((search & S_DOALTERNATE) != 0 && --alt_untrusted > 0)
continue;
if (!may_alternate || (search & S_DOALTERNATE) != 0 ||
ctx->num_untrusted < 2)
break;
search |= S_DOALTERNATE;
alt_untrusted = ctx->num_untrusted - 1;
ss = 0;
}
}
if ((search & S_DOUNTRUSTED) != 0) {
num = sk_X509_num(ctx->chain);
OPENSSL_assert(num == ctx->num_untrusted);
x = sk_X509_value(ctx->chain, num-1);
xtmp = (depth < num) ? NULL : find_issuer(ctx, sktmp, x);
if (xtmp == NULL) {
search &= ~S_DOUNTRUSTED;
if (may_trusted)
search |= S_DOTRUSTED;
continue;
}
if (!sk_X509_push(ctx->chain, x = xtmp)) {
X509err(X509_F_BUILD_CHAIN, ERR_R_MALLOC_FAILURE);
trust = X509_TRUST_REJECTED;
search = 0;
continue;
}
X509_up_ref(x);
++ctx->num_untrusted;
ss = cert_self_signed(xtmp);
(void) sk_X509_delete_ptr(sktmp, x);
switch (trust = check_dane_issuer(ctx, ctx->num_untrusted - 1)) {
case X509_TRUST_TRUSTED:
case X509_TRUST_REJECTED:
search = 0;
continue;
}
}
}
sk_X509_free(sktmp);
num = sk_X509_num(ctx->chain);
if (num <= depth) {
if (trust == X509_TRUST_UNTRUSTED && DANETLS_HAS_DANE_TA(dane))
trust = check_dane_pkeys(ctx);
if (trust == X509_TRUST_UNTRUSTED && num == ctx->num_untrusted)
trust = check_trust(ctx, num);
}
switch (trust) {
case X509_TRUST_TRUSTED:
return 1;
case X509_TRUST_REJECTED:
return 0;
case X509_TRUST_UNTRUSTED:
default:
num = sk_X509_num(ctx->chain);
ctx->current_cert = sk_X509_value(ctx->chain, num - 1);
ctx->error_depth = num-1;
if (num > depth)
ctx->error = X509_V_ERR_CERT_CHAIN_TOO_LONG;
else if (DANETLS_ENABLED(dane) &&
(!DANETLS_HAS_PKIX(dane) || dane->pdpth >= 0))
ctx->error = X509_V_ERR_CERT_UNTRUSTED;
else if (ss && sk_X509_num(ctx->chain) == 1)
ctx->error = X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT;
else if (ss)
ctx->error = X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN;
else if (ctx->num_untrusted == num)
ctx->error = X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY;
else
ctx->error = X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT;
if (DANETLS_ENABLED(dane))
dane_reset(dane);
return cb(0, ctx);
}
}
crypto/x509/x509_vfy.c:2641: error: NULL_DEREFERENCE
pointer `cert` last assigned on line 2640 could be null and is dereferenced by call to `cert_self_signed()` at line 2641, column 14.
Showing all 21 steps of the trace
crypto/x509/x509_vfy.c:2635:1: start of procedure build_chain()
2633. }
2634.
2635. > static int build_chain(X509_STORE_CTX *ctx)
2636. {
2637. struct dane_st *dane = (struct dane_st *)ctx->dane;
crypto/x509/x509_vfy.c:2637:5:
2635. static int build_chain(X509_STORE_CTX *ctx)
2636. {
2637. > struct dane_st *dane = (struct dane_st *)ctx->dane;
2638. int (*cb) (int, X509_STORE_CTX *) = ctx->verify_cb;
2639. int num = sk_X509_num(ctx->chain);
crypto/x509/x509_vfy.c:2638:5:
2636. {
2637. struct dane_st *dane = (struct dane_st *)ctx->dane;
2638. > int (*cb) (int, X509_STORE_CTX *) = ctx->verify_cb;
2639. int num = sk_X509_num(ctx->chain);
2640. X509 *cert = sk_X509_value(ctx->chain, num - 1);
crypto/x509/x509_vfy.c:2639:5:
2637. struct dane_st *dane = (struct dane_st *)ctx->dane;
2638. int (*cb) (int, X509_STORE_CTX *) = ctx->verify_cb;
2639. > int num = sk_X509_num(ctx->chain);
2640. X509 *cert = sk_X509_value(ctx->chain, num - 1);
2641. int ss = cert_self_signed(cert);
include/openssl/x509.h:170:1: start of procedure sk_X509_num()
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:317:1: start of procedure sk_num()
315. }
316.
317. > int sk_num(const _STACK *st)
318. {
319. if (st == NULL)
crypto/stack/stack.c:319:9: Taking true branch
317. int sk_num(const _STACK *st)
318. {
319. if (st == NULL)
^
320. return -1;
321. return st->num;
crypto/stack/stack.c:320:9:
318. {
319. if (st == NULL)
320. > return -1;
321. return st->num;
322. }
crypto/stack/stack.c:322:1: return from a call to sk_num
320. return -1;
321. return st->num;
322. > }
323.
324. void *sk_value(const _STACK *st, int i)
include/openssl/x509.h:170:1: return from a call to sk_X509_num
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:2640:5:
2638. int (*cb) (int, X509_STORE_CTX *) = ctx->verify_cb;
2639. int num = sk_X509_num(ctx->chain);
2640. > X509 *cert = sk_X509_value(ctx->chain, num - 1);
2641. int ss = cert_self_signed(cert);
2642. STACK_OF(X509) *sktmp = 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 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:2641:5:
2639. int num = sk_X509_num(ctx->chain);
2640. X509 *cert = sk_X509_value(ctx->chain, num - 1);
2641. > int ss = cert_self_signed(cert);
2642. STACK_OF(X509) *sktmp = NULL;
2643. unsigned int search;
crypto/x509/x509_vfy.c:155:1: start of procedure cert_self_signed()
153.
154. /* Return 1 is a certificate is self signed */
155. > static int cert_self_signed(X509 *x)
156. {
157. /*
crypto/x509/x509_vfy.c:162:5: Skipping X509_check_purpose(): empty list of specs
160. * parse errors, rather than memory pressure!
161. */
162. X509_check_purpose(x, -1, 0);
^
163. if (x->ex_flags & EXFLAG_SS)
164. return 1;
crypto/x509/x509_vfy.c:163:9:
161. */
162. X509_check_purpose(x, -1, 0);
163. > if (x->ex_flags & EXFLAG_SS)
164. return 1;
165. else
|
https://github.com/openssl/openssl/blob/25be7a0feacdbd3326774f0da8aaeb966c1f57f8/crypto/x509/x509_vfy.c/#L2641
|
d2a_code_trace_data_42981
|
static int
LZWSetupDecode(TIFF* tif)
{
static const char module[] = "LZWSetupDecode";
LZWCodecState* sp = DecoderState(tif);
int code;
if( sp == NULL )
{
tif->tif_data = (uint8*) _TIFFmalloc(sizeof(LZWCodecState));
if (tif->tif_data == NULL)
{
TIFFErrorExt(tif->tif_clientdata, module, "No space for LZW state block");
return (0);
}
DecoderState(tif)->dec_codetab = NULL;
DecoderState(tif)->dec_decode = NULL;
(void) TIFFPredictorInit(tif);
sp = DecoderState(tif);
}
assert(sp != NULL);
if (sp->dec_codetab == NULL) {
sp->dec_codetab = (code_t*)_TIFFmalloc(CSIZE*sizeof (code_t));
if (sp->dec_codetab == NULL) {
TIFFErrorExt(tif->tif_clientdata, module,
"No space for LZW code table");
return (0);
}
code = 255;
do {
sp->dec_codetab[code].value = (unsigned char)code;
sp->dec_codetab[code].firstchar = (unsigned char)code;
sp->dec_codetab[code].length = 1;
sp->dec_codetab[code].next = NULL;
} while (code--);
_TIFFmemset(&sp->dec_codetab[CODE_CLEAR], 0,
(CODE_FIRST - CODE_CLEAR) * sizeof (code_t));
}
return (1);
}
libtiff/tif_lzw.c:224: error: Memory Leak
memory dynamically allocated by call to `_TIFFmalloc()` at line 211, column 28 is not reachable after line 224, column 10.
libtiff/tif_lzw.c:198:1: start of procedure LZWSetupDecode()
196. }
197.
198. static int
^
199. LZWSetupDecode(TIFF* tif)
200. {
libtiff/tif_lzw.c:201:2:
199. LZWSetupDecode(TIFF* tif)
200. {
201. static const char module[] = "LZWSetupDecode";
^
202. LZWCodecState* sp = DecoderState(tif);
203. int code;
libtiff/tif_lzw.c:202:2:
200. {
201. static const char module[] = "LZWSetupDecode";
202. LZWCodecState* sp = DecoderState(tif);
^
203. int code;
204.
libtiff/tif_lzw.c:205:6: Taking true branch
203. int code;
204.
205. if( sp == NULL )
^
206. {
207. /*
libtiff/tif_lzw.c:211:3:
209. * values.
210. */
211. tif->tif_data = (uint8*) _TIFFmalloc(sizeof(LZWCodecState));
^
212. if (tif->tif_data == NULL)
213. {
libtiff/tif_unix.c:310:1: start of procedure _TIFFmalloc()
308. #endif
309.
310. void*
^
311. _TIFFmalloc(tmsize_t s)
312. {
libtiff/tif_unix.c:313:13: Taking false branch
311. _TIFFmalloc(tmsize_t s)
312. {
313. if (s == 0)
^
314. return ((void *) NULL);
315.
libtiff/tif_unix.c:316:2:
314. return ((void *) NULL);
315.
316. return (malloc((size_t) s));
^
317. }
318.
libtiff/tif_unix.c:317:1: return from a call to _TIFFmalloc
315.
316. return (malloc((size_t) s));
317. }
^
318.
319. void* _TIFFcalloc(tmsize_t nmemb, tmsize_t siz)
libtiff/tif_lzw.c:212:7: Taking false branch
210. */
211. tif->tif_data = (uint8*) _TIFFmalloc(sizeof(LZWCodecState));
212. if (tif->tif_data == NULL)
^
213. {
214. TIFFErrorExt(tif->tif_clientdata, module, "No space for LZW state block");
libtiff/tif_lzw.c:218:3:
216. }
217.
218. DecoderState(tif)->dec_codetab = NULL;
^
219. DecoderState(tif)->dec_decode = NULL;
220.
libtiff/tif_lzw.c:219:3:
217.
218. DecoderState(tif)->dec_codetab = NULL;
219. DecoderState(tif)->dec_decode = NULL;
^
220.
221. /*
libtiff/tif_lzw.c:224:10:
222. * Setup predictor setup.
223. */
224. (void) TIFFPredictorInit(tif);
^
225.
226. sp = DecoderState(tif);
libtiff/tif_predict.c:817:1: start of procedure TIFFPredictorInit()
815. }
816.
817. int
^
818. TIFFPredictorInit(TIFF* tif)
819. {
libtiff/tif_predict.c:820:2:
818. TIFFPredictorInit(TIFF* tif)
819. {
820. TIFFPredictorState* sp = PredictorState(tif);
^
821.
822. assert(sp != 0);
libtiff/tif_predict.c:822:2: Condition is true
820. TIFFPredictorState* sp = PredictorState(tif);
821.
822. assert(sp != 0);
^
823.
824. /*
libtiff/tif_predict.c:827:7: Taking true branch
825. * Merge codec-specific tag information.
826. */
827. if (!_TIFFMergeFields(tif, predictFields,
^
828. TIFFArrayCount(predictFields))) {
829. TIFFErrorExt(tif->tif_clientdata, "TIFFPredictorInit",
libtiff/tif_predict.c:829:3:
827. if (!_TIFFMergeFields(tif, predictFields,
828. TIFFArrayCount(predictFields))) {
829. TIFFErrorExt(tif->tif_clientdata, "TIFFPredictorInit",
^
830. "Merging Predictor codec-specific tags failed");
831. return 0;
libtiff/tif_error.c:66:1: start of procedure TIFFErrorExt()
64. }
65.
66. void
^
67. TIFFErrorExt(thandle_t fd, const char* module, const char* fmt, ...)
68. {
libtiff/tif_error.c:70:6: Taking false branch
68. {
69. va_list ap;
70. if (_TIFFerrorHandler) {
^
71. va_start(ap, fmt);
72. (*_TIFFerrorHandler)(module, fmt, ap);
libtiff/tif_error.c:75:6: Taking false branch
73. va_end(ap);
74. }
75. if (_TIFFerrorHandlerExt) {
^
76. va_start(ap, fmt);
77. (*_TIFFerrorHandlerExt)(fd, module, fmt, ap);
libtiff/tif_error.c:75:2:
73. va_end(ap);
74. }
75. if (_TIFFerrorHandlerExt) {
^
76. va_start(ap, fmt);
77. (*_TIFFerrorHandlerExt)(fd, module, fmt, ap);
libtiff/tif_error.c:80:1: return from a call to TIFFErrorExt
78. va_end(ap);
79. }
80. }
^
81.
82. /*
libtiff/tif_predict.c:831:3:
829. TIFFErrorExt(tif->tif_clientdata, "TIFFPredictorInit",
830. "Merging Predictor codec-specific tags failed");
831. return 0;
^
832. }
833.
libtiff/tif_predict.c:856:1: return from a call to TIFFPredictorInit
854. sp->decodepfunc = NULL; /* no predictor routine */
855. return 1;
856. }
^
857.
858. int
|
https://gitlab.com/libtiff/libtiff/blob/6dac309a9701d15ac52d895d566ddae2ed49db9b/libtiff/tif_lzw.c/#L224
|
d2a_code_trace_data_42982
|
void avfilter_unref_buffer(AVFilterBufferRef *ref)
{
if(!(--ref->buf->refcount))
ref->buf->free(ref->buf);
av_free(ref->video);
av_free(ref);
}
libavfilter/vf_pad.c:441: error: Integer Overflow L1
(0 - 1):unsigned32 by call to `avfilter_unref_buffer`.
libavfilter/vf_pad.c:433:5: Assignment
431. picref->video->pixel_aspect = (AVRational) {1, 1};
432. picref->pts = av_rescale_q(color->pts++, color->time_base, AV_TIME_BASE_Q);
433. picref->pos = 0;
^
434.
435. avfilter_start_frame(link, avfilter_ref_buffer(picref, ~0));
libavfilter/vf_pad.c:435:32: Call
433. picref->pos = 0;
434.
435. avfilter_start_frame(link, avfilter_ref_buffer(picref, ~0));
^
436. draw_rectangle(picref,
437. color->line, color->line_step, color->hsub, color->vsub,
libavfilter/avfilter.c:48:1: Parameter `ref->type`
46. #define link_spad(link) link->src->output_pads[link->srcpad]
47.
48. AVFilterBufferRef *avfilter_ref_buffer(AVFilterBufferRef *ref, int pmask)
^
49. {
50. AVFilterBufferRef *ret = av_malloc(sizeof(AVFilterBufferRef));
libavfilter/vf_pad.c:435:5: Call
433. picref->pos = 0;
434.
435. avfilter_start_frame(link, avfilter_ref_buffer(picref, ~0));
^
436. draw_rectangle(picref,
437. color->line, color->line_step, color->hsub, color->vsub,
libavfilter/avfilter.c:250:1: Parameter `picref->type`
248. /* XXX: should we do the duplicating of the picture ref here, instead of
249. * forcing the source filter to do it? */
250. void avfilter_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
^
251. {
252. void (*start_frame)(AVFilterLink *, AVFilterBufferRef *);
libavfilter/vf_pad.c:436:5: Call
434.
435. avfilter_start_frame(link, avfilter_ref_buffer(picref, ~0));
436. draw_rectangle(picref,
^
437. color->line, color->line_step, color->hsub, color->vsub,
438. 0, 0, color->w, color->h);
libavfilter/vf_pad.c:86:1: Parameter `outpic->linesize[*]`
84. }
85.
86. static void draw_rectangle(AVFilterBufferRef *outpic, uint8_t *line[4], int line_step[4],
^
87. int hsub, int vsub, int x, int y, int w, int h)
88. {
libavfilter/vf_pad.c:439:5: Call
437. color->line, color->line_step, color->hsub, color->vsub,
438. 0, 0, color->w, color->h);
439. avfilter_draw_slice(link, 0, color->h, 1);
^
440. avfilter_end_frame(link);
441. avfilter_unref_buffer(picref);
libavfilter/avfilter.c:298:1: Parameter `link->cur_buf->linesize[*]`
296. }
297.
298. void avfilter_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
^
299. {
300. uint8_t *src[4], *dst[4];
libavfilter/vf_pad.c:441:5: Call
439. avfilter_draw_slice(link, 0, color->h, 1);
440. avfilter_end_frame(link);
441. avfilter_unref_buffer(picref);
^
442.
443. return 0;
libavfilter/avfilter.c:61:1: <LHS trace>
59. }
60.
61. void avfilter_unref_buffer(AVFilterBufferRef *ref)
^
62. {
63. if(!(--ref->buf->refcount))
libavfilter/avfilter.c:61:1: Parameter `ref->buf->refcount`
59. }
60.
61. void avfilter_unref_buffer(AVFilterBufferRef *ref)
^
62. {
63. if(!(--ref->buf->refcount))
libavfilter/avfilter.c:63:10: Binary operation: (0 - 1):unsigned32 by call to `avfilter_unref_buffer`
61. void avfilter_unref_buffer(AVFilterBufferRef *ref)
62. {
63. if(!(--ref->buf->refcount))
^
64. ref->buf->free(ref->buf);
65. av_free(ref->video);
|
https://github.com/libav/libav/blob/ad0d70c964f852a18e9ab8124f0e7aa8876cac6e/libavfilter/avfilter.c/#L63
|
d2a_code_trace_data_42983
|
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_upstream_round_robin.c:149: error: Buffer Overrun L3
Offset: [0, 65535] Size: [6, +oo] by call to `ngx_inet_resolve_host`.
src/http/ngx_http_upstream_round_robin.c:149:9: Call
147. u.port = (in_port_t) (us->port ? us->port : us->default_port);
148.
149. if (ngx_inet_resolve_host(cf->pool, &u) != NGX_OK) {
^
150. if (u.err) {
151. ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
src/core/ngx_inet.c:688:1: Parameter `u->host.len`
686.
687.
688. ngx_int_t
^
689. ngx_inet_resolve_host(ngx_pool_t *pool, ngx_url_t *u)
690. {
src/core/ngx_inet.c:790:13: Call
788. u->addrs[0].socklen = sizeof(struct sockaddr_in);
789.
790. p = ngx_pnalloc(pool, u->host.len + sizeof(":65535") - 1);
^
791. if (p == NULL) {
792. return NGX_ERROR;
src/core/ngx_palloc.c:155:13: Assignment
153.
154. do {
155. m = p->d.last;
^
156.
157. if ((size_t) (p->d.end - m) >= size) {
src/core/ngx_palloc.c:160:17: Assignment
158. p->d.last = m + size;
159.
160. return m;
^
161. }
162.
src/core/ngx_inet.c:790:9: Assignment
788. u->addrs[0].socklen = sizeof(struct sockaddr_in);
789.
790. p = ngx_pnalloc(pool, u->host.len + sizeof(":65535") - 1);
^
791. if (p == NULL) {
792. return NGX_ERROR;
src/core/ngx_inet.c:795:32: Call
793. }
794.
795. u->addrs[0].name.len = ngx_sprintf(p, "%V:%d",
^
796. &u->host, ntohs(port)) - p;
797. u->addrs[0].name.data = p;
src/core/ngx_string.c:95:1: Parameter `*buf`
93.
94.
95. u_char * ngx_cdecl
^
96. ngx_sprintf(u_char *buf, const char *fmt, ...)
97. {
src/core/ngx_string.c:102:9: Call
100.
101. va_start(args, fmt);
102. p = ngx_vsnprintf(buf, /* STUB */ 65536, fmt, args);
^
103. va_end(args);
104.
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, 65535] Size: [6, +oo] by call to `ngx_inet_resolve_host`
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_42984
|
int
ff_rm_retrieve_cache (AVFormatContext *s, AVIOContext *pb,
AVStream *st, RMStream *ast, AVPacket *pkt)
{
RMDemuxContext *rm = s->priv_data;
assert (rm->audio_pkt_cnt > 0);
if (st->codec->codec_id == CODEC_ID_AAC)
av_get_packet(pb, pkt, ast->sub_packet_lengths[ast->sub_packet_cnt - rm->audio_pkt_cnt]);
else {
av_new_packet(pkt, st->codec->block_align);
memcpy(pkt->data, ast->pkt.data + st->codec->block_align *
(ast->sub_packet_h * ast->audio_framesize / st->codec->block_align - rm->audio_pkt_cnt),
st->codec->block_align);
}
rm->audio_pkt_cnt--;
if ((pkt->pts = ast->audiotimestamp) != AV_NOPTS_VALUE) {
ast->audiotimestamp = AV_NOPTS_VALUE;
pkt->flags = AV_PKT_FLAG_KEY;
} else
pkt->flags = 0;
pkt->stream_index = st->index;
return rm->audio_pkt_cnt;
}
libavformat/rmdec.c:794: error: Null Dereference
pointer `pkt->data` last assigned on line 793 could be null and is dereferenced by call to `memcpy()` at line 794, column 9.
libavformat/rmdec.c:782:1: start of procedure ff_rm_retrieve_cache()
780. }
781.
782. int
^
783. ff_rm_retrieve_cache (AVFormatContext *s, AVIOContext *pb,
784. AVStream *st, RMStream *ast, AVPacket *pkt)
libavformat/rmdec.c:786:5:
784. AVStream *st, RMStream *ast, AVPacket *pkt)
785. {
786. RMDemuxContext *rm = s->priv_data;
^
787.
788. assert (rm->audio_pkt_cnt > 0);
libavformat/rmdec.c:788:5:
786. RMDemuxContext *rm = s->priv_data;
787.
788. assert (rm->audio_pkt_cnt > 0);
^
789.
790. if (st->codec->codec_id == CODEC_ID_AAC)
libavformat/rmdec.c:790:9: Taking false branch
788. assert (rm->audio_pkt_cnt > 0);
789.
790. if (st->codec->codec_id == CODEC_ID_AAC)
^
791. av_get_packet(pb, pkt, ast->sub_packet_lengths[ast->sub_packet_cnt - rm->audio_pkt_cnt]);
792. else {
libavformat/rmdec.c:793:9:
791. av_get_packet(pb, pkt, ast->sub_packet_lengths[ast->sub_packet_cnt - rm->audio_pkt_cnt]);
792. else {
793. av_new_packet(pkt, st->codec->block_align);
^
794. memcpy(pkt->data, ast->pkt.data + st->codec->block_align * //FIXME avoid this
795. (ast->sub_packet_h * ast->audio_framesize / st->codec->block_align - rm->audio_pkt_cnt),
libavcodec/avpacket.c:60:1: start of procedure av_new_packet()
58. }
59.
60. int av_new_packet(AVPacket *pkt, int size)
^
61. {
62. uint8_t *data= NULL;
libavcodec/avpacket.c:62:5:
60. int av_new_packet(AVPacket *pkt, int size)
61. {
62. uint8_t *data= NULL;
^
63. if((unsigned)size < (unsigned)size + FF_INPUT_BUFFER_PADDING_SIZE)
64. data = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
libavcodec/avpacket.c:63:8: Taking true branch
61. {
62. uint8_t *data= NULL;
63. if((unsigned)size < (unsigned)size + FF_INPUT_BUFFER_PADDING_SIZE)
^
64. data = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
65. if (data){
libavcodec/avpacket.c:64:9:
62. uint8_t *data= NULL;
63. if((unsigned)size < (unsigned)size + FF_INPUT_BUFFER_PADDING_SIZE)
64. data = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
^
65. if (data){
66. memset(data + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
libavutil/mem.c:64:1: start of procedure av_malloc()
62. linker will do it automatically. */
63.
64. void *av_malloc(size_t size)
^
65. {
66. void *ptr = NULL;
libavutil/mem.c:66:5:
64. void *av_malloc(size_t size)
65. {
66. void *ptr = NULL;
^
67. #if CONFIG_MEMALIGN_HACK
68. long diff;
libavutil/mem.c:72:8: Taking true branch
70.
71. /* let's disallow possible ambiguous cases */
72. if(size > (INT_MAX-32) )
^
73. return NULL;
74.
libavutil/mem.c:73:9:
71. /* let's disallow possible ambiguous cases */
72. if(size > (INT_MAX-32) )
73. return NULL;
^
74.
75. #if CONFIG_MEMALIGN_HACK
libavutil/mem.c:115:1: return from a call to av_malloc
113. #endif
114. return ptr;
115. }
^
116.
117. void *av_realloc(void *ptr, size_t size)
libavcodec/avpacket.c:65:9: Taking false branch
63. if((unsigned)size < (unsigned)size + FF_INPUT_BUFFER_PADDING_SIZE)
64. data = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
65. if (data){
^
66. memset(data + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
67. }else
libavcodec/avpacket.c:68:9:
66. memset(data + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
67. }else
68. size=0;
^
69.
70. av_init_packet(pkt);
libavcodec/avpacket.c:70:5:
68. size=0;
69.
70. av_init_packet(pkt);
^
71. pkt->data = data;
72. pkt->size = size;
libavcodec/avpacket.c:46:1: start of procedure av_init_packet()
44. }
45.
46. void av_init_packet(AVPacket *pkt)
^
47. {
48. pkt->pts = AV_NOPTS_VALUE;
libavcodec/avpacket.c:48:5:
46. void av_init_packet(AVPacket *pkt)
47. {
48. pkt->pts = AV_NOPTS_VALUE;
^
49. pkt->dts = AV_NOPTS_VALUE;
50. pkt->pos = -1;
libavcodec/avpacket.c:49:5:
47. {
48. pkt->pts = AV_NOPTS_VALUE;
49. pkt->dts = AV_NOPTS_VALUE;
^
50. pkt->pos = -1;
51. pkt->duration = 0;
libavcodec/avpacket.c:50:5:
48. pkt->pts = AV_NOPTS_VALUE;
49. pkt->dts = AV_NOPTS_VALUE;
50. pkt->pos = -1;
^
51. pkt->duration = 0;
52. pkt->convergence_duration = 0;
libavcodec/avpacket.c:51:5:
49. pkt->dts = AV_NOPTS_VALUE;
50. pkt->pos = -1;
51. pkt->duration = 0;
^
52. pkt->convergence_duration = 0;
53. pkt->flags = 0;
libavcodec/avpacket.c:52:5:
50. pkt->pos = -1;
51. pkt->duration = 0;
52. pkt->convergence_duration = 0;
^
53. pkt->flags = 0;
54. pkt->stream_index = 0;
libavcodec/avpacket.c:53:5:
51. pkt->duration = 0;
52. pkt->convergence_duration = 0;
53. pkt->flags = 0;
^
54. pkt->stream_index = 0;
55. pkt->destruct= NULL;
libavcodec/avpacket.c:54:5:
52. pkt->convergence_duration = 0;
53. pkt->flags = 0;
54. pkt->stream_index = 0;
^
55. pkt->destruct= NULL;
56. pkt->side_data = NULL;
libavcodec/avpacket.c:55:5:
53. pkt->flags = 0;
54. pkt->stream_index = 0;
55. pkt->destruct= NULL;
^
56. pkt->side_data = NULL;
57. pkt->side_data_elems = 0;
libavcodec/avpacket.c:56:5:
54. pkt->stream_index = 0;
55. pkt->destruct= NULL;
56. pkt->side_data = NULL;
^
57. pkt->side_data_elems = 0;
58. }
libavcodec/avpacket.c:57:5:
55. pkt->destruct= NULL;
56. pkt->side_data = NULL;
57. pkt->side_data_elems = 0;
^
58. }
59.
libavcodec/avpacket.c:58:1: return from a call to av_init_packet
56. pkt->side_data = NULL;
57. pkt->side_data_elems = 0;
58. }
^
59.
60. int av_new_packet(AVPacket *pkt, int size)
libavcodec/avpacket.c:71:5:
69.
70. av_init_packet(pkt);
71. pkt->data = data;
^
72. pkt->size = size;
73. pkt->destruct = av_destruct_packet;
libavcodec/avpacket.c:72:5:
70. av_init_packet(pkt);
71. pkt->data = data;
72. pkt->size = size;
^
73. pkt->destruct = av_destruct_packet;
74. if(!data)
libavcodec/avpacket.c:73:5:
71. pkt->data = data;
72. pkt->size = size;
73. pkt->destruct = av_destruct_packet;
^
74. if(!data)
75. return AVERROR(ENOMEM);
libavcodec/avpacket.c:74:9: Taking true branch
72. pkt->size = size;
73. pkt->destruct = av_destruct_packet;
74. if(!data)
^
75. return AVERROR(ENOMEM);
76. return 0;
libavcodec/avpacket.c:75:9:
73. pkt->destruct = av_destruct_packet;
74. if(!data)
75. return AVERROR(ENOMEM);
^
76. return 0;
77. }
libavcodec/avpacket.c:77:1: return from a call to av_new_packet
75. return AVERROR(ENOMEM);
76. return 0;
77. }
^
78.
79. void av_shrink_packet(AVPacket *pkt, int size)
libavformat/rmdec.c:794:9:
792. else {
793. av_new_packet(pkt, st->codec->block_align);
794. memcpy(pkt->data, ast->pkt.data + st->codec->block_align * //FIXME avoid this
^
795. (ast->sub_packet_h * ast->audio_framesize / st->codec->block_align - rm->audio_pkt_cnt),
796. st->codec->block_align);
|
https://github.com/libav/libav/blob/eb97dbb05a990266b04830ea8e179e0428656b98/libavformat/rmdec.c/#L794
|
d2a_code_trace_data_42985
|
static int seq_parse_frame_data(SeqDemuxContext *seq, ByteIOContext *pb)
{
unsigned int offset_table[4], buffer_num[4];
TiertexSeqFrameBuffer *seq_buffer;
int i, e, err;
seq->current_frame_offs += SEQ_FRAME_SIZE;
url_fseek(pb, seq->current_frame_offs, SEEK_SET);
seq->current_audio_data_offs = get_le16(pb);
if (seq->current_audio_data_offs != 0) {
seq->current_audio_data_size = SEQ_AUDIO_BUFFER_SIZE * 2;
} else {
seq->current_audio_data_size = 0;
}
seq->current_pal_data_offs = get_le16(pb);
if (seq->current_pal_data_offs != 0) {
seq->current_pal_data_size = 768;
} else {
seq->current_pal_data_size = 0;
}
for (i = 0; i < 4; i++)
buffer_num[i] = get_byte(pb);
for (i = 0; i < 4; i++)
offset_table[i] = get_le16(pb);
for (i = 0; i < 3; i++) {
if (offset_table[i] != 0) {
for (e = i + 1; e < 4 && offset_table[e] == 0; e++);
err = seq_fill_buffer(seq, pb, buffer_num[1 + i],
offset_table[i],
offset_table[e] - offset_table[i]);
if (err != 0)
return err;
}
}
if (buffer_num[0] != 255) {
if (buffer_num[0] >= SEQ_NUM_FRAME_BUFFERS)
return AVERROR_INVALIDDATA;
seq_buffer = &seq->frame_buffers[buffer_num[0]];
seq->current_video_data_size = seq_buffer->fill_size;
seq->current_video_data_ptr = seq_buffer->data;
seq_buffer->fill_size = 0;
} else {
seq->current_video_data_size = 0;
seq->current_video_data_ptr = 0;
}
return 0;
}
libavformat/tiertexseq.c:159: error: Uninitialized Value
The value read from offset_table[_] was never initialized.
libavformat/tiertexseq.c:159:19:
157. if (offset_table[i] != 0) {
158. for (e = i + 1; e < 4 && offset_table[e] == 0; e++);
159. err = seq_fill_buffer(seq, pb, buffer_num[1 + i],
^
160. offset_table[i],
161. offset_table[e] - offset_table[i]);
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavformat/tiertexseq.c/#L159
|
d2a_code_trace_data_42986
|
static void
JPEGFixupTagsSubsamplingSkip(struct JPEGFixupTagsSubsamplingData* data, uint16 skiplength)
{
if ((uint32)skiplength<=data->bufferbytesleft)
{
data->buffercurrentbyte+=skiplength;
data->bufferbytesleft-=skiplength;
}
else
{
uint16 m;
m=skiplength-data->bufferbytesleft;
if (m<=data->filebytesleft)
{
data->bufferbytesleft=0;
data->fileoffset+=m;
data->filebytesleft-=m;
data->filepositioned=0;
}
else
{
data->bufferbytesleft=0;
data->filebytesleft=0;
}
}
}
libtiff/tif_jpeg.c:812: error: Integer Overflow L2
([0, +oo] - 7):unsigned32 by call to `JPEGFixupTagsSubsamplingSkip`.
libtiff/tif_jpeg.c:743:1: Parameter `data->bufferbytesleft`
741. }
742.
743. static int
^
744. JPEGFixupTagsSubsamplingSec(struct JPEGFixupTagsSubsamplingData* data)
745. {
libtiff/tif_jpeg.c:752:9: Call
750. while (1)
751. {
752. if (!JPEGFixupTagsSubsamplingReadByte(data,&m))
^
753. return(0);
754. if (m==255)
libtiff/tif_jpeg.c:855:1: Parameter `data->bufferbytesleft`
853. }
854.
855. static int
^
856. JPEGFixupTagsSubsamplingReadByte(struct JPEGFixupTagsSubsamplingData* data, uint8* result)
857. {
libtiff/tif_jpeg.c:759:9: Call
757. while (1)
758. {
759. if (!JPEGFixupTagsSubsamplingReadByte(data,&m))
^
760. return(0);
761. if (m!=255)
libtiff/tif_jpeg.c:855:1: Parameter `data->bufferbytesleft`
853. }
854.
855. static int
^
856. JPEGFixupTagsSubsamplingReadByte(struct JPEGFixupTagsSubsamplingData* data, uint8* result)
857. {
libtiff/tif_jpeg.c:808:11: Call
806. uint8 p;
807. uint8 ph,pv;
808. if (!JPEGFixupTagsSubsamplingReadWord(data,&n))
^
809. return(0);
810. if (n!=8+data->tif->tif_dir.td_samplesperpixel*3)
libtiff/tif_jpeg.c:885:1: Parameter `data->bufferbytesleft`
883. }
884.
885. static int
^
886. JPEGFixupTagsSubsamplingReadWord(struct JPEGFixupTagsSubsamplingData* data, uint16* result)
887. {
libtiff/tif_jpeg.c:890:7: Call
888. uint8 ma;
889. uint8 mb;
890. if (!JPEGFixupTagsSubsamplingReadByte(data,&ma))
^
891. return(0);
892. if (!JPEGFixupTagsSubsamplingReadByte(data,&mb))
libtiff/tif_jpeg.c:855:1: Parameter `data->bufferbytesleft`
853. }
854.
855. static int
^
856. JPEGFixupTagsSubsamplingReadByte(struct JPEGFixupTagsSubsamplingData* data, uint8* result)
857. {
libtiff/tif_jpeg.c:812:6: Call
810. if (n!=8+data->tif->tif_dir.td_samplesperpixel*3)
811. return(0);
812. JPEGFixupTagsSubsamplingSkip(data,7);
^
813. if (!JPEGFixupTagsSubsamplingReadByte(data,&p))
814. return(0);
libtiff/tif_jpeg.c:898:1: <LHS trace>
896. }
897.
898. static void
^
899. JPEGFixupTagsSubsamplingSkip(struct JPEGFixupTagsSubsamplingData* data, uint16 skiplength)
900. {
libtiff/tif_jpeg.c:898:1: Parameter `skiplength`
896. }
897.
898. static void
^
899. JPEGFixupTagsSubsamplingSkip(struct JPEGFixupTagsSubsamplingData* data, uint16 skiplength)
900. {
libtiff/tif_jpeg.c:898:1: <RHS trace>
896. }
897.
898. static void
^
899. JPEGFixupTagsSubsamplingSkip(struct JPEGFixupTagsSubsamplingData* data, uint16 skiplength)
900. {
libtiff/tif_jpeg.c:898:1: Parameter `skiplength`
896. }
897.
898. static void
^
899. JPEGFixupTagsSubsamplingSkip(struct JPEGFixupTagsSubsamplingData* data, uint16 skiplength)
900. {
libtiff/tif_jpeg.c:904:3: Binary operation: ([0, +oo] - 7):unsigned32 by call to `JPEGFixupTagsSubsamplingSkip`
902. {
903. data->buffercurrentbyte+=skiplength;
904. data->bufferbytesleft-=skiplength;
^
905. }
906. else
|
https://gitlab.com/libtiff/libtiff/blob/771a4ea0a98c7a218c9f3add9a05e08d29625758/libtiff/tif_jpeg.c/#L904
|
d2a_code_trace_data_42987
|
static int nss_keylog_int(const char *prefix,
SSL *ssl,
const uint8_t *parameter_1,
size_t parameter_1_len,
const uint8_t *parameter_2,
size_t parameter_2_len)
{
char *out = NULL;
char *cursor = NULL;
size_t out_len = 0;
size_t i;
size_t prefix_len;
if (ssl->ctx->keylog_callback == NULL)
return 1;
prefix_len = strlen(prefix);
out_len = prefix_len + (2 * parameter_1_len) + (2 * parameter_2_len) + 3;
if ((out = cursor = OPENSSL_malloc(out_len)) == NULL) {
SSLfatal(ssl, SSL_AD_INTERNAL_ERROR, SSL_F_NSS_KEYLOG_INT,
ERR_R_MALLOC_FAILURE);
return 0;
}
strcpy(cursor, prefix);
cursor += prefix_len;
*cursor++ = ' ';
for (i = 0; i < parameter_1_len; i++) {
sprintf(cursor, "%02x", parameter_1[i]);
cursor += 2;
}
*cursor++ = ' ';
for (i = 0; i < parameter_2_len; i++) {
sprintf(cursor, "%02x", parameter_2[i]);
cursor += 2;
}
*cursor = '\0';
ssl->ctx->keylog_callback(ssl, (const char *)out);
OPENSSL_clear_free(out, out_len);
return 1;
}
ssl/statem/statem_clnt.c:3042: error: BUFFER_OVERRUN_L3
Offset: [4, +oo] Size: [1, 118] by call to `ssl_log_rsa_client_key_exchange`.
Showing all 10 steps of the trace
ssl/statem/statem_clnt.c:2995:5: Assignment
2993. }
2994.
2995. pmslen = SSL_MAX_MASTER_KEY_LENGTH;
^
2996. pms = OPENSSL_malloc(pmslen);
2997. if (pms == NULL) {
ssl/statem/statem_clnt.c:3042:10: Call
3040.
3041. /* Log the premaster secret, if logging is enabled. */
3042. if (!ssl_log_rsa_client_key_exchange(s, encdata, enclen, pms, pmslen)) {
^
3043. /* SSLfatal() already called */
3044. goto err;
ssl/ssl_lib.c:5148:1: Parameter `premaster_len`
5146. }
5147.
5148. > int ssl_log_rsa_client_key_exchange(SSL *ssl,
5149. const uint8_t *encrypted_premaster,
5150. size_t encrypted_premaster_len,
ssl/ssl_lib.c:5161:12: Call
5159.
5160. /* We only want the first 8 bytes of the encrypted premaster as a tag. */
5161. return nss_keylog_int("RSA",
^
5162. ssl,
5163. encrypted_premaster,
ssl/ssl_lib.c:5094:1: <Length trace>
5092. }
5093.
5094. > static int nss_keylog_int(const char *prefix,
5095. SSL *ssl,
5096. const uint8_t *parameter_1,
ssl/ssl_lib.c:5094:1: Parameter `prefix->strlen`
5092. }
5093.
5094. > static int nss_keylog_int(const char *prefix,
5095. SSL *ssl,
5096. const uint8_t *parameter_1,
ssl/ssl_lib.c:5118:5: Assignment
5116. * hexadecimal, so we need a buffer that is twice their lengths.
5117. */
5118. prefix_len = strlen(prefix);
^
5119. out_len = prefix_len + (2 * parameter_1_len) + (2 * parameter_2_len) + 3;
5120. if ((out = cursor = OPENSSL_malloc(out_len)) == NULL) {
ssl/ssl_lib.c:5127:5: Assignment
5125.
5126. strcpy(cursor, prefix);
5127. cursor += prefix_len;
^
5128. *cursor++ = ' ';
5129.
ssl/ssl_lib.c:5128:6: Assignment
5126. strcpy(cursor, prefix);
5127. cursor += prefix_len;
5128. *cursor++ = ' ';
^
5129.
5130. for (i = 0; i < parameter_1_len; i++) {
ssl/ssl_lib.c:5134:5: Array access: Offset: [4, +oo] Size: [1, 118] by call to `ssl_log_rsa_client_key_exchange`
5132. cursor += 2;
5133. }
5134. *cursor++ = ' ';
^
5135.
5136. for (i = 0; i < parameter_2_len; i++) {
|
https://github.com/openssl/openssl/blob/fb9c3ff565aa11b08646e0f9f28fc082ed365cbd/ssl/ssl_lib.c/#L5134
|
d2a_code_trace_data_42988
|
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:1099: error: Uninitialized Value
The value read from ref[_] was never initialized.
libavcodec/h264.c:1099:13:
1097.
1098. fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, (uint8_t)ref[0], 1);
1099. fill_rectangle(&h->ref_cache[1][scan8[0]], 4, 4, 8, (uint8_t)ref[1], 1);
^
1100. if(!IS_INTRA(mb_type_col)
1101. && ( (l1ref0[0] == 0 && FFABS(l1mv0[0][0]) <= 1 && FFABS(l1mv0[0][1]) <= 1)
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/h264.c/#L1099
|
d2a_code_trace_data_42989
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
test/bntest.c:627: error: INTEGER_OVERFLOW_L2
([0, +oo] - 1):unsigned32 by call to `BN_GF2m_mod_div`.
Showing all 28 steps of the trace
test/bntest.c:627:13: Call
625. BN_bntest_rand(c, 512, 0, 0);
626. for (j = 0; j < 2; j++) {
627. BN_GF2m_mod_div(d, a, c, b[j], ctx);
^
628. BN_GF2m_mod_mul(e, d, c, b[j], ctx);
629. BN_GF2m_mod_div(f, a, e, b[j], ctx);
crypto/bn/bn_gf2m.c:760:1: Parameter `ctx->stack.depth`
758. * or y, x could equal y.
759. */
760. > int BN_GF2m_mod_div(BIGNUM *r, const BIGNUM *y, const BIGNUM *x,
761. const BIGNUM *p, BN_CTX *ctx)
762. {
crypto/bn/bn_gf2m.c:770:5: Call
768. bn_check_top(p);
769.
770. BN_CTX_start(ctx);
^
771. xinv = BN_CTX_get(ctx);
772. if (xinv == NULL)
crypto/bn/bn_ctx.c:181:1: Parameter `ctx->stack.depth`
179. }
180.
181. > void BN_CTX_start(BN_CTX *ctx)
182. {
183. CTXDBG_ENTRY("BN_CTX_start", ctx);
crypto/bn/bn_gf2m.c:783:5: Call
781.
782. err:
783. BN_CTX_end(ctx);
^
784. return ret;
785. }
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);
test/bntest.c:628:13: Call
626. for (j = 0; j < 2; j++) {
627. BN_GF2m_mod_div(d, a, c, b[j], ctx);
628. BN_GF2m_mod_mul(e, d, c, b[j], ctx);
^
629. BN_GF2m_mod_div(f, a, e, b[j], ctx);
630. /* Test that ((a/c)*c)/a = 1. */
crypto/bn/bn_gf2m.c:473:1: Parameter `ctx->stack.depth`
471. * BN_GF2m_mod_mul_arr function.
472. */
473. > int BN_GF2m_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
474. const BIGNUM *p, BN_CTX *ctx)
475. {
test/bntest.c:629:13: Call
627. BN_GF2m_mod_div(d, a, c, b[j], ctx);
628. BN_GF2m_mod_mul(e, d, c, b[j], ctx);
629. BN_GF2m_mod_div(f, a, e, b[j], ctx);
^
630. /* Test that ((a/c)*c)/a = 1. */
631. if (!BN_is_one(f)) {
crypto/bn/bn_gf2m.c:760:1: Parameter `ctx->stack.depth`
758. * or y, x could equal y.
759. */
760. > int BN_GF2m_mod_div(BIGNUM *r, const BIGNUM *y, const BIGNUM *x,
761. const BIGNUM *p, BN_CTX *ctx)
762. {
crypto/bn/bn_gf2m.c:770:5: Call
768. bn_check_top(p);
769.
770. BN_CTX_start(ctx);
^
771. xinv = BN_CTX_get(ctx);
772. if (xinv == NULL)
crypto/bn/bn_ctx.c:181:1: Parameter `ctx->stack.depth`
179. }
180.
181. > void BN_CTX_start(BN_CTX *ctx)
182. {
183. CTXDBG_ENTRY("BN_CTX_start", ctx);
crypto/bn/bn_gf2m.c:783:5: Call
781.
782. err:
783. BN_CTX_end(ctx);
^
784. return ret;
785. }
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);
test/bntest.c:627:13: Call
625. BN_bntest_rand(c, 512, 0, 0);
626. for (j = 0; j < 2; j++) {
627. BN_GF2m_mod_div(d, a, c, b[j], ctx);
^
628. BN_GF2m_mod_mul(e, d, c, b[j], ctx);
629. BN_GF2m_mod_div(f, a, e, b[j], ctx);
crypto/bn/bn_gf2m.c:760:1: Parameter `ctx->stack.depth`
758. * or y, x could equal y.
759. */
760. > int BN_GF2m_mod_div(BIGNUM *r, const BIGNUM *y, const BIGNUM *x,
761. const BIGNUM *p, BN_CTX *ctx)
762. {
crypto/bn/bn_gf2m.c:770:5: Call
768. bn_check_top(p);
769.
770. BN_CTX_start(ctx);
^
771. xinv = BN_CTX_get(ctx);
772. if (xinv == NULL)
crypto/bn/bn_ctx.c:181:1: Parameter `ctx->stack.depth`
179. }
180.
181. > void BN_CTX_start(BN_CTX *ctx)
182. {
183. CTXDBG_ENTRY("BN_CTX_start", ctx);
crypto/bn/bn_gf2m.c:775:10: Call
773. goto err;
774.
775. if (!BN_GF2m_mod_inv(xinv, x, p, ctx))
^
776. goto err;
777. if (!BN_GF2m_mod_mul(r, y, xinv, p, ctx))
crypto/bn/bn_gf2m.c:560:1: Parameter `ctx->stack.depth`
558. * Curve Cryptography Over Binary Fields".
559. */
560. > int BN_GF2m_mod_inv(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
561. {
562. BIGNUM *b, *c = NULL, *u = NULL, *v = NULL, *tmp;
crypto/bn/bn_gf2m.c:568:5: Call
566. bn_check_top(p);
567.
568. BN_CTX_start(ctx);
^
569.
570. if ((b = BN_CTX_get(ctx)) == NULL)
crypto/bn/bn_ctx.c:181:1: Parameter `ctx->stack.depth`
179. }
180.
181. > void BN_CTX_start(BN_CTX *ctx)
182. {
183. CTXDBG_ENTRY("BN_CTX_start", ctx);
crypto/bn/bn_gf2m.c:724:5: Call
722. bn_correct_top(v);
723. # endif
724. BN_CTX_end(ctx);
^
725. return ret;
726. }
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_GF2m_mod_div`
271. static unsigned int BN_STACK_pop(BN_STACK *st)
272. {
273. return st->indexes[--(st->depth)];
^
274. }
275.
|
https://github.com/openssl/openssl/blob/0282aeb690d63fab73a07191b63300a2fe30d212/crypto/bn/bn_ctx.c/#L273
|
d2a_code_trace_data_42990
|
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/tiff2ps.c:1506: error: Buffer Overrun L3
Offset: [7, +oo] (⇐ [0, +oo] + 7) Size: [0, +oo] by call to `TIFFReverseBits`.
tools/tiff2ps.c:1453:3: Assignment
1451.
1452. if (use_rawdata) {
1453. chunk_size = (tsize_t) bc[0];
^
1454. for (chunk_no = 1; chunk_no < num_chunks; chunk_no++)
1455. if ((tsize_t) bc[chunk_no] > chunk_size)
tools/tiff2ps.c:1463:30: Call
1461. chunk_size = TIFFStripSize(tif);
1462. }
1463. buf_data = (unsigned char *)_TIFFmalloc(chunk_size);
^
1464. if (!buf_data) {
1465. TIFFError(filename, "Can't alloc %lu bytes for %s.",
libtiff/tif_unix.c:253:1: Parameter `s`
251. #endif
252.
253. void*
^
254. _TIFFmalloc(tmsize_t s)
255. {
libtiff/tif_unix.c:256:10: Array declaration
254. _TIFFmalloc(tmsize_t s)
255. {
256. return (malloc((size_t) s));
^
257. }
258.
libtiff/tif_unix.c:256:2: Assignment
254. _TIFFmalloc(tmsize_t s)
255. {
256. return (malloc((size_t) s));
^
257. }
258.
tools/tiff2ps.c:1463:2: Assignment
1461. chunk_size = TIFFStripSize(tif);
1462. }
1463. buf_data = (unsigned char *)_TIFFmalloc(chunk_size);
^
1464. if (!buf_data) {
1465. TIFFError(filename, "Can't alloc %lu bytes for %s.",
tools/tiff2ps.c:1506:8: Call
1504. buf_data, chunk_size);
1505. if (fillorder == FILLORDER_LSB2MSB)
1506. TIFFReverseBits(buf_data, byte_count);
^
1507. } else {
1508. if (tiled_image)
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 `TIFFReverseBits`
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_42991
|
static int
TIFFWriteDirectoryTagData(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint16 datatype, uint32 count, uint32 datalength, void* data)
{
static const char module[] = "TIFFWriteDirectoryTagData";
uint32 m;
m=0;
while (m<(*ndir))
{
assert(dir[m].tdir_tag!=tag);
if (dir[m].tdir_tag>tag)
break;
m++;
}
if (m<(*ndir))
{
uint32 n;
for (n=*ndir; n>m; n--)
dir[n]=dir[n-1];
}
dir[m].tdir_tag=tag;
dir[m].tdir_type=datatype;
dir[m].tdir_count=count;
dir[m].tdir_offset.toff_long8 = 0;
if (datalength<=((tif->tif_flags&TIFF_BIGTIFF)?0x8U:0x4U))
_TIFFmemcpy(&dir[m].tdir_offset,data,datalength);
else
{
uint64 na,nb;
na=tif->tif_dataoff;
nb=na+datalength;
if (!(tif->tif_flags&TIFF_BIGTIFF))
nb=(uint32)nb;
if ((nb<na)||(nb<datalength))
{
TIFFErrorExt(tif->tif_clientdata,module,"Maximum TIFF file size exceeded");
return(0);
}
if (!SeekOK(tif,na))
{
TIFFErrorExt(tif->tif_clientdata,module,"IO error writing tag data");
return(0);
}
assert(datalength<0x80000000UL);
if (!WriteOK(tif,data,(tmsize_t)datalength))
{
TIFFErrorExt(tif->tif_clientdata,module,"IO error writing tag data");
return(0);
}
tif->tif_dataoff=nb;
if (tif->tif_dataoff&1)
tif->tif_dataoff++;
if (!(tif->tif_flags&TIFF_BIGTIFF))
{
uint32 o;
o=(uint32)na;
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong(&o);
_TIFFmemcpy(&dir[m].tdir_offset,&o,4);
}
else
{
dir[m].tdir_offset.toff_long8 = na;
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong8(&dir[m].tdir_offset.toff_long8);
}
}
(*ndir)++;
return(1);
}
libtiff/tif_dirwrite.c:600: error: Buffer Overrun L3
Offset: [0, 36] Size: [0, +oo] by call to `TIFFWriteDirectoryTagSubifd`.
libtiff/tif_dirwrite.c:400:2: Assignment
398. tif->tif_flags &= ~(TIFF_BEENWRITING|TIFF_BUFFERSETUP);
399. }
400. dir=NULL;
^
401. dirmem=NULL;
402. dirsize=0;
libtiff/tif_dirwrite.c:600:10: Call
598. if (TIFFFieldSet(tif,FIELD_SUBIFD))
599. {
600. if (!TIFFWriteDirectoryTagSubifd(tif,&ndir,dir))
^
601. goto bad;
602. }
libtiff/tif_dirwrite.c:1715:1: Parameter `*dir`
1713. }
1714.
1715. static int
^
1716. TIFFWriteDirectoryTagSubifd(TIFF* tif, uint32* ndir, TIFFDirEntry* dir)
1717. {
libtiff/tif_dirwrite.c:1749:5: Call
1747. *pb++=(uint32)(*pa++);
1748. }
1749. n=TIFFWriteDirectoryTagCheckedIfdArray(tif,ndir,dir,TIFFTAG_SUBIFD,tif->tif_dir.td_nsubifd,o);
^
1750. _TIFFfree(o);
1751. }
libtiff/tif_dirwrite.c:2149:1: Parameter `*dir`
2147. }
2148.
2149. static int
^
2150. TIFFWriteDirectoryTagCheckedIfdArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint32* value)
2151. {
libtiff/tif_dirwrite.c:2156:9: Call
2154. if (tif->tif_flags&TIFF_SWAB)
2155. TIFFSwabArrayOfLong(value,count);
2156. return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_IFD,count,count*4,value));
^
2157. }
2158.
libtiff/tif_dirwrite.c:2170:1: <Offset trace>
2168. }
2169.
2170. static int
^
2171. TIFFWriteDirectoryTagData(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint16 datatype, uint32 count, uint32 datalength, void* data)
2172. {
libtiff/tif_dirwrite.c:2170:1: Parameter `*ndir`
2168. }
2169.
2170. static int
^
2171. TIFFWriteDirectoryTagData(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint16 datatype, uint32 count, uint32 datalength, void* data)
2172. {
libtiff/tif_dirwrite.c:2170:1: <Length trace>
2168. }
2169.
2170. static int
^
2171. TIFFWriteDirectoryTagData(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint16 datatype, uint32 count, uint32 datalength, void* data)
2172. {
libtiff/tif_dirwrite.c:2170:1: Parameter `*dir`
2168. }
2169.
2170. static int
^
2171. TIFFWriteDirectoryTagData(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint16 datatype, uint32 count, uint32 datalength, void* data)
2172. {
libtiff/tif_dirwrite.c:2189:2: Array access: Offset: [0, 36] Size: [0, +oo] by call to `TIFFWriteDirectoryTagSubifd`
2187. dir[n]=dir[n-1];
2188. }
2189. dir[m].tdir_tag=tag;
^
2190. dir[m].tdir_type=datatype;
2191. dir[m].tdir_count=count;
|
https://gitlab.com/libtiff/libtiff/blob/771a4ea0a98c7a218c9f3add9a05e08d29625758/libtiff/tif_dirwrite.c/#L2189
|
d2a_code_trace_data_42992
|
static void opt_output_file(const char *filename)
{
AVFormatContext *oc;
int err, use_video, use_audio, use_subtitle, use_data;
int input_has_video, input_has_audio, input_has_subtitle, input_has_data;
AVFormatParameters params, *ap = ¶ms;
AVOutputFormat *file_oformat;
if (!strcmp(filename, "-"))
filename = "pipe:";
oc = avformat_alloc_context();
if (!oc) {
print_error(filename, AVERROR(ENOMEM));
ffmpeg_exit(1);
}
if (last_asked_format) {
file_oformat = av_guess_format(last_asked_format, NULL, NULL);
if (!file_oformat) {
fprintf(stderr, "Requested output format '%s' is not a suitable output format\n", last_asked_format);
ffmpeg_exit(1);
}
last_asked_format = NULL;
} else {
file_oformat = av_guess_format(NULL, filename, NULL);
if (!file_oformat) {
fprintf(stderr, "Unable to find a suitable output format for '%s'\n",
filename);
ffmpeg_exit(1);
}
}
oc->oformat = file_oformat;
av_strlcpy(oc->filename, filename, sizeof(oc->filename));
if (!strcmp(file_oformat->name, "ffm") &&
av_strstart(filename, "http:", NULL)) {
int err = read_ffserver_streams(oc, filename);
if (err < 0) {
print_error(filename, err);
ffmpeg_exit(1);
}
} else {
use_video = file_oformat->video_codec != CODEC_ID_NONE || video_stream_copy || video_codec_name;
use_audio = file_oformat->audio_codec != CODEC_ID_NONE || audio_stream_copy || audio_codec_name;
use_subtitle = file_oformat->subtitle_codec != CODEC_ID_NONE || subtitle_stream_copy || subtitle_codec_name;
use_data = data_stream_copy || data_codec_name;
if (nb_input_files > 0) {
check_inputs(&input_has_video,
&input_has_audio,
&input_has_subtitle,
&input_has_data);
if (!input_has_video)
use_video = 0;
if (!input_has_audio)
use_audio = 0;
if (!input_has_subtitle)
use_subtitle = 0;
if (!input_has_data)
use_data = 0;
}
if (audio_disable) use_audio = 0;
if (video_disable) use_video = 0;
if (subtitle_disable) use_subtitle = 0;
if (data_disable) use_data = 0;
if (use_video) new_video_stream(oc, nb_output_files);
if (use_audio) new_audio_stream(oc, nb_output_files);
if (use_subtitle) new_subtitle_stream(oc, nb_output_files);
if (use_data) new_data_stream(oc, nb_output_files);
oc->timestamp = recording_timestamp;
av_metadata_copy(&oc->metadata, metadata, 0);
av_metadata_free(&metadata);
}
output_files[nb_output_files++] = oc;
if (oc->oformat->flags & AVFMT_NEEDNUMBER) {
if (!av_filename_number_test(oc->filename)) {
print_error(oc->filename, AVERROR(EINVAL));
ffmpeg_exit(1);
}
}
if (!(oc->oformat->flags & AVFMT_NOFILE)) {
if (!file_overwrite &&
(strchr(filename, ':') == NULL ||
filename[1] == ':' ||
av_strstart(filename, "file:", NULL))) {
if (avio_check(filename, 0) == 0) {
if (!using_stdin) {
fprintf(stderr,"File '%s' already exists. Overwrite ? [y/N] ", filename);
fflush(stderr);
if (!read_yesno()) {
fprintf(stderr, "Not overwriting - exiting\n");
ffmpeg_exit(1);
}
}
else {
fprintf(stderr,"File '%s' already exists. Exiting.\n", filename);
ffmpeg_exit(1);
}
}
}
if ((err = avio_open(&oc->pb, filename, AVIO_FLAG_WRITE)) < 0) {
print_error(filename, err);
ffmpeg_exit(1);
}
}
memset(ap, 0, sizeof(*ap));
if (av_set_parameters(oc, ap) < 0) {
fprintf(stderr, "%s: Invalid encoding parameters\n",
oc->filename);
ffmpeg_exit(1);
}
oc->preload= (int)(mux_preload*AV_TIME_BASE);
oc->max_delay= (int)(mux_max_delay*AV_TIME_BASE);
oc->loop_output = loop_output;
oc->flags |= AVFMT_FLAG_NONBLOCK;
set_context_opts(oc, avformat_opts, AV_OPT_FLAG_ENCODING_PARAM, NULL);
av_freep(&forced_key_frames);
uninit_opts();
init_opts();
}
ffmpeg.c:3741: error: Null Dereference
pointer `file_oformat` last assigned on line 3730 could be null and is dereferenced at line 3741, column 17.
ffmpeg.c:3705:1: start of procedure opt_output_file()
3703. }
3704.
3705. static void opt_output_file(const char *filename)
^
3706. {
3707. AVFormatContext *oc;
ffmpeg.c:3710:5:
3708. int err, use_video, use_audio, use_subtitle, use_data;
3709. int input_has_video, input_has_audio, input_has_subtitle, input_has_data;
3710. AVFormatParameters params, *ap = ¶ms;
^
3711. AVOutputFormat *file_oformat;
3712.
ffmpeg.c:3713:10: Taking false branch
3711. AVOutputFormat *file_oformat;
3712.
3713. if (!strcmp(filename, "-"))
^
3714. filename = "pipe:";
3715.
ffmpeg.c:3716:5:
3714. filename = "pipe:";
3715.
3716. oc = avformat_alloc_context();
^
3717. if (!oc) {
3718. print_error(filename, AVERROR(ENOMEM));
libavformat/options.c:78:1: start of procedure avformat_alloc_context()
76. }
77.
78. AVFormatContext *avformat_alloc_context(void)
^
79. {
80. AVFormatContext *ic;
libavformat/options.c:81:5:
79. {
80. AVFormatContext *ic;
81. ic = av_malloc(sizeof(AVFormatContext));
^
82. if (!ic) return ic;
83. avformat_get_context_defaults(ic);
libavutil/mem.c:64:1: start of procedure av_malloc()
62. linker will do it automatically. */
63.
64. void *av_malloc(size_t size)
^
65. {
66. void *ptr = NULL;
libavutil/mem.c:66:5:
64. void *av_malloc(size_t size)
65. {
66. void *ptr = NULL;
^
67. #if CONFIG_MEMALIGN_HACK
68. long diff;
libavutil/mem.c:72:8: Taking false branch
70.
71. /* let's disallow possible ambiguous cases */
72. if(size > (INT_MAX-32) )
^
73. return NULL;
74.
libavutil/mem.c:83:9: Taking false branch
81. ((char*)ptr)[-1]= diff;
82. #elif HAVE_POSIX_MEMALIGN
83. if (posix_memalign(&ptr,32,size))
^
84. ptr = NULL;
85. #elif HAVE_MEMALIGN
libavutil/mem.c:114:5:
112. ptr = malloc(size);
113. #endif
114. return ptr;
^
115. }
116.
libavutil/mem.c:115:1: return from a call to av_malloc
113. #endif
114. return ptr;
115. }
^
116.
117. void *av_realloc(void *ptr, size_t size)
libavformat/options.c:82:10: Taking false branch
80. AVFormatContext *ic;
81. ic = av_malloc(sizeof(AVFormatContext));
82. if (!ic) return ic;
^
83. avformat_get_context_defaults(ic);
84. ic->av_class = &av_format_context_class;
libavformat/options.c:83:5: Skipping avformat_get_context_defaults(): empty list of specs
81. ic = av_malloc(sizeof(AVFormatContext));
82. if (!ic) return ic;
83. avformat_get_context_defaults(ic);
^
84. ic->av_class = &av_format_context_class;
85. return ic;
libavformat/options.c:84:5:
82. if (!ic) return ic;
83. avformat_get_context_defaults(ic);
84. ic->av_class = &av_format_context_class;
^
85. return ic;
86. }
libavformat/options.c:85:5:
83. avformat_get_context_defaults(ic);
84. ic->av_class = &av_format_context_class;
85. return ic;
^
86. }
libavformat/options.c:86:1: return from a call to avformat_alloc_context
84. ic->av_class = &av_format_context_class;
85. return ic;
86. }
^
ffmpeg.c:3717:10: Taking false branch
3715.
3716. oc = avformat_alloc_context();
3717. if (!oc) {
^
3718. print_error(filename, AVERROR(ENOMEM));
3719. ffmpeg_exit(1);
ffmpeg.c:3722:9: Taking false branch
3720. }
3721.
3722. if (last_asked_format) {
^
3723. file_oformat = av_guess_format(last_asked_format, NULL, NULL);
3724. if (!file_oformat) {
ffmpeg.c:3730:9: Skipping av_guess_format(): empty list of specs
3728. last_asked_format = NULL;
3729. } else {
3730. file_oformat = av_guess_format(NULL, filename, NULL);
^
3731. if (!file_oformat) {
3732. fprintf(stderr, "Unable to find a suitable output format for '%s'\n",
ffmpeg.c:3731:14: Taking true branch
3729. } else {
3730. file_oformat = av_guess_format(NULL, filename, NULL);
3731. if (!file_oformat) {
^
3732. fprintf(stderr, "Unable to find a suitable output format for '%s'\n",
3733. filename);
ffmpeg.c:3732:13:
3730. file_oformat = av_guess_format(NULL, filename, NULL);
3731. if (!file_oformat) {
3732. fprintf(stderr, "Unable to find a suitable output format for '%s'\n",
^
3733. filename);
3734. ffmpeg_exit(1);
ffmpeg.c:3734:13: Skipping ffmpeg_exit(): empty list of specs
3732. fprintf(stderr, "Unable to find a suitable output format for '%s'\n",
3733. filename);
3734. ffmpeg_exit(1);
^
3735. }
3736. }
ffmpeg.c:3738:5:
3736. }
3737.
3738. oc->oformat = file_oformat;
^
3739. av_strlcpy(oc->filename, filename, sizeof(oc->filename));
3740.
ffmpeg.c:3739:5:
3737.
3738. oc->oformat = file_oformat;
3739. av_strlcpy(oc->filename, filename, sizeof(oc->filename));
^
3740.
3741. if (!strcmp(file_oformat->name, "ffm") &&
libavutil/avstring.c:64:1: start of procedure av_strlcpy()
62. }
63.
64. size_t av_strlcpy(char *dst, const char *src, size_t size)
^
65. {
66. size_t len = 0;
libavutil/avstring.c:66:5:
64. size_t av_strlcpy(char *dst, const char *src, size_t size)
65. {
66. size_t len = 0;
^
67. while (++len < size && *src)
68. *dst++ = *src++;
libavutil/avstring.c:67:12: Loop condition is true. Entering loop body
65. {
66. size_t len = 0;
67. while (++len < size && *src)
^
68. *dst++ = *src++;
69. if (len <= size)
libavutil/avstring.c:67:28: Loop condition is false. Leaving loop
65. {
66. size_t len = 0;
67. while (++len < size && *src)
^
68. *dst++ = *src++;
69. if (len <= size)
libavutil/avstring.c:69:9: Taking true branch
67. while (++len < size && *src)
68. *dst++ = *src++;
69. if (len <= size)
^
70. *dst = 0;
71. return len + strlen(src) - 1;
libavutil/avstring.c:70:9:
68. *dst++ = *src++;
69. if (len <= size)
70. *dst = 0;
^
71. return len + strlen(src) - 1;
72. }
libavutil/avstring.c:71:5:
69. if (len <= size)
70. *dst = 0;
71. return len + strlen(src) - 1;
^
72. }
73.
libavutil/avstring.c:72:1: return from a call to av_strlcpy
70. *dst = 0;
71. return len + strlen(src) - 1;
72. }
^
73.
74. size_t av_strlcat(char *dst, const char *src, size_t size)
ffmpeg.c:3741:10:
3739. av_strlcpy(oc->filename, filename, sizeof(oc->filename));
3740.
3741. if (!strcmp(file_oformat->name, "ffm") &&
^
3742. av_strstart(filename, "http:", NULL)) {
3743. /* special case for files sent to ffserver: we get the stream
|
https://github.com/libav/libav/blob/d0005d347d0831c904630fe70408c9fd4eec18e8/ffmpeg.c/#L3741
|
d2a_code_trace_data_42993
|
static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont)
{
BIGNUM *n;
BN_ULONG *ap, *np, *rp, n0, v, carry;
int nl, max, i;
n = &(mont->N);
nl = n->top;
if (nl == 0) {
ret->top = 0;
return (1);
}
max = (2 * nl);
if (bn_wexpand(r, max) == NULL)
return (0);
r->neg ^= n->neg;
np = n->d;
rp = r->d;
i = max - r->top;
if (i)
memset(&rp[r->top], 0, sizeof(*rp) * i);
r->top = max;
n0 = mont->n0[0];
for (carry = 0, i = 0; i < nl; i++, rp++) {
v = bn_mul_add_words(rp, np, nl, (rp[0] * n0) & BN_MASK2);
v = (v + carry + rp[nl]) & BN_MASK2;
carry |= (v != rp[nl]);
carry &= (v <= rp[nl]);
rp[nl] = v;
}
if (bn_wexpand(ret, nl) == NULL)
return (0);
ret->top = nl;
ret->neg = r->neg;
rp = ret->d;
ap = &(r->d[nl]);
# define BRANCH_FREE 1
# if BRANCH_FREE
{
BN_ULONG *nrp;
size_t m;
v = bn_sub_words(rp, ap, np, nl) - carry;
m = (0 - (size_t)v);
nrp =
(BN_ULONG *)(((PTR_SIZE_INT) rp & ~m) | ((PTR_SIZE_INT) ap & m));
for (i = 0, nl -= 4; i < nl; i += 4) {
BN_ULONG t1, t2, t3, t4;
t1 = nrp[i + 0];
t2 = nrp[i + 1];
t3 = nrp[i + 2];
ap[i + 0] = 0;
t4 = nrp[i + 3];
ap[i + 1] = 0;
rp[i + 0] = t1;
ap[i + 2] = 0;
rp[i + 1] = t2;
ap[i + 3] = 0;
rp[i + 2] = t3;
rp[i + 3] = t4;
}
for (nl += 4; i < nl; i++)
rp[i] = nrp[i], ap[i] = 0;
}
# else
if (bn_sub_words(rp, ap, np, nl) - carry)
memcpy(rp, ap, nl * sizeof(BN_ULONG));
# endif
bn_correct_top(r);
bn_correct_top(ret);
bn_check_top(ret);
return (1);
}
test/bntest.c:341: error: BUFFER_OVERRUN_L3
Offset: [1, +oo] (⇐ [0, +oo] + [1, +oo]) Size: [0, 8388607] by call to `BN_mod_mul_montgomery`.
Showing all 13 steps of the trace
test/bntest.c:340:5: Call
338. "D81FDC7C54E02B60262B241D53C040E99E45826ECA37A804668E690E1AFC1CA4"
339. "2C9A15D84D4954425F0B7642FC0BD9D7B24E2618D2DCC9B729D944BADACFDDAF");
340. BN_MONT_CTX_set(mont, n, ctx);
^
341. BN_mod_mul_montgomery(c, a, b, mont, ctx);
342. BN_mod_mul_montgomery(d, b, a, mont, ctx);
crypto/bn/bn_mont.c:247:1: Parameter `mont->N.top`
245. }
246.
247. > int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
248. {
249. int ret = 0;
test/bntest.c:341:5: Call
339. "2C9A15D84D4954425F0B7642FC0BD9D7B24E2618D2DCC9B729D944BADACFDDAF");
340. BN_MONT_CTX_set(mont, n, ctx);
341. BN_mod_mul_montgomery(c, a, b, mont, ctx);
^
342. BN_mod_mul_montgomery(d, b, a, mont, ctx);
343. if (BN_cmp(c, d)) {
crypto/bn/bn_mont.c:26:1: Parameter `mont->N.top`
24. #endif
25.
26. > int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
27. BN_MONT_CTX *mont, BN_CTX *ctx)
28. {
crypto/bn/bn_mont.c:61:10: Call
59. /* reduce from aRR to aR */
60. #ifdef MONT_WORD
61. if (!BN_from_montgomery_word(r, tmp, mont))
^
62. goto err;
63. #else
crypto/bn/bn_mont.c:104:21: <Offset trace>
102. n0 = mont->n0[0];
103.
104. for (carry = 0, i = 0; i < nl; i++, rp++) {
^
105. v = bn_mul_add_words(rp, np, nl, (rp[0] * n0) & BN_MASK2);
106. v = (v + carry + rp[nl]) & BN_MASK2;
crypto/bn/bn_mont.c:104:21: Assignment
102. n0 = mont->n0[0];
103.
104. for (carry = 0, i = 0; i < nl; i++, rp++) {
^
105. v = bn_mul_add_words(rp, np, nl, (rp[0] * n0) & BN_MASK2);
106. v = (v + carry + rp[nl]) & BN_MASK2;
crypto/bn/bn_mont.c:75:1: <Length trace>
73.
74. #ifdef MONT_WORD
75. > static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont)
76. {
77. BIGNUM *n;
crypto/bn/bn_mont.c:75:1: Parameter `*r->d`
73.
74. #ifdef MONT_WORD
75. > static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont)
76. {
77. BIGNUM *n;
crypto/bn/bn_mont.c:89:9: Call
87.
88. max = (2 * nl); /* carry is stored separately */
89. if (bn_wexpand(r, max) == NULL)
^
90. return (0);
91.
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_mont.c:94:5: Assignment
92. r->neg ^= n->neg;
93. np = n->d;
94. rp = r->d;
^
95.
96. /* clear the top words of T */
crypto/bn/bn_mont.c:106:26: Array access: Offset: [1, +oo] (⇐ [0, +oo] + [1, +oo]) Size: [0, 8388607] by call to `BN_mod_mul_montgomery`
104. for (carry = 0, i = 0; i < nl; i++, rp++) {
105. v = bn_mul_add_words(rp, np, nl, (rp[0] * n0) & BN_MASK2);
106. v = (v + carry + rp[nl]) & BN_MASK2;
^
107. carry |= (v != rp[nl]);
108. carry &= (v <= rp[nl]);
|
https://github.com/openssl/openssl/blob/0282aeb690d63fab73a07191b63300a2fe30d212/crypto/bn/bn_mont.c/#L106
|
d2a_code_trace_data_42994
|
void ssl3_cbc_digest_record(const EVP_MD_CTX *ctx,
unsigned char *md_out,
size_t *md_out_size,
const unsigned char header[13],
const unsigned char *data,
size_t data_plus_mac_size,
size_t data_plus_mac_plus_padding_size,
const unsigned char *mac_secret,
unsigned mac_secret_length, char is_sslv3)
{
union {
double align;
unsigned char c[sizeof(LARGEST_DIGEST_CTX)];
} md_state;
void (*md_final_raw) (void *ctx, unsigned char *md_out);
void (*md_transform) (void *ctx, const unsigned char *block);
unsigned md_size, md_block_size = 64;
unsigned sslv3_pad_length = 40, header_length, variance_blocks,
len, max_mac_bytes, num_blocks,
num_starting_blocks, k, mac_end_offset, c, index_a, index_b;
unsigned int bits;
unsigned char length_bytes[MAX_HASH_BIT_COUNT_BYTES];
unsigned char hmac_pad[MAX_HASH_BLOCK_SIZE];
unsigned char first_block[MAX_HASH_BLOCK_SIZE];
unsigned char mac_out[EVP_MAX_MD_SIZE];
unsigned i, j, md_out_size_u;
EVP_MD_CTX md_ctx;
unsigned md_length_size = 8;
char length_is_big_endian = 1;
int ret;
OPENSSL_assert(data_plus_mac_plus_padding_size < 1024 * 1024);
switch (EVP_MD_CTX_type(ctx)) {
case NID_md5:
MD5_Init((MD5_CTX *)md_state.c);
md_final_raw = tls1_md5_final_raw;
md_transform =
(void (*)(void *ctx, const unsigned char *block))MD5_Transform;
md_size = 16;
sslv3_pad_length = 48;
length_is_big_endian = 0;
break;
case NID_sha1:
SHA1_Init((SHA_CTX *)md_state.c);
md_final_raw = tls1_sha1_final_raw;
md_transform =
(void (*)(void *ctx, const unsigned char *block))SHA1_Transform;
md_size = 20;
break;
case NID_sha224:
SHA224_Init((SHA256_CTX *)md_state.c);
md_final_raw = tls1_sha256_final_raw;
md_transform =
(void (*)(void *ctx, const unsigned char *block))SHA256_Transform;
md_size = 224 / 8;
break;
case NID_sha256:
SHA256_Init((SHA256_CTX *)md_state.c);
md_final_raw = tls1_sha256_final_raw;
md_transform =
(void (*)(void *ctx, const unsigned char *block))SHA256_Transform;
md_size = 32;
break;
case NID_sha384:
SHA384_Init((SHA512_CTX *)md_state.c);
md_final_raw = tls1_sha512_final_raw;
md_transform =
(void (*)(void *ctx, const unsigned char *block))SHA512_Transform;
md_size = 384 / 8;
md_block_size = 128;
md_length_size = 16;
break;
case NID_sha512:
SHA512_Init((SHA512_CTX *)md_state.c);
md_final_raw = tls1_sha512_final_raw;
md_transform =
(void (*)(void *ctx, const unsigned char *block))SHA512_Transform;
md_size = 64;
md_block_size = 128;
md_length_size = 16;
break;
default:
OPENSSL_assert(0);
if (md_out_size)
*md_out_size = -1;
return;
}
OPENSSL_assert(md_length_size <= MAX_HASH_BIT_COUNT_BYTES);
OPENSSL_assert(md_block_size <= MAX_HASH_BLOCK_SIZE);
OPENSSL_assert(md_size <= EVP_MAX_MD_SIZE);
header_length = 13;
if (is_sslv3) {
header_length = mac_secret_length + sslv3_pad_length + 8 +
1 +
2 ;
}
variance_blocks = is_sslv3 ? 2 : 6;
len = data_plus_mac_plus_padding_size + header_length;
max_mac_bytes = len - md_size - 1;
num_blocks =
(max_mac_bytes + 1 + md_length_size + md_block_size -
1) / md_block_size;
num_starting_blocks = 0;
k = 0;
mac_end_offset = data_plus_mac_size + header_length - md_size;
c = mac_end_offset % md_block_size;
index_a = mac_end_offset / md_block_size;
index_b = (mac_end_offset + md_length_size) / md_block_size;
if (num_blocks > variance_blocks + (is_sslv3 ? 1 : 0)) {
num_starting_blocks = num_blocks - variance_blocks;
k = md_block_size * num_starting_blocks;
}
bits = 8 * mac_end_offset;
if (!is_sslv3) {
bits += 8 * md_block_size;
memset(hmac_pad, 0, md_block_size);
OPENSSL_assert(mac_secret_length <= sizeof(hmac_pad));
memcpy(hmac_pad, mac_secret, mac_secret_length);
for (i = 0; i < md_block_size; i++)
hmac_pad[i] ^= 0x36;
md_transform(md_state.c, hmac_pad);
}
if (length_is_big_endian) {
memset(length_bytes, 0, md_length_size - 4);
length_bytes[md_length_size - 4] = (unsigned char)(bits >> 24);
length_bytes[md_length_size - 3] = (unsigned char)(bits >> 16);
length_bytes[md_length_size - 2] = (unsigned char)(bits >> 8);
length_bytes[md_length_size - 1] = (unsigned char)bits;
} else {
memset(length_bytes, 0, md_length_size);
length_bytes[md_length_size - 5] = (unsigned char)(bits >> 24);
length_bytes[md_length_size - 6] = (unsigned char)(bits >> 16);
length_bytes[md_length_size - 7] = (unsigned char)(bits >> 8);
length_bytes[md_length_size - 8] = (unsigned char)bits;
}
if (k > 0) {
if (is_sslv3) {
unsigned overhang = header_length - md_block_size;
md_transform(md_state.c, header);
memcpy(first_block, header + md_block_size, overhang);
memcpy(first_block + overhang, data, md_block_size - overhang);
md_transform(md_state.c, first_block);
for (i = 1; i < k / md_block_size - 1; i++)
md_transform(md_state.c, data + md_block_size * i - overhang);
} else {
memcpy(first_block, header, 13);
memcpy(first_block + 13, data, md_block_size - 13);
md_transform(md_state.c, first_block);
for (i = 1; i < k / md_block_size; i++)
md_transform(md_state.c, data + md_block_size * i - 13);
}
}
memset(mac_out, 0, sizeof(mac_out));
for (i = num_starting_blocks; i <= num_starting_blocks + variance_blocks;
i++) {
unsigned char block[MAX_HASH_BLOCK_SIZE];
unsigned char is_block_a = constant_time_eq_8(i, index_a);
unsigned char is_block_b = constant_time_eq_8(i, index_b);
for (j = 0; j < md_block_size; j++) {
unsigned char b = 0, is_past_c, is_past_cp1;
if (k < header_length)
b = header[k];
else if (k < data_plus_mac_plus_padding_size + header_length)
b = data[k - header_length];
k++;
is_past_c = is_block_a & constant_time_ge_8(j, c);
is_past_cp1 = is_block_a & constant_time_ge_8(j, c + 1);
b = constant_time_select_8(is_past_c, 0x80, b);
b = b & ~is_past_cp1;
b &= ~is_block_b | is_block_a;
if (j >= md_block_size - md_length_size) {
b = constant_time_select_8(is_block_b,
length_bytes[j -
(md_block_size -
md_length_size)], b);
}
block[j] = b;
}
md_transform(md_state.c, block);
md_final_raw(md_state.c, block);
for (j = 0; j < md_size; j++)
mac_out[j] |= block[j] & is_block_b;
}
EVP_MD_CTX_init(&md_ctx);
EVP_DigestInit_ex(&md_ctx, ctx->digest, NULL );
if (is_sslv3) {
memset(hmac_pad, 0x5c, sslv3_pad_length);
EVP_DigestUpdate(&md_ctx, mac_secret, mac_secret_length);
EVP_DigestUpdate(&md_ctx, hmac_pad, sslv3_pad_length);
EVP_DigestUpdate(&md_ctx, mac_out, md_size);
} else {
for (i = 0; i < md_block_size; i++)
hmac_pad[i] ^= 0x6a;
EVP_DigestUpdate(&md_ctx, hmac_pad, md_block_size);
EVP_DigestUpdate(&md_ctx, mac_out, md_size);
}
ret = EVP_DigestFinal(&md_ctx, md_out, &md_out_size_u);
if (ret && md_out_size)
*md_out_size = md_out_size_u;
EVP_MD_CTX_cleanup(&md_ctx);
}
ssl/record/ssl3_record.c:824: error: INTEGER_OVERFLOW_L2
([-51, +oo] - 1):unsigned32 by call to `ssl3_cbc_digest_record`.
Showing all 5 steps of the trace
ssl/record/ssl3_record.c:765:1: Parameter `ssl->rlayer.rrec.orig_len`
763. }
764.
765. > int n_ssl3_mac(SSL *ssl, unsigned char *md, int send)
766. {
767. SSL3_RECORD *rec;
ssl/record/ssl3_record.c:824:9: Call
822.
823. /* Final param == is SSLv3 */
824. ssl3_cbc_digest_record(hash,
^
825. md, &md_size,
826. header, rec->input,
ssl/s3_cbc.c:224:9: <LHS trace>
222. md_transform =
223. (void (*)(void *ctx, const unsigned char *block))MD5_Transform;
224. md_size = 16;
^
225. sslv3_pad_length = 48;
226. length_is_big_endian = 0;
ssl/s3_cbc.c:224:9: Assignment
222. md_transform =
223. (void (*)(void *ctx, const unsigned char *block))MD5_Transform;
224. md_size = 16;
^
225. sslv3_pad_length = 48;
226. length_is_big_endian = 0;
ssl/s3_cbc.c:315:5: Binary operation: ([-51, +oo] - 1):unsigned32 by call to `ssl3_cbc_digest_record`
313. * including * |header|, assuming that there's no padding.
314. */
315. max_mac_bytes = len - md_size - 1;
^
316. /* num_blocks is the maximum number of hash blocks. */
317. num_blocks =
|
https://github.com/openssl/openssl/blob/747e16398d704a667cc99f8a0b1912c36b7de52d/ssl/s3_cbc.c/#L315
|
d2a_code_trace_data_42995
|
static int opt_attach(OptionsContext *o, const char *opt, const char *arg)
{
o->attachments = grow_array(o->attachments, sizeof(*o->attachments),
&o->nb_attachments, o->nb_attachments + 1);
o->attachments[o->nb_attachments - 1] = arg;
return 0;
}
avconv.c:2961: error: Null Dereference
pointer `o->attachments` last assigned on line 2959 could be null and is dereferenced at line 2961, column 5.
avconv.c:2957:1: start of procedure opt_attach()
2955. }
2956.
2957. static int opt_attach(OptionsContext *o, const char *opt, const char *arg)
^
2958. {
2959. o->attachments = grow_array(o->attachments, sizeof(*o->attachments),
avconv.c:2959:5:
2957. static int opt_attach(OptionsContext *o, const char *opt, const char *arg)
2958. {
2959. o->attachments = grow_array(o->attachments, sizeof(*o->attachments),
^
2960. &o->nb_attachments, o->nb_attachments + 1);
2961. o->attachments[o->nb_attachments - 1] = arg;
cmdutils.c:1098:1: start of procedure grow_array()
1096. #endif /* CONFIG_AVFILTER */
1097.
1098. void *grow_array(void *array, int elem_size, int *size, int new_size)
^
1099. {
1100. if (new_size >= INT_MAX / elem_size) {
cmdutils.c:1100:9: Taking true branch
1098. void *grow_array(void *array, int elem_size, int *size, int new_size)
1099. {
1100. if (new_size >= INT_MAX / elem_size) {
^
1101. av_log(NULL, AV_LOG_ERROR, "Array too big.\n");
1102. exit_program(1);
cmdutils.c:1101:9: Skipping av_log(): empty list of specs
1099. {
1100. if (new_size >= INT_MAX / elem_size) {
1101. av_log(NULL, AV_LOG_ERROR, "Array too big.\n");
^
1102. exit_program(1);
1103. }
cmdutils.c:1102:9: Skipping exit_program(): empty list of specs
1100. if (new_size >= INT_MAX / elem_size) {
1101. av_log(NULL, AV_LOG_ERROR, "Array too big.\n");
1102. exit_program(1);
^
1103. }
1104. if (*size < new_size) {
cmdutils.c:1104:9: Taking true branch
1102. exit_program(1);
1103. }
1104. if (*size < new_size) {
^
1105. uint8_t *tmp = av_realloc(array, new_size*elem_size);
1106. if (!tmp) {
cmdutils.c:1105:9:
1103. }
1104. if (*size < new_size) {
1105. uint8_t *tmp = av_realloc(array, new_size*elem_size);
^
1106. if (!tmp) {
1107. av_log(NULL, AV_LOG_ERROR, "Could not alloc buffer.\n");
libavutil/mem.c:117:1: start of procedure av_realloc()
115. }
116.
117. void *av_realloc(void *ptr, size_t size)
^
118. {
119. #if CONFIG_MEMALIGN_HACK
libavutil/mem.c:124:8: Taking false branch
122.
123. /* let's disallow possible ambiguous cases */
124. if(size > (INT_MAX-16) )
^
125. return NULL;
126.
libavutil/mem.c:133:5:
131. return (char*)realloc((char*)ptr - diff, size + diff) + diff;
132. #else
133. return realloc(ptr, size);
^
134. #endif
135. }
libavutil/mem.c:135:1: return from a call to av_realloc
133. return realloc(ptr, size);
134. #endif
135. }
^
136.
137. void av_free(void *ptr)
cmdutils.c:1106:14: Taking true branch
1104. if (*size < new_size) {
1105. uint8_t *tmp = av_realloc(array, new_size*elem_size);
1106. if (!tmp) {
^
1107. av_log(NULL, AV_LOG_ERROR, "Could not alloc buffer.\n");
1108. exit_program(1);
cmdutils.c:1107:13: Skipping av_log(): empty list of specs
1105. uint8_t *tmp = av_realloc(array, new_size*elem_size);
1106. if (!tmp) {
1107. av_log(NULL, AV_LOG_ERROR, "Could not alloc buffer.\n");
^
1108. exit_program(1);
1109. }
cmdutils.c:1108:13: Skipping exit_program(): empty list of specs
1106. if (!tmp) {
1107. av_log(NULL, AV_LOG_ERROR, "Could not alloc buffer.\n");
1108. exit_program(1);
^
1109. }
1110. memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
cmdutils.c:1110:9:
1108. exit_program(1);
1109. }
1110. memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
^
1111. *size = new_size;
1112. return tmp;
cmdutils.c:1111:9:
1109. }
1110. memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
1111. *size = new_size;
^
1112. return tmp;
1113. }
cmdutils.c:1112:9:
1110. memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
1111. *size = new_size;
1112. return tmp;
^
1113. }
1114. return array;
cmdutils.c:1115:1: return from a call to grow_array
1113. }
1114. return array;
1115. }
^
avconv.c:2961:5:
2959. o->attachments = grow_array(o->attachments, sizeof(*o->attachments),
2960. &o->nb_attachments, o->nb_attachments + 1);
2961. o->attachments[o->nb_attachments - 1] = arg;
^
2962. return 0;
2963. }
|
https://github.com/libav/libav/blob/e1e369049e3d2f88eed6ed38eb3dd704681c7f1a/avconv.c/#L2961
|
d2a_code_trace_data_42996
|
static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
{
#ifdef BITSTREAM_READER_LE
uint64_t ret = bc->bits & ((UINT64_C(1) << n) - 1);
bc->bits >>= n;
#else
uint64_t ret = bc->bits >> (64 - n);
bc->bits <<= n;
#endif
bc->bits_left -= n;
return ret;
}
libavcodec/tak.c:127: error: Integer Overflow L2
([1, +oo] - 16):unsigned32 by call to `bitstream_read`.
libavcodec/tak.c:127:9: Call
125. TAKStreamInfo *ti, int log_level_offset)
126. {
127. if (bitstream_read(bc, TAK_FRAME_HEADER_SYNC_ID_BITS) != TAK_FRAME_HEADER_SYNC_ID) {
^
128. av_log(avctx, AV_LOG_ERROR + log_level_offset, "missing sync id\n");
129. return AVERROR_INVALIDDATA;
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] - 16):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_42997
|
static int kek_unwrap_key(unsigned char *out, size_t *outlen,
const unsigned char *in, size_t inlen,
EVP_CIPHER_CTX *ctx)
{
size_t blocklen = EVP_CIPHER_CTX_block_size(ctx);
unsigned char *tmp;
int outl, rv = 0;
if (inlen < 2 * blocklen) {
return 0;
}
if (inlen % blocklen) {
return 0;
}
if ((tmp = OPENSSL_malloc(inlen)) == NULL) {
CMSerr(CMS_F_KEK_UNWRAP_KEY, ERR_R_MALLOC_FAILURE);
return 0;
}
if (!EVP_DecryptUpdate(ctx, tmp + inlen - 2 * blocklen, &outl,
in + inlen - 2 * blocklen, blocklen * 2)
|| !EVP_DecryptUpdate(ctx, tmp, &outl,
tmp + inlen - blocklen, blocklen)
|| !EVP_DecryptUpdate(ctx, tmp, &outl, in, inlen - blocklen)
|| !EVP_DecryptInit_ex(ctx, NULL, NULL, NULL, NULL)
|| !EVP_DecryptUpdate(ctx, tmp, &outl, tmp, inlen))
goto err;
if (((tmp[1] ^ tmp[4]) & (tmp[2] ^ tmp[5]) & (tmp[3] ^ tmp[6])) != 0xff) {
goto err;
}
if (inlen < (size_t)(tmp[0] - 4)) {
goto err;
}
*outlen = (size_t)tmp[0];
memcpy(out, tmp + 4, *outlen);
rv = 1;
err:
OPENSSL_clear_free(tmp, inlen);
return rv;
}
crypto/cms/cms_smime.c:636: error: BUFFER_OVERRUN_L3
Offset: 6 Size: [1, +oo] by call to `CMS_RecipientInfo_decrypt`.
Showing all 13 steps of the trace
crypto/cms/cms_smime.c:633:28: Call
631. * all.
632. */
633. else if (!cert || !CMS_RecipientInfo_ktri_cert_cmp(ri, cert)) {
^
634. EVP_PKEY_up_ref(pk);
635. CMS_RecipientInfo_set0_pkey(ri, pk);
crypto/cms/cms_env.c:269:1: Parameter `ri->d.ktri->rid->d.issuerAndSerialNumber->issuer->length`
267. }
268.
269. > int CMS_RecipientInfo_ktri_cert_cmp(CMS_RecipientInfo *ri, X509 *cert)
270. {
271. if (ri->type != CMS_RECIPINFO_TRANS) {
crypto/cms/cms_smime.c:636:17: Call
634. EVP_PKEY_up_ref(pk);
635. CMS_RecipientInfo_set0_pkey(ri, pk);
636. r = CMS_RecipientInfo_decrypt(cms, ri);
^
637. CMS_RecipientInfo_set0_pkey(ri, NULL);
638. if (cert) {
crypto/cms/cms_env.c:739:1: Parameter `ri->d.pwri->encryptedKey->length`
737. }
738.
739. > int CMS_RecipientInfo_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri)
740. {
741. switch (ri->type) {
crypto/cms/cms_env.c:749:16: Call
747.
748. case CMS_RECIPINFO_PASS:
749. return cms_RecipientInfo_pwri_crypt(cms, ri, 0);
^
750.
751. default:
crypto/cms/cms_pwri.c:276:1: Parameter `ri->d.pwri->encryptedKey->length`
274. /* Encrypt/Decrypt content key in PWRI recipient info */
275.
276. > int cms_RecipientInfo_pwri_crypt(const CMS_ContentInfo *cms, CMS_RecipientInfo *ri,
277. int en_de)
278. {
crypto/cms/cms_pwri.c:369:14: Call
367. goto err;
368. }
369. if (!kek_unwrap_key(key, &keylen,
^
370. pwri->encryptedKey->data,
371. pwri->encryptedKey->length, kekctx)) {
crypto/cms/cms_pwri.c:176:1: <Length trace>
174. */
175.
176. > static int kek_unwrap_key(unsigned char *out, size_t *outlen,
177. const unsigned char *in, size_t inlen,
178. EVP_CIPHER_CTX *ctx)
crypto/cms/cms_pwri.c:176:1: Parameter `inlen`
174. */
175.
176. > static int kek_unwrap_key(unsigned char *out, size_t *outlen,
177. const unsigned char *in, size_t inlen,
178. EVP_CIPHER_CTX *ctx)
crypto/cms/cms_pwri.c:191:16: Call
189. return 0;
190. }
191. if ((tmp = OPENSSL_malloc(inlen)) == NULL) {
^
192. CMSerr(CMS_F_KEK_UNWRAP_KEY, ERR_R_MALLOC_FAILURE);
193. return 0;
crypto/mem.c:201:9: Assignment
199.
200. if (num == 0)
201. return NULL;
^
202.
203. FAILTEST();
crypto/cms/cms_pwri.c:191:10: Assignment
189. return 0;
190. }
191. if ((tmp = OPENSSL_malloc(inlen)) == NULL) {
^
192. CMSerr(CMS_F_KEK_UNWRAP_KEY, ERR_R_MALLOC_FAILURE);
193. return 0;
crypto/cms/cms_pwri.c:214:60: Array access: Offset: 6 Size: [1, +oo] by call to `CMS_RecipientInfo_decrypt`
212. goto err;
213. /* Check check bytes */
214. if (((tmp[1] ^ tmp[4]) & (tmp[2] ^ tmp[5]) & (tmp[3] ^ tmp[6])) != 0xff) {
^
215. /* Check byte failure */
216. goto err;
|
https://github.com/openssl/openssl/blob/bcf082d130a413a728a382bd6e6bfdbf2cedba45/crypto/cms/cms_pwri.c/#L214
|
d2a_code_trace_data_42998
|
static void new_subtitle_stream(AVFormatContext *oc, int file_idx)
{
AVStream *st;
AVOutputStream *ost;
AVCodec *codec=NULL;
AVCodecContext *subtitle_enc;
enum CodecID codec_id = CODEC_ID_NONE;
st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0);
if (!st) {
fprintf(stderr, "Could not alloc stream\n");
ffmpeg_exit(1);
}
ost = new_output_stream(oc, file_idx);
subtitle_enc = st->codec;
output_codecs = grow_array(output_codecs, sizeof(*output_codecs), &nb_output_codecs, nb_output_codecs + 1);
if(!subtitle_stream_copy){
if (subtitle_codec_name) {
codec_id = find_codec_or_die(subtitle_codec_name, AVMEDIA_TYPE_SUBTITLE, 1,
avcodec_opts[AVMEDIA_TYPE_SUBTITLE]->strict_std_compliance);
codec= output_codecs[nb_output_codecs-1] = avcodec_find_encoder_by_name(subtitle_codec_name);
} else {
codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, AVMEDIA_TYPE_SUBTITLE);
codec = avcodec_find_encoder(codec_id);
}
}
avcodec_get_context_defaults3(st->codec, codec);
ost->bitstream_filters = subtitle_bitstream_filters;
subtitle_bitstream_filters= NULL;
subtitle_enc->codec_type = AVMEDIA_TYPE_SUBTITLE;
if(subtitle_codec_tag)
subtitle_enc->codec_tag= subtitle_codec_tag;
if (oc->oformat->flags & AVFMT_GLOBALHEADER) {
subtitle_enc->flags |= CODEC_FLAG_GLOBAL_HEADER;
avcodec_opts[AVMEDIA_TYPE_SUBTITLE]->flags |= CODEC_FLAG_GLOBAL_HEADER;
}
if (subtitle_stream_copy) {
st->stream_copy = 1;
} else {
subtitle_enc->codec_id = codec_id;
set_context_opts(avcodec_opts[AVMEDIA_TYPE_SUBTITLE], subtitle_enc, AV_OPT_FLAG_SUBTITLE_PARAM | AV_OPT_FLAG_ENCODING_PARAM, codec);
}
if (subtitle_language) {
av_metadata_set2(&st->metadata, "language", subtitle_language, 0);
av_freep(&subtitle_language);
}
subtitle_disable = 0;
av_freep(&subtitle_codec_name);
subtitle_stream_copy = 0;
}
ffmpeg.c:3690: error: Null Dereference
pointer `st` last assigned on line 3684 could be null and is dereferenced at line 3690, column 20.
ffmpeg.c:3676:1: start of procedure new_subtitle_stream()
3674. }
3675.
3676. static void new_subtitle_stream(AVFormatContext *oc, int file_idx)
^
3677. {
3678. AVStream *st;
ffmpeg.c:3680:5:
3678. AVStream *st;
3679. AVOutputStream *ost;
3680. AVCodec *codec=NULL;
^
3681. AVCodecContext *subtitle_enc;
3682. enum CodecID codec_id = CODEC_ID_NONE;
ffmpeg.c:3682:5:
3680. AVCodec *codec=NULL;
3681. AVCodecContext *subtitle_enc;
3682. enum CodecID codec_id = CODEC_ID_NONE;
^
3683.
3684. st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0);
ffmpeg.c:3684:28: Condition is true
3682. enum CodecID codec_id = CODEC_ID_NONE;
3683.
3684. st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0);
^
3685. if (!st) {
3686. fprintf(stderr, "Could not alloc stream\n");
ffmpeg.c:3684:5:
3682. enum CodecID codec_id = CODEC_ID_NONE;
3683.
3684. st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0);
^
3685. if (!st) {
3686. fprintf(stderr, "Could not alloc stream\n");
libavformat/utils.c:2588:1: start of procedure av_new_stream()
2586. }
2587.
2588. AVStream *av_new_stream(AVFormatContext *s, int id)
^
2589. {
2590. AVStream *st;
libavformat/utils.c:2594:9: Taking true branch
2592. AVStream **streams;
2593.
2594. if (s->nb_streams >= INT_MAX/sizeof(*streams))
^
2595. return NULL;
2596. streams = av_realloc(s->streams, (s->nb_streams + 1) * sizeof(*streams));
libavformat/utils.c:2595:9:
2593.
2594. if (s->nb_streams >= INT_MAX/sizeof(*streams))
2595. return NULL;
^
2596. streams = av_realloc(s->streams, (s->nb_streams + 1) * sizeof(*streams));
2597. if (!streams)
libavformat/utils.c:2637:1: return from a call to av_new_stream
2635. s->streams[s->nb_streams++] = st;
2636. return st;
2637. }
^
2638.
2639. AVProgram *av_new_program(AVFormatContext *ac, int id)
ffmpeg.c:3685:10: Taking true branch
3683.
3684. st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0);
3685. if (!st) {
^
3686. fprintf(stderr, "Could not alloc stream\n");
3687. ffmpeg_exit(1);
ffmpeg.c:3686:9:
3684. st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0);
3685. if (!st) {
3686. fprintf(stderr, "Could not alloc stream\n");
^
3687. ffmpeg_exit(1);
3688. }
ffmpeg.c:3687:9: Skipping ffmpeg_exit(): empty list of specs
3685. if (!st) {
3686. fprintf(stderr, "Could not alloc stream\n");
3687. ffmpeg_exit(1);
^
3688. }
3689. ost = new_output_stream(oc, file_idx);
ffmpeg.c:3689:5: Skipping new_output_stream(): empty list of specs
3687. ffmpeg_exit(1);
3688. }
3689. ost = new_output_stream(oc, file_idx);
^
3690. subtitle_enc = st->codec;
3691. output_codecs = grow_array(output_codecs, sizeof(*output_codecs), &nb_output_codecs, nb_output_codecs + 1);
ffmpeg.c:3690:5:
3688. }
3689. ost = new_output_stream(oc, file_idx);
3690. subtitle_enc = st->codec;
^
3691. output_codecs = grow_array(output_codecs, sizeof(*output_codecs), &nb_output_codecs, nb_output_codecs + 1);
3692. if(!subtitle_stream_copy){
|
https://github.com/libav/libav/blob/41e21e4db623ebd77f431a6f30cf21d62d9e1f33/ffmpeg.c/#L3690
|
d2a_code_trace_data_42999
|
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:592: error: UNINITIALIZED_VALUE
The value read from client_ex_data.alert_received was never initialized.
Showing all 1 steps of the trace
test/handshake_helper.c:592:5:
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;
594. ret->client_alert_received = server_ex_data.alert_received;
|
https://github.com/openssl/openssl/blob/70c22888c1648fe8652e77107f3c74bf2212de36/test/handshake_helper.c/#L592
|
d2a_code_trace_data_43000
|
MSG_PROCESS_RETURN tls_process_cert_verify(SSL *s, PACKET *pkt)
{
EVP_PKEY *pkey = NULL;
const unsigned char *data;
#ifndef OPENSSL_NO_GOST
unsigned char *gost_data = NULL;
#endif
int al = SSL_AD_INTERNAL_ERROR;
MSG_PROCESS_RETURN ret = MSG_PROCESS_ERROR;
int j;
unsigned int len;
X509 *peer;
const EVP_MD *md = NULL;
size_t hdatalen = 0;
void *hdata;
unsigned char tls13tbs[TLS13_TBS_PREAMBLE_SIZE + EVP_MAX_MD_SIZE];
EVP_MD_CTX *mctx = EVP_MD_CTX_new();
EVP_PKEY_CTX *pctx = NULL;
if (mctx == NULL) {
SSLerr(SSL_F_TLS_PROCESS_CERT_VERIFY, ERR_R_MALLOC_FAILURE);
goto f_err;
}
peer = s->session->peer;
pkey = X509_get0_pubkey(peer);
if (pkey == NULL)
goto f_err;
if (ssl_cert_lookup_by_pkey(pkey, NULL) == NULL) {
SSLerr(SSL_F_TLS_PROCESS_CERT_VERIFY,
SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE);
al = SSL_AD_ILLEGAL_PARAMETER;
goto f_err;
}
if (SSL_USE_SIGALGS(s)) {
int rv;
unsigned int sigalg;
if (!PACKET_get_net_2(pkt, &sigalg)) {
al = SSL_AD_DECODE_ERROR;
goto f_err;
}
rv = tls12_check_peer_sigalg(s, sigalg, pkey);
if (rv == -1) {
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 if (!tls1_set_peer_legacy_sigalg(s, pkey)) {
al = SSL_AD_INTERNAL_ERROR;
goto f_err;
}
if (!tls1_lookup_md(s->s3->tmp.peer_sigalg, &md)) {
SSLerr(SSL_F_TLS_PROCESS_CERT_VERIFY, ERR_R_INTERNAL_ERROR);
al = SSL_AD_INTERNAL_ERROR;
goto f_err;
}
#ifndef OPENSSL_NO_GOST
if (!SSL_USE_SIGALGS(s)
&& ((PACKET_remaining(pkt) == 64
&& (EVP_PKEY_id(pkey) == NID_id_GostR3410_2001
|| EVP_PKEY_id(pkey) == NID_id_GostR3410_2012_256))
|| (PACKET_remaining(pkt) == 128
&& EVP_PKEY_id(pkey) == NID_id_GostR3410_2012_512))) {
len = PACKET_remaining(pkt);
} else
#endif
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;
}
if (!get_cert_verify_tbs_data(s, tls13tbs, &hdata, &hdatalen)) {
SSLerr(SSL_F_TLS_PROCESS_CERT_VERIFY, ERR_R_INTERNAL_ERROR);
goto f_err;
}
#ifdef SSL_DEBUG
fprintf(stderr, "Using client verify alg %s\n", EVP_MD_name(md));
#endif
if (EVP_DigestVerifyInit(mctx, &pctx, md, NULL, pkey) <= 0) {
SSLerr(SSL_F_TLS_PROCESS_CERT_VERIFY, ERR_R_EVP_LIB);
goto f_err;
}
#ifndef OPENSSL_NO_GOST
{
int pktype = EVP_PKEY_id(pkey);
if (pktype == NID_id_GostR3410_2001
|| pktype == NID_id_GostR3410_2012_256
|| pktype == NID_id_GostR3410_2012_512) {
if ((gost_data = OPENSSL_malloc(len)) == NULL) {
SSLerr(SSL_F_TLS_PROCESS_CERT_VERIFY, ERR_R_MALLOC_FAILURE);
goto f_err;
}
BUF_reverse(gost_data, data, len);
data = gost_data;
}
}
#endif
if (SSL_USE_PSS(s)) {
if (EVP_PKEY_CTX_set_rsa_padding(pctx, RSA_PKCS1_PSS_PADDING) <= 0
|| EVP_PKEY_CTX_set_rsa_pss_saltlen(pctx,
RSA_PSS_SALTLEN_DIGEST) <= 0) {
SSLerr(SSL_F_TLS_PROCESS_CERT_VERIFY, ERR_R_EVP_LIB);
goto f_err;
}
}
if (s->version == SSL3_VERSION) {
if (EVP_DigestVerifyUpdate(mctx, hdata, hdatalen) <= 0
|| !EVP_MD_CTX_ctrl(mctx, EVP_CTRL_SSL3_MASTER_SECRET,
(int)s->session->master_key_length,
s->session->master_key)) {
SSLerr(SSL_F_TLS_PROCESS_CERT_VERIFY, ERR_R_EVP_LIB);
goto f_err;
}
if (EVP_DigestVerifyFinal(mctx, data, len) <= 0) {
al = SSL_AD_DECRYPT_ERROR;
SSLerr(SSL_F_TLS_PROCESS_CERT_VERIFY, SSL_R_BAD_SIGNATURE);
goto f_err;
}
} else {
j = EVP_DigestVerify(mctx, data, len, hdata, hdatalen);
if (j <= 0) {
al = SSL_AD_DECRYPT_ERROR;
SSLerr(SSL_F_TLS_PROCESS_CERT_VERIFY, SSL_R_BAD_SIGNATURE);
goto f_err;
}
}
ret = MSG_PROCESS_CONTINUE_READING;
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);
#ifndef OPENSSL_NO_GOST
OPENSSL_free(gost_data);
#endif
return ret;
}
ssl/statem/statem_lib.c:477: error: MEMORY_LEAK
memory dynamically allocated by call to `EVP_MD_CTX_new()` at line 328, column 24 is not reachable after line 477, column 5.
Showing all 70 steps of the trace
ssl/statem/statem_lib.c:312:1: start of procedure tls_process_cert_verify()
310. }
311.
312. > MSG_PROCESS_RETURN tls_process_cert_verify(SSL *s, PACKET *pkt)
313. {
314. EVP_PKEY *pkey = NULL;
ssl/statem/statem_lib.c:314:5:
312. MSG_PROCESS_RETURN tls_process_cert_verify(SSL *s, PACKET *pkt)
313. {
314. > EVP_PKEY *pkey = NULL;
315. const unsigned char *data;
316. #ifndef OPENSSL_NO_GOST
ssl/statem/statem_lib.c:317:5:
315. const unsigned char *data;
316. #ifndef OPENSSL_NO_GOST
317. > unsigned char *gost_data = NULL;
318. #endif
319. int al = SSL_AD_INTERNAL_ERROR;
ssl/statem/statem_lib.c:319:5:
317. unsigned char *gost_data = NULL;
318. #endif
319. > int al = SSL_AD_INTERNAL_ERROR;
320. MSG_PROCESS_RETURN ret = MSG_PROCESS_ERROR;
321. int j;
ssl/statem/statem_lib.c:320:5:
318. #endif
319. int al = SSL_AD_INTERNAL_ERROR;
320. > MSG_PROCESS_RETURN ret = MSG_PROCESS_ERROR;
321. int j;
322. unsigned int len;
ssl/statem/statem_lib.c:324:5:
322. unsigned int len;
323. X509 *peer;
324. > const EVP_MD *md = NULL;
325. size_t hdatalen = 0;
326. void *hdata;
ssl/statem/statem_lib.c:325:5:
323. X509 *peer;
324. const EVP_MD *md = NULL;
325. > size_t hdatalen = 0;
326. void *hdata;
327. unsigned char tls13tbs[TLS13_TBS_PREAMBLE_SIZE + EVP_MAX_MD_SIZE];
ssl/statem/statem_lib.c:328:5:
326. void *hdata;
327. unsigned char tls13tbs[TLS13_TBS_PREAMBLE_SIZE + EVP_MAX_MD_SIZE];
328. > EVP_MD_CTX *mctx = EVP_MD_CTX_new();
329. EVP_PKEY_CTX *pctx = NULL;
330.
crypto/evp/digest.c:44:1: start of procedure EVP_MD_CTX_new()
42. }
43.
44. > EVP_MD_CTX *EVP_MD_CTX_new(void)
45. {
46. return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
crypto/evp/digest.c:46:5:
44. EVP_MD_CTX *EVP_MD_CTX_new(void)
45. {
46. > return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
47. }
48.
crypto/mem.c: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 true branch
201.
202. FAILTEST();
203. if (ret != NULL)
^
204. memset(ret, 0, num);
205. return ret;
crypto/mem.c:204:9:
202. FAILTEST();
203. if (ret != NULL)
204. > memset(ret, 0, num);
205. return ret;
206. }
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/evp/digest.c:47:1: return from a call to EVP_MD_CTX_new
45. {
46. return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
47. > }
48.
49. void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
ssl/statem/statem_lib.c:329:5:
327. unsigned char tls13tbs[TLS13_TBS_PREAMBLE_SIZE + EVP_MAX_MD_SIZE];
328. EVP_MD_CTX *mctx = EVP_MD_CTX_new();
329. > EVP_PKEY_CTX *pctx = NULL;
330.
331. if (mctx == NULL) {
ssl/statem/statem_lib.c:331:9: Taking false branch
329. EVP_PKEY_CTX *pctx = NULL;
330.
331. if (mctx == NULL) {
^
332. SSLerr(SSL_F_TLS_PROCESS_CERT_VERIFY, ERR_R_MALLOC_FAILURE);
333. goto f_err;
ssl/statem/statem_lib.c:336:5:
334. }
335.
336. > peer = s->session->peer;
337. pkey = X509_get0_pubkey(peer);
338. if (pkey == NULL)
ssl/statem/statem_lib.c:337:5:
335.
336. peer = s->session->peer;
337. > pkey = X509_get0_pubkey(peer);
338. if (pkey == NULL)
339. goto f_err;
crypto/x509/x509_cmp.c:264:1: start of procedure X509_get0_pubkey()
262. }
263.
264. > EVP_PKEY *X509_get0_pubkey(const X509 *x)
265. {
266. if (x == NULL)
crypto/x509/x509_cmp.c:266:9: Taking false branch
264. EVP_PKEY *X509_get0_pubkey(const X509 *x)
265. {
266. if (x == NULL)
^
267. return NULL;
268. return X509_PUBKEY_get0(x->cert_info.key);
crypto/x509/x509_cmp.c:268:5:
266. if (x == NULL)
267. return NULL;
268. > return X509_PUBKEY_get0(x->cert_info.key);
269. }
270.
crypto/x509/x_pubkey.c:140:1: start of procedure X509_PUBKEY_get0()
138. }
139.
140. > EVP_PKEY *X509_PUBKEY_get0(X509_PUBKEY *key)
141. {
142. EVP_PKEY *ret = NULL;
crypto/x509/x_pubkey.c:142:5:
140. EVP_PKEY *X509_PUBKEY_get0(X509_PUBKEY *key)
141. {
142. > EVP_PKEY *ret = NULL;
143.
144. if (key == NULL || key->public_key == NULL)
crypto/x509/x_pubkey.c:144:9: Taking false branch
142. EVP_PKEY *ret = NULL;
143.
144. if (key == NULL || key->public_key == NULL)
^
145. return NULL;
146.
crypto/x509/x_pubkey.c:144:24: Taking false branch
142. EVP_PKEY *ret = NULL;
143.
144. if (key == NULL || key->public_key == NULL)
^
145. return NULL;
146.
crypto/x509/x_pubkey.c:147:9: Taking false branch
145. return NULL;
146.
147. if (key->pkey != NULL)
^
148. return key->pkey;
149.
crypto/x509/x_pubkey.c:158:5:
156. * in the queue.
157. */
158. > x509_pubkey_decode(&ret, key);
159. /* If decode doesn't fail something bad happened */
160. if (ret != NULL) {
crypto/x509/x_pubkey.c:103:1: start of procedure x509_pubkey_decode()
101.
102.
103. > static int x509_pubkey_decode(EVP_PKEY **ppkey, X509_PUBKEY *key)
104. {
105. EVP_PKEY *pkey = EVP_PKEY_new();
crypto/x509/x_pubkey.c:105:5: Skipping EVP_PKEY_new(): empty list of specs
103. static int x509_pubkey_decode(EVP_PKEY **ppkey, X509_PUBKEY *key)
104. {
105. EVP_PKEY *pkey = EVP_PKEY_new();
^
106.
107. if (pkey == NULL) {
crypto/x509/x_pubkey.c:107:9: Taking true branch
105. EVP_PKEY *pkey = EVP_PKEY_new();
106.
107. if (pkey == NULL) {
^
108. X509err(X509_F_X509_PUBKEY_DECODE, ERR_R_MALLOC_FAILURE);
109. return -1;
crypto/x509/x_pubkey.c:108:9: Skipping ERR_put_error(): empty list of specs
106.
107. if (pkey == NULL) {
108. X509err(X509_F_X509_PUBKEY_DECODE, ERR_R_MALLOC_FAILURE);
^
109. return -1;
110. }
crypto/x509/x_pubkey.c:109:9:
107. if (pkey == NULL) {
108. X509err(X509_F_X509_PUBKEY_DECODE, ERR_R_MALLOC_FAILURE);
109. > return -1;
110. }
111.
crypto/x509/x_pubkey.c:138:1: return from a call to x509_pubkey_decode
136. EVP_PKEY_free(pkey);
137. return 0;
138. > }
139.
140. EVP_PKEY *X509_PUBKEY_get0(X509_PUBKEY *key)
crypto/x509/x_pubkey.c:160:9: Taking false branch
158. x509_pubkey_decode(&ret, key);
159. /* If decode doesn't fail something bad happened */
160. if (ret != NULL) {
^
161. X509err(X509_F_X509_PUBKEY_GET0, ERR_R_INTERNAL_ERROR);
162. EVP_PKEY_free(ret);
crypto/x509/x_pubkey.c:165:5:
163. }
164.
165. > return NULL;
166. }
167.
crypto/x509/x_pubkey.c:166:1: return from a call to X509_PUBKEY_get0
164.
165. return NULL;
166. > }
167.
168. EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key)
crypto/x509/x509_cmp.c:269:1: return from a call to X509_get0_pubkey
267. return NULL;
268. return X509_PUBKEY_get0(x->cert_info.key);
269. > }
270.
271. EVP_PKEY *X509_get_pubkey(X509 *x)
ssl/statem/statem_lib.c:338:9: Taking true branch
336. peer = s->session->peer;
337. pkey = X509_get0_pubkey(peer);
338. if (pkey == NULL)
^
339. goto f_err;
340.
ssl/statem/statem_lib.c:471:2:
469. ret = MSG_PROCESS_CONTINUE_READING;
470. if (0) {
471. > f_err:
472. ssl3_send_alert(s, SSL3_AL_FATAL, al);
473. ossl_statem_set_error(s);
ssl/statem/statem_lib.c:472:9: Skipping ssl3_send_alert(): empty list of specs
470. if (0) {
471. f_err:
472. ssl3_send_alert(s, SSL3_AL_FATAL, al);
^
473. ossl_statem_set_error(s);
474. }
ssl/statem/statem_lib.c:473:9:
471. f_err:
472. ssl3_send_alert(s, SSL3_AL_FATAL, al);
473. > ossl_statem_set_error(s);
474. }
475. BIO_free(s->s3->handshake_buffer);
ssl/statem/statem.c:117:1: start of procedure ossl_statem_set_error()
115. * the current connection.
116. */
117. > void ossl_statem_set_error(SSL *s)
118. {
119. s->statem.state = MSG_FLOW_ERROR;
ssl/statem/statem.c:119:5:
117. void ossl_statem_set_error(SSL *s)
118. {
119. > s->statem.state = MSG_FLOW_ERROR;
120. }
121.
ssl/statem/statem.c:120:1: return from a call to ossl_statem_set_error
118. {
119. s->statem.state = MSG_FLOW_ERROR;
120. > }
121.
122. /*
ssl/statem/statem_lib.c:475:5: Skipping BIO_free(): empty list of specs
473. ossl_statem_set_error(s);
474. }
475. BIO_free(s->s3->handshake_buffer);
^
476. s->s3->handshake_buffer = NULL;
477. EVP_MD_CTX_free(mctx);
ssl/statem/statem_lib.c:476:5:
474. }
475. BIO_free(s->s3->handshake_buffer);
476. > s->s3->handshake_buffer = NULL;
477. EVP_MD_CTX_free(mctx);
478. #ifndef OPENSSL_NO_GOST
ssl/statem/statem_lib.c:477:5:
475. BIO_free(s->s3->handshake_buffer);
476. s->s3->handshake_buffer = NULL;
477. > EVP_MD_CTX_free(mctx);
478. #ifndef OPENSSL_NO_GOST
479. OPENSSL_free(gost_data);
crypto/evp/digest.c:49:1: start of procedure EVP_MD_CTX_free()
47. }
48.
49. > void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
50. {
51. EVP_MD_CTX_reset(ctx);
crypto/evp/digest.c:51:5: Skipping EVP_MD_CTX_reset(): empty list of specs
49. void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
50. {
51. EVP_MD_CTX_reset(ctx);
^
52. OPENSSL_free(ctx);
53. }
crypto/evp/digest.c:52:5:
50. {
51. EVP_MD_CTX_reset(ctx);
52. > OPENSSL_free(ctx);
53. }
54.
crypto/mem.c:265:1: start of procedure CRYPTO_free()
263. }
264.
265. > void CRYPTO_free(void *str, const char *file, int line)
266. {
267. if (free_impl != NULL && free_impl != &CRYPTO_free) {
crypto/mem.c:267:9: Taking true branch
265. void CRYPTO_free(void *str, const char *file, int line)
266. {
267. if (free_impl != NULL && free_impl != &CRYPTO_free) {
^
268. free_impl(str, file, line);
269. return;
crypto/mem.c:267:30: Taking true branch
265. void CRYPTO_free(void *str, const char *file, int line)
266. {
267. if (free_impl != NULL && free_impl != &CRYPTO_free) {
^
268. free_impl(str, file, line);
269. return;
crypto/mem.c:268:9: Skipping __function_pointer__(): unresolved function pointer
266. {
267. if (free_impl != NULL && free_impl != &CRYPTO_free) {
268. free_impl(str, file, line);
^
269. return;
270. }
crypto/mem.c:269:9:
267. if (free_impl != NULL && free_impl != &CRYPTO_free) {
268. free_impl(str, file, line);
269. > return;
270. }
271.
crypto/mem.c:283:1: return from a call to CRYPTO_free
281. free(str);
282. #endif
283. > }
284.
285. void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)
crypto/evp/digest.c:53:1: return from a call to EVP_MD_CTX_free
51. EVP_MD_CTX_reset(ctx);
52. OPENSSL_free(ctx);
53. > }
54.
55. int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type)
|
https://github.com/openssl/openssl/blob/89bc9cf682e833d44fe135c901fe75f600d871ef/ssl/statem/statem_lib.c/#L477
|
d2a_code_trace_data_43001
|
static ossl_inline void packet_forward(PACKET *pkt, size_t len)
{
pkt->curr += len;
pkt->remaining -= len;
}
test/sslapitest.c:3125: error: INTEGER_OVERFLOW_L2
([0, 9223372036854775807] - 5):unsigned64 by call to `PACKET_forward`.
Showing all 11 steps of the trace
test/sslapitest.c:3117:19: Assignment
3115. long len;
3116. unsigned char *data;
3117. PACKET pkt = {0}, pkt2 = {0}, pkt3 = {0};
^
3118. unsigned int MFL_code = 0, type = 0;
3119.
test/sslapitest.c:3123:10: Call
3121. goto end;
3122.
3123. if (!TEST_true( PACKET_buf_init( &pkt, data, len ) )
^
3124. /* Skip the record header */
3125. || !PACKET_forward(&pkt, SSL3_RT_HEADER_LENGTH)
ssl/packet_locl.h:72:8: Parameter `pkt->remaining`
70. * is being used.
71. */
72. __owur static ossl_inline int PACKET_buf_init(PACKET *pkt,
^
73. const unsigned char *buf,
74. size_t len)
test/sslapitest.c:3125:17: Call
3123. if (!TEST_true( PACKET_buf_init( &pkt, data, len ) )
3124. /* Skip the record header */
3125. || !PACKET_forward(&pkt, SSL3_RT_HEADER_LENGTH)
^
3126. /* Skip the handshake message header */
3127. || !TEST_true(PACKET_forward(&pkt, SSL3_HM_HEADER_LENGTH))
ssl/packet_locl.h:467:8: Parameter `len`
465.
466. /* Move the current reading position forward |len| bytes */
467. __owur static ossl_inline int PACKET_forward(PACKET *pkt, size_t len)
^
468. {
469. if (PACKET_remaining(pkt) < len)
ssl/packet_locl.h:472:5: Call
470. return 0;
471.
472. packet_forward(pkt, len);
^
473.
474. return 1;
ssl/packet_locl.h:33:1: <LHS trace>
31.
32. /* Internal unchecked shorthand; don't use outside this file. */
33. > static ossl_inline void packet_forward(PACKET *pkt, size_t len)
34. {
35. pkt->curr += len;
ssl/packet_locl.h:33:1: Parameter `pkt->remaining`
31.
32. /* Internal unchecked shorthand; don't use outside this file. */
33. > static ossl_inline void packet_forward(PACKET *pkt, size_t len)
34. {
35. pkt->curr += len;
ssl/packet_locl.h:33:1: <RHS trace>
31.
32. /* Internal unchecked shorthand; don't use outside this file. */
33. > static ossl_inline void packet_forward(PACKET *pkt, size_t len)
34. {
35. pkt->curr += len;
ssl/packet_locl.h:33:1: Parameter `len`
31.
32. /* Internal unchecked shorthand; don't use outside this file. */
33. > static ossl_inline void packet_forward(PACKET *pkt, size_t len)
34. {
35. pkt->curr += len;
ssl/packet_locl.h:36:5: Binary operation: ([0, 9223372036854775807] - 5):unsigned64 by call to `PACKET_forward`
34. {
35. pkt->curr += len;
36. pkt->remaining -= len;
^
37. }
38.
|
https://github.com/openssl/openssl/blob/9f5671c7e9f30dfa53b1a2b553f234c2761ceb66/ssl/packet_locl.h/#L36
|
d2a_code_trace_data_43002
|
tsize_t t2p_write_pdf(T2P* t2p, TIFF* input, TIFF* output){
tsize_t written=0;
ttile_t i2=0;
tsize_t streamlen=0;
uint16 i=0;
t2p_read_tiff_init(t2p, input);
if(t2p->t2p_error!=T2P_ERR_OK){return(0);}
t2p->pdf_xrefoffsets= (uint32*) _TIFFmalloc(t2p->pdf_xrefcount * sizeof(uint32) );
if(t2p->pdf_xrefoffsets==NULL){
TIFFError(
TIFF2PDF_MODULE,
"Can't allocate %u bytes of memory for t2p_write_pdf",
(unsigned int) (t2p->pdf_xrefcount * sizeof(uint32)) );
return(written);
}
t2p->pdf_xrefcount=0;
t2p->pdf_catalog=1;
t2p->pdf_info=2;
t2p->pdf_pages=3;
written += t2p_write_pdf_header(t2p, output);
t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
t2p->pdf_catalog=t2p->pdf_xrefcount;
written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
written += t2p_write_pdf_catalog(t2p, output);
written += t2p_write_pdf_obj_end(output);
t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
t2p->pdf_info=t2p->pdf_xrefcount;
written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
written += t2p_write_pdf_info(t2p, input, output);
written += t2p_write_pdf_obj_end(output);
t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
t2p->pdf_pages=t2p->pdf_xrefcount;
written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
written += t2p_write_pdf_pages(t2p, output);
written += t2p_write_pdf_obj_end(output);
for(t2p->pdf_page=0;t2p->pdf_page<t2p->tiff_pagecount;t2p->pdf_page++){
t2p_read_tiff_data(t2p, input);
if(t2p->t2p_error!=T2P_ERR_OK){return(0);}
t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
written += t2p_write_pdf_page(t2p->pdf_xrefcount, t2p, output);
written += t2p_write_pdf_obj_end(output);
t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
written += t2p_write_pdf_stream_dict_start(output);
written += t2p_write_pdf_stream_dict(0, t2p->pdf_xrefcount+1, output);
written += t2p_write_pdf_stream_dict_end(output);
written += t2p_write_pdf_stream_start(output);
streamlen=written;
written += t2p_write_pdf_page_content_stream(t2p, output);
streamlen=written-streamlen;
written += t2p_write_pdf_stream_end(output);
written += t2p_write_pdf_obj_end(output);
t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
written += t2p_write_pdf_stream_length(streamlen, output);
written += t2p_write_pdf_obj_end(output);
if(t2p->tiff_transferfunctioncount != 0){
t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
written += t2p_write_pdf_transfer(t2p, output);
written += t2p_write_pdf_obj_end(output);
for(i=0; i < t2p->tiff_transferfunctioncount; i++){
t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
written += t2p_write_pdf_stream_dict_start(output);
written += t2p_write_pdf_transfer_dict(t2p, output, i);
written += t2p_write_pdf_stream_dict_end(output);
written += t2p_write_pdf_stream_start(output);
streamlen=written;
written += t2p_write_pdf_transfer_stream(t2p, output, i);
streamlen=written-streamlen;
written += t2p_write_pdf_stream_end(output);
written += t2p_write_pdf_obj_end(output);
}
}
if( (t2p->pdf_colorspace & T2P_CS_PALETTE) != 0){
t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
t2p->pdf_palettecs=t2p->pdf_xrefcount;
written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
written += t2p_write_pdf_stream_dict_start(output);
written += t2p_write_pdf_stream_dict(t2p->pdf_palettesize, 0, output);
written += t2p_write_pdf_stream_dict_end(output);
written += t2p_write_pdf_stream_start(output);
streamlen=written;
written += t2p_write_pdf_xobject_palettecs_stream(t2p, output);
streamlen=written-streamlen;
written += t2p_write_pdf_stream_end(output);
written += t2p_write_pdf_obj_end(output);
}
if( (t2p->pdf_colorspace & T2P_CS_ICCBASED) != 0){
t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
t2p->pdf_icccs=t2p->pdf_xrefcount;
written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
written += t2p_write_pdf_stream_dict_start(output);
written += t2p_write_pdf_xobject_icccs_dict(t2p, output);
written += t2p_write_pdf_stream_dict_end(output);
written += t2p_write_pdf_stream_start(output);
streamlen=written;
written += t2p_write_pdf_xobject_icccs_stream(t2p, output);
streamlen=written-streamlen;
written += t2p_write_pdf_stream_end(output);
written += t2p_write_pdf_obj_end(output);
}
if(t2p->tiff_tiles[t2p->pdf_page].tiles_tilecount !=0){
for(i2=0;i2<t2p->tiff_tiles[t2p->pdf_page].tiles_tilecount;i2++){
t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
written += t2p_write_pdf_stream_dict_start(output);
written += t2p_write_pdf_xobject_stream_dict(
i2+1,
t2p,
output);
written += t2p_write_pdf_stream_dict_end(output);
written += t2p_write_pdf_stream_start(output);
streamlen=written;
t2p_read_tiff_size_tile(t2p, input, i2);
written += t2p_readwrite_pdf_image_tile(t2p, input, output, i2);
t2p_write_advance_directory(t2p, output);
if(t2p->t2p_error!=T2P_ERR_OK){return(0);}
streamlen=written-streamlen;
written += t2p_write_pdf_stream_end(output);
written += t2p_write_pdf_obj_end(output);
t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
written += t2p_write_pdf_stream_length(streamlen, output);
written += t2p_write_pdf_obj_end(output);
}
} else {
t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
written += t2p_write_pdf_stream_dict_start(output);
written += t2p_write_pdf_xobject_stream_dict(
0,
t2p,
output);
written += t2p_write_pdf_stream_dict_end(output);
written += t2p_write_pdf_stream_start(output);
streamlen=written;
t2p_read_tiff_size(t2p, input);
written += t2p_readwrite_pdf_image(t2p, input, output);
t2p_write_advance_directory(t2p, output);
if(t2p->t2p_error!=T2P_ERR_OK){return(0);}
streamlen=written-streamlen;
written += t2p_write_pdf_stream_end(output);
written += t2p_write_pdf_obj_end(output);
t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
written += t2p_write_pdf_stream_length(streamlen, output);
written += t2p_write_pdf_obj_end(output);
}
}
t2p->pdf_startxref = written;
written += t2p_write_pdf_xreftable(t2p, output);
written += t2p_write_pdf_trailer(t2p, output);
t2p_disable(output);
return(written);
}
tools/tiff2pdf.c:5167: error: Memory Leak
memory dynamically allocated by call to `_TIFFmalloc()` at line 5146, column 34 is not reachable after line 5167, column 13.
tools/tiff2pdf.c:5137:1: start of procedure t2p_write_pdf()
5135. */
5136.
5137. tsize_t t2p_write_pdf(T2P* t2p, TIFF* input, TIFF* output){
^
5138.
5139. tsize_t written=0;
tools/tiff2pdf.c:5139:2:
5137. tsize_t t2p_write_pdf(T2P* t2p, TIFF* input, TIFF* output){
5138.
5139. tsize_t written=0;
^
5140. ttile_t i2=0;
5141. tsize_t streamlen=0;
tools/tiff2pdf.c:5140:2:
5138.
5139. tsize_t written=0;
5140. ttile_t i2=0;
^
5141. tsize_t streamlen=0;
5142. uint16 i=0;
tools/tiff2pdf.c:5141:2:
5139. tsize_t written=0;
5140. ttile_t i2=0;
5141. tsize_t streamlen=0;
^
5142. uint16 i=0;
5143.
tools/tiff2pdf.c:5142:2:
5140. ttile_t i2=0;
5141. tsize_t streamlen=0;
5142. uint16 i=0;
^
5143.
5144. t2p_read_tiff_init(t2p, input);
tools/tiff2pdf.c:5144:2: Skipping t2p_read_tiff_init(): empty list of specs
5142. uint16 i=0;
5143.
5144. t2p_read_tiff_init(t2p, input);
^
5145. if(t2p->t2p_error!=T2P_ERR_OK){return(0);}
5146. t2p->pdf_xrefoffsets= (uint32*) _TIFFmalloc(t2p->pdf_xrefcount * sizeof(uint32) );
tools/tiff2pdf.c:5145:5: Taking false branch
5143.
5144. t2p_read_tiff_init(t2p, input);
5145. if(t2p->t2p_error!=T2P_ERR_OK){return(0);}
^
5146. t2p->pdf_xrefoffsets= (uint32*) _TIFFmalloc(t2p->pdf_xrefcount * sizeof(uint32) );
5147. if(t2p->pdf_xrefoffsets==NULL){
tools/tiff2pdf.c:5146:2:
5144. t2p_read_tiff_init(t2p, input);
5145. if(t2p->t2p_error!=T2P_ERR_OK){return(0);}
5146. t2p->pdf_xrefoffsets= (uint32*) _TIFFmalloc(t2p->pdf_xrefcount * sizeof(uint32) );
^
5147. if(t2p->pdf_xrefoffsets==NULL){
5148. TIFFError(
libtiff/tif_unix.c:253:1: start of procedure _TIFFmalloc()
251. #endif
252.
253. void*
^
254. _TIFFmalloc(tmsize_t s)
255. {
libtiff/tif_unix.c:256:2:
254. _TIFFmalloc(tmsize_t s)
255. {
256. return (malloc((size_t) s));
^
257. }
258.
libtiff/tif_unix.c:257:1: return from a call to _TIFFmalloc
255. {
256. return (malloc((size_t) s));
257. }
^
258.
259. void
tools/tiff2pdf.c:5147:5: Taking false branch
5145. if(t2p->t2p_error!=T2P_ERR_OK){return(0);}
5146. t2p->pdf_xrefoffsets= (uint32*) _TIFFmalloc(t2p->pdf_xrefcount * sizeof(uint32) );
5147. if(t2p->pdf_xrefoffsets==NULL){
^
5148. TIFFError(
5149. TIFF2PDF_MODULE,
tools/tiff2pdf.c:5154:2:
5152. return(written);
5153. }
5154. t2p->pdf_xrefcount=0;
^
5155. t2p->pdf_catalog=1;
5156. t2p->pdf_info=2;
tools/tiff2pdf.c:5155:2:
5153. }
5154. t2p->pdf_xrefcount=0;
5155. t2p->pdf_catalog=1;
^
5156. t2p->pdf_info=2;
5157. t2p->pdf_pages=3;
tools/tiff2pdf.c:5156:2:
5154. t2p->pdf_xrefcount=0;
5155. t2p->pdf_catalog=1;
5156. t2p->pdf_info=2;
^
5157. t2p->pdf_pages=3;
5158. written += t2p_write_pdf_header(t2p, output);
tools/tiff2pdf.c:5157:2:
5155. t2p->pdf_catalog=1;
5156. t2p->pdf_info=2;
5157. t2p->pdf_pages=3;
^
5158. written += t2p_write_pdf_header(t2p, output);
5159. t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
tools/tiff2pdf.c:5158:2:
5156. t2p->pdf_info=2;
5157. t2p->pdf_pages=3;
5158. written += t2p_write_pdf_header(t2p, output);
^
5159. t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
5160. t2p->pdf_catalog=t2p->pdf_xrefcount;
tools/tiff2pdf.c:3525:1: start of procedure t2p_write_pdf_header()
3523. */
3524.
3525. tsize_t t2p_write_pdf_header(T2P* t2p, TIFF* output){
^
3526.
3527. tsize_t written=0;
tools/tiff2pdf.c:3527:2:
3525. tsize_t t2p_write_pdf_header(T2P* t2p, TIFF* output){
3526.
3527. tsize_t written=0;
^
3528. char buffer[16];
3529. int buflen=0;
tools/tiff2pdf.c:3529:2:
3527. tsize_t written=0;
3528. char buffer[16];
3529. int buflen=0;
^
3530.
3531. buflen=sprintf(buffer, "%%PDF-%u.%u ", t2p->pdf_majorversion&0xff, t2p->pdf_minorversion&0xff);
tools/tiff2pdf.c:3531:2:
3529. int buflen=0;
3530.
3531. buflen=sprintf(buffer, "%%PDF-%u.%u ", t2p->pdf_majorversion&0xff, t2p->pdf_minorversion&0xff);
^
3532. written += t2pWriteFile(output, (tdata_t) buffer, buflen);
3533. written += t2pWriteFile(output, (tdata_t)"\n%\342\343\317\323\n", 7);
tools/tiff2pdf.c:3532:2:
3530.
3531. buflen=sprintf(buffer, "%%PDF-%u.%u ", t2p->pdf_majorversion&0xff, t2p->pdf_minorversion&0xff);
3532. written += t2pWriteFile(output, (tdata_t) buffer, buflen);
^
3533. written += t2pWriteFile(output, (tdata_t)"\n%\342\343\317\323\n", 7);
3534.
tools/tiff2pdf.c:363:1: start of procedure t2pWriteFile()
361. }
362.
363. static tmsize_t
^
364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
365. {
tools/tiff2pdf.c:366:2:
364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
365. {
366. thandle_t client = TIFFClientdata(tif);
^
367. TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
368. if (proc)
libtiff/tif_open.c:536:1: start of procedure TIFFClientdata()
534. * Return open file's clientdata.
535. */
536. thandle_t
^
537. TIFFClientdata(TIFF* tif)
538. {
libtiff/tif_open.c:539:2:
537. TIFFClientdata(TIFF* tif)
538. {
539. return (tif->tif_clientdata);
^
540. }
541.
libtiff/tif_open.c:540:1: return from a call to TIFFClientdata
538. {
539. return (tif->tif_clientdata);
540. }
^
541.
542. /*
tools/tiff2pdf.c:367:2:
365. {
366. thandle_t client = TIFFClientdata(tif);
367. TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
^
368. if (proc)
369. return proc(client, data, size);
libtiff/tif_open.c:667:1: start of procedure TIFFGetWriteProc()
665. * Return pointer to file write method.
666. */
667. TIFFReadWriteProc
^
668. TIFFGetWriteProc(TIFF* tif)
669. {
libtiff/tif_open.c:670:2:
668. TIFFGetWriteProc(TIFF* tif)
669. {
670. return (tif->tif_writeproc);
^
671. }
672.
libtiff/tif_open.c:671:1: return from a call to TIFFGetWriteProc
669. {
670. return (tif->tif_writeproc);
671. }
^
672.
673. /*
tools/tiff2pdf.c:368:6: Taking false branch
366. thandle_t client = TIFFClientdata(tif);
367. TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
368. if (proc)
^
369. return proc(client, data, size);
370. return -1;
tools/tiff2pdf.c:370:2:
368. if (proc)
369. return proc(client, data, size);
370. return -1;
^
371. }
372.
tools/tiff2pdf.c:371:1: return from a call to t2pWriteFile
369. return proc(client, data, size);
370. return -1;
371. }
^
372.
373. static uint64
tools/tiff2pdf.c:3533:2:
3531. buflen=sprintf(buffer, "%%PDF-%u.%u ", t2p->pdf_majorversion&0xff, t2p->pdf_minorversion&0xff);
3532. written += t2pWriteFile(output, (tdata_t) buffer, buflen);
3533. written += t2pWriteFile(output, (tdata_t)"\n%\342\343\317\323\n", 7);
^
3534.
3535. return(written);
tools/tiff2pdf.c:363:1: start of procedure t2pWriteFile()
361. }
362.
363. static tmsize_t
^
364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
365. {
tools/tiff2pdf.c:366:2:
364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
365. {
366. thandle_t client = TIFFClientdata(tif);
^
367. TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
368. if (proc)
libtiff/tif_open.c:536:1: start of procedure TIFFClientdata()
534. * Return open file's clientdata.
535. */
536. thandle_t
^
537. TIFFClientdata(TIFF* tif)
538. {
libtiff/tif_open.c:539:2:
537. TIFFClientdata(TIFF* tif)
538. {
539. return (tif->tif_clientdata);
^
540. }
541.
libtiff/tif_open.c:540:1: return from a call to TIFFClientdata
538. {
539. return (tif->tif_clientdata);
540. }
^
541.
542. /*
tools/tiff2pdf.c:367:2:
365. {
366. thandle_t client = TIFFClientdata(tif);
367. TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
^
368. if (proc)
369. return proc(client, data, size);
libtiff/tif_open.c:667:1: start of procedure TIFFGetWriteProc()
665. * Return pointer to file write method.
666. */
667. TIFFReadWriteProc
^
668. TIFFGetWriteProc(TIFF* tif)
669. {
libtiff/tif_open.c:670:2:
668. TIFFGetWriteProc(TIFF* tif)
669. {
670. return (tif->tif_writeproc);
^
671. }
672.
libtiff/tif_open.c:671:1: return from a call to TIFFGetWriteProc
669. {
670. return (tif->tif_writeproc);
671. }
^
672.
673. /*
tools/tiff2pdf.c:368:6: Taking false branch
366. thandle_t client = TIFFClientdata(tif);
367. TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
368. if (proc)
^
369. return proc(client, data, size);
370. return -1;
tools/tiff2pdf.c:370:2:
368. if (proc)
369. return proc(client, data, size);
370. return -1;
^
371. }
372.
tools/tiff2pdf.c:371:1: return from a call to t2pWriteFile
369. return proc(client, data, size);
370. return -1;
371. }
^
372.
373. static uint64
tools/tiff2pdf.c:3535:2:
3533. written += t2pWriteFile(output, (tdata_t)"\n%\342\343\317\323\n", 7);
3534.
3535. return(written);
^
3536. }
3537.
tools/tiff2pdf.c:3536:1: return from a call to t2p_write_pdf_header
3534.
3535. return(written);
3536. }
^
3537.
3538. /*
tools/tiff2pdf.c:5159:2:
5157. t2p->pdf_pages=3;
5158. written += t2p_write_pdf_header(t2p, output);
5159. t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
^
5160. t2p->pdf_catalog=t2p->pdf_xrefcount;
5161. written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
tools/tiff2pdf.c:5160:2:
5158. written += t2p_write_pdf_header(t2p, output);
5159. t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
5160. t2p->pdf_catalog=t2p->pdf_xrefcount;
^
5161. written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
5162. written += t2p_write_pdf_catalog(t2p, output);
tools/tiff2pdf.c:5161:2:
5159. t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
5160. t2p->pdf_catalog=t2p->pdf_xrefcount;
5161. written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
^
5162. written += t2p_write_pdf_catalog(t2p, output);
5163. written += t2p_write_pdf_obj_end(output);
tools/tiff2pdf.c:3542:1: start of procedure t2p_write_pdf_obj_start()
3540. */
3541.
3542. tsize_t t2p_write_pdf_obj_start(uint32 number, TIFF* output){
^
3543.
3544. tsize_t written=0;
tools/tiff2pdf.c:3544:2:
3542. tsize_t t2p_write_pdf_obj_start(uint32 number, TIFF* output){
3543.
3544. tsize_t written=0;
^
3545. char buffer[16];
3546. int buflen=0;
tools/tiff2pdf.c:3546:2:
3544. tsize_t written=0;
3545. char buffer[16];
3546. int buflen=0;
^
3547.
3548. buflen=sprintf(buffer, "%lu", (unsigned long)number);
tools/tiff2pdf.c:3548:2:
3546. int buflen=0;
3547.
3548. buflen=sprintf(buffer, "%lu", (unsigned long)number);
^
3549. written += t2pWriteFile(output, (tdata_t) buffer, buflen );
3550. written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7);
tools/tiff2pdf.c:3549:2:
3547.
3548. buflen=sprintf(buffer, "%lu", (unsigned long)number);
3549. written += t2pWriteFile(output, (tdata_t) buffer, buflen );
^
3550. written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7);
3551.
tools/tiff2pdf.c:363:1: start of procedure t2pWriteFile()
361. }
362.
363. static tmsize_t
^
364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
365. {
tools/tiff2pdf.c:366:2:
364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
365. {
366. thandle_t client = TIFFClientdata(tif);
^
367. TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
368. if (proc)
libtiff/tif_open.c:536:1: start of procedure TIFFClientdata()
534. * Return open file's clientdata.
535. */
536. thandle_t
^
537. TIFFClientdata(TIFF* tif)
538. {
libtiff/tif_open.c:539:2:
537. TIFFClientdata(TIFF* tif)
538. {
539. return (tif->tif_clientdata);
^
540. }
541.
libtiff/tif_open.c:540:1: return from a call to TIFFClientdata
538. {
539. return (tif->tif_clientdata);
540. }
^
541.
542. /*
tools/tiff2pdf.c:367:2:
365. {
366. thandle_t client = TIFFClientdata(tif);
367. TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
^
368. if (proc)
369. return proc(client, data, size);
libtiff/tif_open.c:667:1: start of procedure TIFFGetWriteProc()
665. * Return pointer to file write method.
666. */
667. TIFFReadWriteProc
^
668. TIFFGetWriteProc(TIFF* tif)
669. {
libtiff/tif_open.c:670:2:
668. TIFFGetWriteProc(TIFF* tif)
669. {
670. return (tif->tif_writeproc);
^
671. }
672.
libtiff/tif_open.c:671:1: return from a call to TIFFGetWriteProc
669. {
670. return (tif->tif_writeproc);
671. }
^
672.
673. /*
tools/tiff2pdf.c:368:6: Taking false branch
366. thandle_t client = TIFFClientdata(tif);
367. TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
368. if (proc)
^
369. return proc(client, data, size);
370. return -1;
tools/tiff2pdf.c:370:2:
368. if (proc)
369. return proc(client, data, size);
370. return -1;
^
371. }
372.
tools/tiff2pdf.c:371:1: return from a call to t2pWriteFile
369. return proc(client, data, size);
370. return -1;
371. }
^
372.
373. static uint64
tools/tiff2pdf.c:3550:2:
3548. buflen=sprintf(buffer, "%lu", (unsigned long)number);
3549. written += t2pWriteFile(output, (tdata_t) buffer, buflen );
3550. written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7);
^
3551.
3552. return(written);
tools/tiff2pdf.c:363:1: start of procedure t2pWriteFile()
361. }
362.
363. static tmsize_t
^
364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
365. {
tools/tiff2pdf.c:366:2:
364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
365. {
366. thandle_t client = TIFFClientdata(tif);
^
367. TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
368. if (proc)
libtiff/tif_open.c:536:1: start of procedure TIFFClientdata()
534. * Return open file's clientdata.
535. */
536. thandle_t
^
537. TIFFClientdata(TIFF* tif)
538. {
libtiff/tif_open.c:539:2:
537. TIFFClientdata(TIFF* tif)
538. {
539. return (tif->tif_clientdata);
^
540. }
541.
libtiff/tif_open.c:540:1: return from a call to TIFFClientdata
538. {
539. return (tif->tif_clientdata);
540. }
^
541.
542. /*
tools/tiff2pdf.c:367:2:
365. {
366. thandle_t client = TIFFClientdata(tif);
367. TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
^
368. if (proc)
369. return proc(client, data, size);
libtiff/tif_open.c:667:1: start of procedure TIFFGetWriteProc()
665. * Return pointer to file write method.
666. */
667. TIFFReadWriteProc
^
668. TIFFGetWriteProc(TIFF* tif)
669. {
libtiff/tif_open.c:670:2:
668. TIFFGetWriteProc(TIFF* tif)
669. {
670. return (tif->tif_writeproc);
^
671. }
672.
libtiff/tif_open.c:671:1: return from a call to TIFFGetWriteProc
669. {
670. return (tif->tif_writeproc);
671. }
^
672.
673. /*
tools/tiff2pdf.c:368:6: Taking false branch
366. thandle_t client = TIFFClientdata(tif);
367. TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
368. if (proc)
^
369. return proc(client, data, size);
370. return -1;
tools/tiff2pdf.c:370:2:
368. if (proc)
369. return proc(client, data, size);
370. return -1;
^
371. }
372.
tools/tiff2pdf.c:371:1: return from a call to t2pWriteFile
369. return proc(client, data, size);
370. return -1;
371. }
^
372.
373. static uint64
tools/tiff2pdf.c:3552:2:
3550. written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7);
3551.
3552. return(written);
^
3553. }
3554.
tools/tiff2pdf.c:3553:1: return from a call to t2p_write_pdf_obj_start
3551.
3552. return(written);
3553. }
^
3554.
3555. /*
tools/tiff2pdf.c:5162:2:
5160. t2p->pdf_catalog=t2p->pdf_xrefcount;
5161. written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
5162. written += t2p_write_pdf_catalog(t2p, output);
^
5163. written += t2p_write_pdf_obj_end(output);
5164. t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
tools/tiff2pdf.c:3828:1: start of procedure t2p_write_pdf_catalog()
3826. */
3827.
3828. tsize_t t2p_write_pdf_catalog(T2P* t2p, TIFF* output)
^
3829. {
3830. tsize_t written = 0;
tools/tiff2pdf.c:3830:2:
3828. tsize_t t2p_write_pdf_catalog(T2P* t2p, TIFF* output)
3829. {
3830. tsize_t written = 0;
^
3831. char buffer[16];
3832. int buflen = 0;
tools/tiff2pdf.c:3832:2:
3830. tsize_t written = 0;
3831. char buffer[16];
3832. int buflen = 0;
^
3833.
3834. written += t2pWriteFile(output,
tools/tiff2pdf.c:3834:2:
3832. int buflen = 0;
3833.
3834. written += t2pWriteFile(output,
^
3835. (tdata_t)"<< \n/Type /Catalog \n/Pages ",
3836. 27);
tools/tiff2pdf.c:363:1: start of procedure t2pWriteFile()
361. }
362.
363. static tmsize_t
^
364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
365. {
tools/tiff2pdf.c:366:2:
364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
365. {
366. thandle_t client = TIFFClientdata(tif);
^
367. TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
368. if (proc)
libtiff/tif_open.c:536:1: start of procedure TIFFClientdata()
534. * Return open file's clientdata.
535. */
536. thandle_t
^
537. TIFFClientdata(TIFF* tif)
538. {
libtiff/tif_open.c:539:2:
537. TIFFClientdata(TIFF* tif)
538. {
539. return (tif->tif_clientdata);
^
540. }
541.
libtiff/tif_open.c:540:1: return from a call to TIFFClientdata
538. {
539. return (tif->tif_clientdata);
540. }
^
541.
542. /*
tools/tiff2pdf.c:367:2:
365. {
366. thandle_t client = TIFFClientdata(tif);
367. TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
^
368. if (proc)
369. return proc(client, data, size);
libtiff/tif_open.c:667:1: start of procedure TIFFGetWriteProc()
665. * Return pointer to file write method.
666. */
667. TIFFReadWriteProc
^
668. TIFFGetWriteProc(TIFF* tif)
669. {
libtiff/tif_open.c:670:2:
668. TIFFGetWriteProc(TIFF* tif)
669. {
670. return (tif->tif_writeproc);
^
671. }
672.
libtiff/tif_open.c:671:1: return from a call to TIFFGetWriteProc
669. {
670. return (tif->tif_writeproc);
671. }
^
672.
673. /*
tools/tiff2pdf.c:368:6: Taking false branch
366. thandle_t client = TIFFClientdata(tif);
367. TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
368. if (proc)
^
369. return proc(client, data, size);
370. return -1;
tools/tiff2pdf.c:370:2:
368. if (proc)
369. return proc(client, data, size);
370. return -1;
^
371. }
372.
tools/tiff2pdf.c:371:1: return from a call to t2pWriteFile
369. return proc(client, data, size);
370. return -1;
371. }
^
372.
373. static uint64
tools/tiff2pdf.c:3837:2:
3835. (tdata_t)"<< \n/Type /Catalog \n/Pages ",
3836. 27);
3837. buflen = snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_pages);
^
3838. written += t2pWriteFile(output, (tdata_t) buffer,
3839. TIFFmin((size_t)buflen, sizeof(buffer) - 1));
tools/tiff2pdf.c:3839:5: Condition is false
3837. buflen = snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_pages);
3838. written += t2pWriteFile(output, (tdata_t) buffer,
3839. TIFFmin((size_t)buflen, sizeof(buffer) - 1));
^
3840. written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6);
3841. if(t2p->pdf_fitwindow){
tools/tiff2pdf.c:3838:2:
3836. 27);
3837. buflen = snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_pages);
3838. written += t2pWriteFile(output, (tdata_t) buffer,
^
3839. TIFFmin((size_t)buflen, sizeof(buffer) - 1));
3840. written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6);
tools/tiff2pdf.c:363:1: start of procedure t2pWriteFile()
361. }
362.
363. static tmsize_t
^
364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
365. {
tools/tiff2pdf.c:366:2:
364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
365. {
366. thandle_t client = TIFFClientdata(tif);
^
367. TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
368. if (proc)
libtiff/tif_open.c:536:1: start of procedure TIFFClientdata()
534. * Return open file's clientdata.
535. */
536. thandle_t
^
537. TIFFClientdata(TIFF* tif)
538. {
libtiff/tif_open.c:539:2:
537. TIFFClientdata(TIFF* tif)
538. {
539. return (tif->tif_clientdata);
^
540. }
541.
libtiff/tif_open.c:540:1: return from a call to TIFFClientdata
538. {
539. return (tif->tif_clientdata);
540. }
^
541.
542. /*
tools/tiff2pdf.c:367:2:
365. {
366. thandle_t client = TIFFClientdata(tif);
367. TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
^
368. if (proc)
369. return proc(client, data, size);
libtiff/tif_open.c:667:1: start of procedure TIFFGetWriteProc()
665. * Return pointer to file write method.
666. */
667. TIFFReadWriteProc
^
668. TIFFGetWriteProc(TIFF* tif)
669. {
libtiff/tif_open.c:670:2:
668. TIFFGetWriteProc(TIFF* tif)
669. {
670. return (tif->tif_writeproc);
^
671. }
672.
libtiff/tif_open.c:671:1: return from a call to TIFFGetWriteProc
669. {
670. return (tif->tif_writeproc);
671. }
^
672.
673. /*
tools/tiff2pdf.c:368:6: Taking false branch
366. thandle_t client = TIFFClientdata(tif);
367. TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
368. if (proc)
^
369. return proc(client, data, size);
370. return -1;
tools/tiff2pdf.c:370:2:
368. if (proc)
369. return proc(client, data, size);
370. return -1;
^
371. }
372.
tools/tiff2pdf.c:371:1: return from a call to t2pWriteFile
369. return proc(client, data, size);
370. return -1;
371. }
^
372.
373. static uint64
tools/tiff2pdf.c:3840:2:
3838. written += t2pWriteFile(output, (tdata_t) buffer,
3839. TIFFmin((size_t)buflen, sizeof(buffer) - 1));
3840. written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6);
^
3841. if(t2p->pdf_fitwindow){
3842. written += t2pWriteFile(output,
tools/tiff2pdf.c:363:1: start of procedure t2pWriteFile()
361. }
362.
363. static tmsize_t
^
364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
365. {
tools/tiff2pdf.c:366:2:
364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
365. {
366. thandle_t client = TIFFClientdata(tif);
^
367. TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
368. if (proc)
libtiff/tif_open.c:536:1: start of procedure TIFFClientdata()
534. * Return open file's clientdata.
535. */
536. thandle_t
^
537. TIFFClientdata(TIFF* tif)
538. {
libtiff/tif_open.c:539:2:
537. TIFFClientdata(TIFF* tif)
538. {
539. return (tif->tif_clientdata);
^
540. }
541.
libtiff/tif_open.c:540:1: return from a call to TIFFClientdata
538. {
539. return (tif->tif_clientdata);
540. }
^
541.
542. /*
tools/tiff2pdf.c:367:2:
365. {
366. thandle_t client = TIFFClientdata(tif);
367. TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
^
368. if (proc)
369. return proc(client, data, size);
libtiff/tif_open.c:667:1: start of procedure TIFFGetWriteProc()
665. * Return pointer to file write method.
666. */
667. TIFFReadWriteProc
^
668. TIFFGetWriteProc(TIFF* tif)
669. {
libtiff/tif_open.c:670:2:
668. TIFFGetWriteProc(TIFF* tif)
669. {
670. return (tif->tif_writeproc);
^
671. }
672.
libtiff/tif_open.c:671:1: return from a call to TIFFGetWriteProc
669. {
670. return (tif->tif_writeproc);
671. }
^
672.
673. /*
tools/tiff2pdf.c:368:6: Taking false branch
366. thandle_t client = TIFFClientdata(tif);
367. TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
368. if (proc)
^
369. return proc(client, data, size);
370. return -1;
tools/tiff2pdf.c:370:2:
368. if (proc)
369. return proc(client, data, size);
370. return -1;
^
371. }
372.
tools/tiff2pdf.c:371:1: return from a call to t2pWriteFile
369. return proc(client, data, size);
370. return -1;
371. }
^
372.
373. static uint64
tools/tiff2pdf.c:3841:5: Taking true branch
3839. TIFFmin((size_t)buflen, sizeof(buffer) - 1));
3840. written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6);
3841. if(t2p->pdf_fitwindow){
^
3842. written += t2pWriteFile(output,
3843. (tdata_t) "/ViewerPreferences <</FitWindow true>>\n",
tools/tiff2pdf.c:3842:3:
3840. written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6);
3841. if(t2p->pdf_fitwindow){
3842. written += t2pWriteFile(output,
^
3843. (tdata_t) "/ViewerPreferences <</FitWindow true>>\n",
3844. 39);
tools/tiff2pdf.c:363:1: start of procedure t2pWriteFile()
361. }
362.
363. static tmsize_t
^
364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
365. {
tools/tiff2pdf.c:366:2:
364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
365. {
366. thandle_t client = TIFFClientdata(tif);
^
367. TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
368. if (proc)
libtiff/tif_open.c:536:1: start of procedure TIFFClientdata()
534. * Return open file's clientdata.
535. */
536. thandle_t
^
537. TIFFClientdata(TIFF* tif)
538. {
libtiff/tif_open.c:539:2:
537. TIFFClientdata(TIFF* tif)
538. {
539. return (tif->tif_clientdata);
^
540. }
541.
libtiff/tif_open.c:540:1: return from a call to TIFFClientdata
538. {
539. return (tif->tif_clientdata);
540. }
^
541.
542. /*
tools/tiff2pdf.c:367:2:
365. {
366. thandle_t client = TIFFClientdata(tif);
367. TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
^
368. if (proc)
369. return proc(client, data, size);
libtiff/tif_open.c:667:1: start of procedure TIFFGetWriteProc()
665. * Return pointer to file write method.
666. */
667. TIFFReadWriteProc
^
668. TIFFGetWriteProc(TIFF* tif)
669. {
libtiff/tif_open.c:670:2:
668. TIFFGetWriteProc(TIFF* tif)
669. {
670. return (tif->tif_writeproc);
^
671. }
672.
libtiff/tif_open.c:671:1: return from a call to TIFFGetWriteProc
669. {
670. return (tif->tif_writeproc);
671. }
^
672.
673. /*
tools/tiff2pdf.c:368:6: Taking false branch
366. thandle_t client = TIFFClientdata(tif);
367. TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
368. if (proc)
^
369. return proc(client, data, size);
370. return -1;
tools/tiff2pdf.c:370:2:
368. if (proc)
369. return proc(client, data, size);
370. return -1;
^
371. }
372.
tools/tiff2pdf.c:371:1: return from a call to t2pWriteFile
369. return proc(client, data, size);
370. return -1;
371. }
^
372.
373. static uint64
tools/tiff2pdf.c:3846:2:
3844. 39);
3845. }
3846. written += t2pWriteFile(output, (tdata_t)">>\n", 3);
^
3847.
3848. return(written);
tools/tiff2pdf.c:363:1: start of procedure t2pWriteFile()
361. }
362.
363. static tmsize_t
^
364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
365. {
tools/tiff2pdf.c:366:2:
364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
365. {
366. thandle_t client = TIFFClientdata(tif);
^
367. TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
368. if (proc)
libtiff/tif_open.c:536:1: start of procedure TIFFClientdata()
534. * Return open file's clientdata.
535. */
536. thandle_t
^
537. TIFFClientdata(TIFF* tif)
538. {
libtiff/tif_open.c:539:2:
537. TIFFClientdata(TIFF* tif)
538. {
539. return (tif->tif_clientdata);
^
540. }
541.
libtiff/tif_open.c:540:1: return from a call to TIFFClientdata
538. {
539. return (tif->tif_clientdata);
540. }
^
541.
542. /*
tools/tiff2pdf.c:367:2:
365. {
366. thandle_t client = TIFFClientdata(tif);
367. TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
^
368. if (proc)
369. return proc(client, data, size);
libtiff/tif_open.c:667:1: start of procedure TIFFGetWriteProc()
665. * Return pointer to file write method.
666. */
667. TIFFReadWriteProc
^
668. TIFFGetWriteProc(TIFF* tif)
669. {
libtiff/tif_open.c:670:2:
668. TIFFGetWriteProc(TIFF* tif)
669. {
670. return (tif->tif_writeproc);
^
671. }
672.
libtiff/tif_open.c:671:1: return from a call to TIFFGetWriteProc
669. {
670. return (tif->tif_writeproc);
671. }
^
672.
673. /*
tools/tiff2pdf.c:368:6: Taking false branch
366. thandle_t client = TIFFClientdata(tif);
367. TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
368. if (proc)
^
369. return proc(client, data, size);
370. return -1;
tools/tiff2pdf.c:370:2:
368. if (proc)
369. return proc(client, data, size);
370. return -1;
^
371. }
372.
tools/tiff2pdf.c:371:1: return from a call to t2pWriteFile
369. return proc(client, data, size);
370. return -1;
371. }
^
372.
373. static uint64
tools/tiff2pdf.c:3848:2:
3846. written += t2pWriteFile(output, (tdata_t)">>\n", 3);
3847.
3848. return(written);
^
3849. }
3850.
tools/tiff2pdf.c:3849:1: return from a call to t2p_write_pdf_catalog
3847.
3848. return(written);
3849. }
^
3850.
3851. /*
tools/tiff2pdf.c:5163:2:
5161. written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
5162. written += t2p_write_pdf_catalog(t2p, output);
5163. written += t2p_write_pdf_obj_end(output);
^
5164. t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
5165. t2p->pdf_info=t2p->pdf_xrefcount;
tools/tiff2pdf.c:3559:1: start of procedure t2p_write_pdf_obj_end()
3557. */
3558.
3559. tsize_t t2p_write_pdf_obj_end(TIFF* output){
^
3560.
3561. tsize_t written=0;
tools/tiff2pdf.c:3561:2:
3559. tsize_t t2p_write_pdf_obj_end(TIFF* output){
3560.
3561. tsize_t written=0;
^
3562.
3563. written += t2pWriteFile(output, (tdata_t) "endobj\n", 7);
tools/tiff2pdf.c:3563:2:
3561. tsize_t written=0;
3562.
3563. written += t2pWriteFile(output, (tdata_t) "endobj\n", 7);
^
3564.
3565. return(written);
tools/tiff2pdf.c:363:1: start of procedure t2pWriteFile()
361. }
362.
363. static tmsize_t
^
364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
365. {
tools/tiff2pdf.c:366:2:
364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
365. {
366. thandle_t client = TIFFClientdata(tif);
^
367. TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
368. if (proc)
libtiff/tif_open.c:536:1: start of procedure TIFFClientdata()
534. * Return open file's clientdata.
535. */
536. thandle_t
^
537. TIFFClientdata(TIFF* tif)
538. {
libtiff/tif_open.c:539:2:
537. TIFFClientdata(TIFF* tif)
538. {
539. return (tif->tif_clientdata);
^
540. }
541.
libtiff/tif_open.c:540:1: return from a call to TIFFClientdata
538. {
539. return (tif->tif_clientdata);
540. }
^
541.
542. /*
tools/tiff2pdf.c:367:2:
365. {
366. thandle_t client = TIFFClientdata(tif);
367. TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
^
368. if (proc)
369. return proc(client, data, size);
libtiff/tif_open.c:667:1: start of procedure TIFFGetWriteProc()
665. * Return pointer to file write method.
666. */
667. TIFFReadWriteProc
^
668. TIFFGetWriteProc(TIFF* tif)
669. {
libtiff/tif_open.c:670:2:
668. TIFFGetWriteProc(TIFF* tif)
669. {
670. return (tif->tif_writeproc);
^
671. }
672.
libtiff/tif_open.c:671:1: return from a call to TIFFGetWriteProc
669. {
670. return (tif->tif_writeproc);
671. }
^
672.
673. /*
tools/tiff2pdf.c:368:6: Taking false branch
366. thandle_t client = TIFFClientdata(tif);
367. TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
368. if (proc)
^
369. return proc(client, data, size);
370. return -1;
tools/tiff2pdf.c:370:2:
368. if (proc)
369. return proc(client, data, size);
370. return -1;
^
371. }
372.
tools/tiff2pdf.c:371:1: return from a call to t2pWriteFile
369. return proc(client, data, size);
370. return -1;
371. }
^
372.
373. static uint64
tools/tiff2pdf.c:3565:2:
3563. written += t2pWriteFile(output, (tdata_t) "endobj\n", 7);
3564.
3565. return(written);
^
3566. }
3567.
tools/tiff2pdf.c:3566:1: return from a call to t2p_write_pdf_obj_end
3564.
3565. return(written);
3566. }
^
3567.
3568. /*
tools/tiff2pdf.c:5164:2:
5162. written += t2p_write_pdf_catalog(t2p, output);
5163. written += t2p_write_pdf_obj_end(output);
5164. t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
^
5165. t2p->pdf_info=t2p->pdf_xrefcount;
5166. written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
tools/tiff2pdf.c:5165:2:
5163. written += t2p_write_pdf_obj_end(output);
5164. t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
5165. t2p->pdf_info=t2p->pdf_xrefcount;
^
5166. written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
5167. written += t2p_write_pdf_info(t2p, input, output);
tools/tiff2pdf.c:5166:2:
5164. t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
5165. t2p->pdf_info=t2p->pdf_xrefcount;
5166. written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
^
5167. written += t2p_write_pdf_info(t2p, input, output);
5168. written += t2p_write_pdf_obj_end(output);
tools/tiff2pdf.c:3542:1: start of procedure t2p_write_pdf_obj_start()
3540. */
3541.
3542. tsize_t t2p_write_pdf_obj_start(uint32 number, TIFF* output){
^
3543.
3544. tsize_t written=0;
tools/tiff2pdf.c:3544:2:
3542. tsize_t t2p_write_pdf_obj_start(uint32 number, TIFF* output){
3543.
3544. tsize_t written=0;
^
3545. char buffer[16];
3546. int buflen=0;
tools/tiff2pdf.c:3546:2:
3544. tsize_t written=0;
3545. char buffer[16];
3546. int buflen=0;
^
3547.
3548. buflen=sprintf(buffer, "%lu", (unsigned long)number);
tools/tiff2pdf.c:3548:2:
3546. int buflen=0;
3547.
3548. buflen=sprintf(buffer, "%lu", (unsigned long)number);
^
3549. written += t2pWriteFile(output, (tdata_t) buffer, buflen );
3550. written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7);
tools/tiff2pdf.c:3549:2:
3547.
3548. buflen=sprintf(buffer, "%lu", (unsigned long)number);
3549. written += t2pWriteFile(output, (tdata_t) buffer, buflen );
^
3550. written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7);
3551.
tools/tiff2pdf.c:363:1: start of procedure t2pWriteFile()
361. }
362.
363. static tmsize_t
^
364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
365. {
tools/tiff2pdf.c:366:2:
364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
365. {
366. thandle_t client = TIFFClientdata(tif);
^
367. TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
368. if (proc)
libtiff/tif_open.c:536:1: start of procedure TIFFClientdata()
534. * Return open file's clientdata.
535. */
536. thandle_t
^
537. TIFFClientdata(TIFF* tif)
538. {
libtiff/tif_open.c:539:2:
537. TIFFClientdata(TIFF* tif)
538. {
539. return (tif->tif_clientdata);
^
540. }
541.
libtiff/tif_open.c:540:1: return from a call to TIFFClientdata
538. {
539. return (tif->tif_clientdata);
540. }
^
541.
542. /*
tools/tiff2pdf.c:367:2:
365. {
366. thandle_t client = TIFFClientdata(tif);
367. TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
^
368. if (proc)
369. return proc(client, data, size);
libtiff/tif_open.c:667:1: start of procedure TIFFGetWriteProc()
665. * Return pointer to file write method.
666. */
667. TIFFReadWriteProc
^
668. TIFFGetWriteProc(TIFF* tif)
669. {
libtiff/tif_open.c:670:2:
668. TIFFGetWriteProc(TIFF* tif)
669. {
670. return (tif->tif_writeproc);
^
671. }
672.
libtiff/tif_open.c:671:1: return from a call to TIFFGetWriteProc
669. {
670. return (tif->tif_writeproc);
671. }
^
672.
673. /*
tools/tiff2pdf.c:368:6: Taking false branch
366. thandle_t client = TIFFClientdata(tif);
367. TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
368. if (proc)
^
369. return proc(client, data, size);
370. return -1;
tools/tiff2pdf.c:370:2:
368. if (proc)
369. return proc(client, data, size);
370. return -1;
^
371. }
372.
tools/tiff2pdf.c:371:1: return from a call to t2pWriteFile
369. return proc(client, data, size);
370. return -1;
371. }
^
372.
373. static uint64
tools/tiff2pdf.c:3550:2:
3548. buflen=sprintf(buffer, "%lu", (unsigned long)number);
3549. written += t2pWriteFile(output, (tdata_t) buffer, buflen );
3550. written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7);
^
3551.
3552. return(written);
tools/tiff2pdf.c:363:1: start of procedure t2pWriteFile()
361. }
362.
363. static tmsize_t
^
364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
365. {
tools/tiff2pdf.c:366:2:
364. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
365. {
366. thandle_t client = TIFFClientdata(tif);
^
367. TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
368. if (proc)
libtiff/tif_open.c:536:1: start of procedure TIFFClientdata()
534. * Return open file's clientdata.
535. */
536. thandle_t
^
537. TIFFClientdata(TIFF* tif)
538. {
libtiff/tif_open.c:539:2:
537. TIFFClientdata(TIFF* tif)
538. {
539. return (tif->tif_clientdata);
^
540. }
541.
libtiff/tif_open.c:540:1: return from a call to TIFFClientdata
538. {
539. return (tif->tif_clientdata);
540. }
^
541.
542. /*
tools/tiff2pdf.c:367:2:
365. {
366. thandle_t client = TIFFClientdata(tif);
367. TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
^
368. if (proc)
369. return proc(client, data, size);
libtiff/tif_open.c:667:1: start of procedure TIFFGetWriteProc()
665. * Return pointer to file write method.
666. */
667. TIFFReadWriteProc
^
668. TIFFGetWriteProc(TIFF* tif)
669. {
libtiff/tif_open.c:670:2:
668. TIFFGetWriteProc(TIFF* tif)
669. {
670. return (tif->tif_writeproc);
^
671. }
672.
libtiff/tif_open.c:671:1: return from a call to TIFFGetWriteProc
669. {
670. return (tif->tif_writeproc);
671. }
^
672.
673. /*
tools/tiff2pdf.c:368:6: Taking false branch
366. thandle_t client = TIFFClientdata(tif);
367. TIFFReadWriteProc proc = TIFFGetWriteProc(tif);
368. if (proc)
^
369. return proc(client, data, size);
370. return -1;
tools/tiff2pdf.c:370:2:
368. if (proc)
369. return proc(client, data, size);
370. return -1;
^
371. }
372.
tools/tiff2pdf.c:371:1: return from a call to t2pWriteFile
369. return proc(client, data, size);
370. return -1;
371. }
^
372.
373. static uint64
tools/tiff2pdf.c:3552:2:
3550. written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7);
3551.
3552. return(written);
^
3553. }
3554.
tools/tiff2pdf.c:3553:1: return from a call to t2p_write_pdf_obj_start
3551.
3552. return(written);
3553. }
^
3554.
3555. /*
tools/tiff2pdf.c:5167:2: Skipping t2p_write_pdf_info(): empty list of specs
5165. t2p->pdf_info=t2p->pdf_xrefcount;
5166. written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output);
5167. written += t2p_write_pdf_info(t2p, input, output);
^
5168. written += t2p_write_pdf_obj_end(output);
5169. t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
|
https://gitlab.com/libtiff/libtiff/blob/b69a1998bedfabc32cd541408bffdef05bd01e45/tools/tiff2pdf.c/#L5167
|
d2a_code_trace_data_43003
|
void Poly1305_Update(POLY1305 *ctx, const unsigned char *inp, size_t len)
{
#ifdef POLY1305_ASM
poly1305_blocks_f poly1305_blocks_p = ctx->func.blocks;
#endif
size_t rem, num;
if ((num = ctx->num)) {
rem = POLY1305_BLOCK_SIZE - num;
if (len >= rem) {
memcpy(ctx->data + num, inp, rem);
poly1305_blocks(ctx->opaque, ctx->data, POLY1305_BLOCK_SIZE, 1);
inp += rem;
len -= rem;
} else {
memcpy(ctx->data + num, inp, len);
ctx->num = num + len;
return;
}
}
rem = len % POLY1305_BLOCK_SIZE;
len -= rem;
if (len >= POLY1305_BLOCK_SIZE) {
poly1305_blocks(ctx->opaque, inp, len, 1);
inp += len;
}
if (rem)
memcpy(ctx->data, inp, rem);
ctx->num = rem;
}
crypto/evp/e_chacha20_poly1305.c:279: error: INTEGER_OVERFLOW_L2
([0, +oo] - [2-max(1, `ctx->cipher_data->num`), 15]):unsigned64 by call to `Poly1305_Update`.
Showing all 7 steps of the trace
crypto/evp/e_chacha20_poly1305.c:233:1: Parameter `len`
231. }
232.
233. > static int chacha20_poly1305_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
234. const unsigned char *in, size_t len)
235. {
crypto/evp/e_chacha20_poly1305.c:279:17: Call
277. actx->len.text += plen;
278. } else { /* ciphertext */
279. Poly1305_Update(POLY1305_ctx(actx), in, plen);
^
280. chacha_cipher(ctx, out, in, plen);
281. in += plen;
crypto/poly1305/poly1305.c:466:1: <LHS trace>
464. #endif
465.
466. > void Poly1305_Update(POLY1305 *ctx, const unsigned char *inp, size_t len)
467. {
468. #ifdef POLY1305_ASM
crypto/poly1305/poly1305.c:466:1: Parameter `len`
464. #endif
465.
466. > void Poly1305_Update(POLY1305 *ctx, const unsigned char *inp, size_t len)
467. {
468. #ifdef POLY1305_ASM
crypto/poly1305/poly1305.c:466:1: <RHS trace>
464. #endif
465.
466. > void Poly1305_Update(POLY1305 *ctx, const unsigned char *inp, size_t len)
467. {
468. #ifdef POLY1305_ASM
crypto/poly1305/poly1305.c:466:1: Parameter `len`
464. #endif
465.
466. > void Poly1305_Update(POLY1305 *ctx, const unsigned char *inp, size_t len)
467. {
468. #ifdef POLY1305_ASM
crypto/poly1305/poly1305.c:485:13: Binary operation: ([0, +oo] - [2-max(1, ctx->cipher_data->num), 15]):unsigned64 by call to `Poly1305_Update`
483. poly1305_blocks(ctx->opaque, ctx->data, POLY1305_BLOCK_SIZE, 1);
484. inp += rem;
485. len -= rem;
^
486. } else {
487. /* Still not enough data to process a block. */
|
https://github.com/openssl/openssl/blob/740b2b9a6cf31b02916a4d18f868e8a95934c083/crypto/poly1305/poly1305.c/#L485
|
d2a_code_trace_data_43004
|
static int mov_read_dref(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
{
AVStream *st = c->fc->streams[c->fc->nb_streams-1];
MOVStreamContext *sc = st->priv_data;
int entries, i, j;
get_be32(pb);
entries = get_be32(pb);
if (entries >= UINT_MAX / sizeof(*sc->drefs))
return -1;
sc->drefs_count = entries;
sc->drefs = av_mallocz(entries * sizeof(*sc->drefs));
for (i = 0; i < sc->drefs_count; i++) {
MOV_dref_t *dref = &sc->drefs[i];
uint32_t size = get_be32(pb);
offset_t next = url_ftell(pb) + size - 4;
dref->type = get_le32(pb);
get_be32(pb);
dprintf(c->fc, "type %.4s size %d\n", (char*)&dref->type, size);
if (dref->type == MKTAG('a','l','i','s') && size > 150) {
uint16_t volume_len, len;
char volume[28];
int16_t type;
url_fskip(pb, 10);
volume_len = get_byte(pb);
volume_len = FFMIN(volume_len, 27);
get_buffer(pb, volume, 27);
volume[volume_len] = 0;
av_log(c->fc, AV_LOG_DEBUG, "volume %s, len %d\n", volume, volume_len);
url_fskip(pb, 112);
for (type = 0; type != -1 && url_ftell(pb) < next; ) {
type = get_be16(pb);
len = get_be16(pb);
av_log(c->fc, AV_LOG_DEBUG, "type %d, len %d\n", type, len);
if (len&1)
len += 1;
if (type == 2) {
av_free(dref->path);
dref->path = av_mallocz(len+1);
if (!dref->path)
return AVERROR(ENOMEM);
get_buffer(pb, dref->path, len);
if (len > volume_len && !strncmp(dref->path, volume, volume_len)) {
len -= volume_len;
memmove(dref->path, dref->path+volume_len, len);
dref->path[len] = 0;
}
for (j = 0; j < len; j++)
if (dref->path[j] == ':')
dref->path[j] = '/';
av_log(c->fc, AV_LOG_DEBUG, "path %s\n", dref->path);
} else
url_fskip(pb, len);
}
}
url_fseek(pb, next, SEEK_SET);
}
return 0;
}
libavformat/mov.c:283: error: Integer Overflow L2
([1, +oo] - [0, 27]):unsigned16.
libavformat/mov.c:263:26: <LHS trace>
261.
262. volume_len = get_byte(pb);
263. volume_len = FFMIN(volume_len, 27);
^
264. get_buffer(pb, volume, 27);
265. volume[volume_len] = 0;
libavformat/mov.c:263:26: Assignment
261.
262. volume_len = get_byte(pb);
263. volume_len = FFMIN(volume_len, 27);
^
264. get_buffer(pb, volume, 27);
265. volume[volume_len] = 0;
libavformat/mov.c:263:13: Assignment
261.
262. volume_len = get_byte(pb);
263. volume_len = FFMIN(volume_len, 27);
^
264. get_buffer(pb, volume, 27);
265. volume[volume_len] = 0;
libavformat/mov.c:263:26: <RHS trace>
261.
262. volume_len = get_byte(pb);
263. volume_len = FFMIN(volume_len, 27);
^
264. get_buffer(pb, volume, 27);
265. volume[volume_len] = 0;
libavformat/mov.c:263:26: Assignment
261.
262. volume_len = get_byte(pb);
263. volume_len = FFMIN(volume_len, 27);
^
264. get_buffer(pb, volume, 27);
265. volume[volume_len] = 0;
libavformat/mov.c:263:13: Assignment
261.
262. volume_len = get_byte(pb);
263. volume_len = FFMIN(volume_len, 27);
^
264. get_buffer(pb, volume, 27);
265. volume[volume_len] = 0;
libavformat/mov.c:283:25: Binary operation: ([1, +oo] - [0, 27]):unsigned16
281. get_buffer(pb, dref->path, len);
282. if (len > volume_len && !strncmp(dref->path, volume, volume_len)) {
283. len -= volume_len;
^
284. memmove(dref->path, dref->path+volume_len, len);
285. dref->path[len] = 0;
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavformat/mov.c/#L283
|
d2a_code_trace_data_43005
|
BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
{
int i;
BN_ULONG *A;
const BN_ULONG *B;
bn_check_top(b);
if (a == b)
return (a);
if (bn_wexpand(a, b->top) == NULL)
return (NULL);
#if 1
A = a->d;
B = b->d;
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
memcpy(a->d, b->d, sizeof(b->d[0]) * b->top);
#endif
a->top = b->top;
a->neg = b->neg;
bn_check_top(a);
return (a);
}
crypto/rsa/rsa_ossl.c:616: error: BUFFER_OVERRUN_L3
Offset: [3, +oo] (⇐ [0, +oo] + 3) Size: [0, 8388607] by call to `BN_MONT_CTX_set_locked`.
Showing all 12 steps of the trace
crypto/rsa/rsa_ossl.c:610:9: Call
608. goto err;
609. }
610. BN_with_flags(p, rsa->p, BN_FLG_CONSTTIME);
^
611. BN_with_flags(q, rsa->q, BN_FLG_CONSTTIME);
612.
crypto/bn/bn_lib.c:949:1: Parameter `*b->d`
947. }
948.
949. > void BN_with_flags(BIGNUM *dest, const BIGNUM *b, int flags)
950. {
951. dest->d = b->d;
crypto/bn/bn_lib.c:951:5: Assignment
949. void BN_with_flags(BIGNUM *dest, const BIGNUM *b, int flags)
950. {
951. dest->d = b->d;
^
952. dest->top = b->top;
953. dest->dmax = b->dmax;
crypto/rsa/rsa_ossl.c:616:21: Call
614. if (!BN_MONT_CTX_set_locked
615. (&rsa->_method_mod_p, rsa->lock, p, ctx)
616. || !BN_MONT_CTX_set_locked(&rsa->_method_mod_q,
^
617. rsa->lock, q, ctx)) {
618. BN_free(p);
crypto/bn/bn_mont.c:398:1: Parameter `*mod->d`
396. }
397.
398. > BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, CRYPTO_RWLOCK *lock,
399. const BIGNUM *mod, BN_CTX *ctx)
400. {
crypto/bn/bn_mont.c:420:10: Call
418. if (ret == NULL)
419. return NULL;
420. if (!BN_MONT_CTX_set(ret, mod, ctx)) {
^
421. BN_MONT_CTX_free(ret);
422. return NULL;
crypto/bn/bn_mont.c:247:1: Parameter `*mod->d`
245. }
246.
247. > int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
248. {
249. int ret = 0;
crypto/bn/bn_mont.c:259:10: Call
257. goto err;
258. R = &(mont->RR); /* grab RR as a temp */
259. if (!BN_copy(&(mont->N), mod))
^
260. goto err; /* Set N */
261. mont->N.neg = 0;
crypto/bn/bn_lib.c:362:1: <Length trace>
360. }
361.
362. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
363. {
364. int i;
crypto/bn/bn_lib.c:362:1: Parameter `*b->d`
360. }
361.
362. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
363. {
364. int i;
crypto/bn/bn_lib.c:377:5: Assignment
375. #if 1
376. A = a->d;
377. B = b->d;
^
378. for (i = b->top >> 2; i > 0; i--, A += 4, B += 4) {
379. BN_ULONG a0, a1, a2, a3;
crypto/bn/bn_lib.c:383:14: Array access: Offset: [3, +oo] (⇐ [0, +oo] + 3) Size: [0, 8388607] by call to `BN_MONT_CTX_set_locked`
381. a1 = B[1];
382. a2 = B[2];
383. a3 = B[3];
^
384. A[0] = a0;
385. A[1] = a1;
|
https://github.com/openssl/openssl/blob/ec772a817afc0f788c38006f623204a7d76221ec/crypto/bn/bn_lib.c/#L383
|
d2a_code_trace_data_43006
|
STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method,
STACK_OF(SSL_CIPHER) **cipher_list,
STACK_OF(SSL_CIPHER) **cipher_list_by_id,
const char *rule_str, CERT *c)
{
int ok, num_of_ciphers, num_of_alias_max, num_of_group_aliases;
unsigned long disabled_mkey, disabled_auth, disabled_enc, disabled_mac, disabled_ssl;
STACK_OF(SSL_CIPHER) *cipherstack, *tmp_cipher_list;
const char *rule_p;
CIPHER_ORDER *co_list = NULL, *head = NULL, *tail = NULL, *curr;
const SSL_CIPHER **ca_list = NULL;
if (rule_str == NULL || cipher_list == NULL || cipher_list_by_id == NULL)
return NULL;
#ifndef OPENSSL_NO_EC
if (!check_suiteb_cipher_list(ssl_method, c, &rule_str))
return NULL;
#endif
ssl_cipher_get_disabled(&disabled_mkey, &disabled_auth, &disabled_enc, &disabled_mac, &disabled_ssl);
num_of_ciphers = ssl_method->num_ciphers();
#ifdef KSSL_DEBUG
printf("ssl_create_cipher_list() for %d ciphers\n", num_of_ciphers);
#endif
co_list = (CIPHER_ORDER *)OPENSSL_malloc(sizeof(CIPHER_ORDER) * num_of_ciphers);
if (co_list == NULL)
{
SSLerr(SSL_F_SSL_CREATE_CIPHER_LIST,ERR_R_MALLOC_FAILURE);
return(NULL);
}
ssl_cipher_collect_ciphers(ssl_method, num_of_ciphers,
disabled_mkey, disabled_auth, disabled_enc, disabled_mac, disabled_ssl,
co_list, &head, &tail);
ssl_cipher_apply_rule(0, SSL_kECDHE, 0, 0, 0, 0, 0, CIPHER_ADD, -1, &head, &tail);
ssl_cipher_apply_rule(0, SSL_kECDHE, 0, 0, 0, 0, 0, CIPHER_DEL, -1, &head, &tail);
ssl_cipher_apply_rule(0, 0, 0, SSL_AES, 0, 0, 0, CIPHER_ADD, -1, &head, &tail);
ssl_cipher_apply_rule(0, 0, 0, 0, 0, 0, 0, CIPHER_ADD, -1, &head, &tail);
ssl_cipher_apply_rule(0, 0, 0, 0, SSL_MD5, 0, 0, CIPHER_ORD, -1, &head, &tail);
ssl_cipher_apply_rule(0, 0, SSL_aNULL, 0, 0, 0, 0, CIPHER_ORD, -1, &head, &tail);
ssl_cipher_apply_rule(0, 0, SSL_aECDH, 0, 0, 0, 0, CIPHER_ORD, -1, &head, &tail);
ssl_cipher_apply_rule(0, SSL_kRSA, 0, 0, 0, 0, 0, CIPHER_ORD, -1, &head, &tail);
ssl_cipher_apply_rule(0, SSL_kPSK, 0,0, 0, 0, 0, CIPHER_ORD, -1, &head, &tail);
ssl_cipher_apply_rule(0, SSL_kKRB5, 0,0, 0, 0, 0, CIPHER_ORD, -1, &head, &tail);
ssl_cipher_apply_rule(0, 0, 0, SSL_RC4, 0, 0, 0, CIPHER_ORD, -1, &head, &tail);
if (!ssl_cipher_strength_sort(&head, &tail))
{
OPENSSL_free(co_list);
return NULL;
}
ssl_cipher_apply_rule(0, 0, 0, 0, 0, 0, 0, CIPHER_DEL, -1, &head, &tail);
num_of_group_aliases = sizeof(cipher_aliases) / sizeof(SSL_CIPHER);
num_of_alias_max = num_of_ciphers + num_of_group_aliases + 1;
ca_list = OPENSSL_malloc(sizeof(SSL_CIPHER *) * num_of_alias_max);
if (ca_list == NULL)
{
OPENSSL_free(co_list);
SSLerr(SSL_F_SSL_CREATE_CIPHER_LIST,ERR_R_MALLOC_FAILURE);
return(NULL);
}
ssl_cipher_collect_aliases(ca_list, num_of_group_aliases,
disabled_mkey, disabled_auth, disabled_enc,
disabled_mac, disabled_ssl, head);
ok = 1;
rule_p = rule_str;
if (strncmp(rule_str,"DEFAULT",7) == 0)
{
ok = ssl_cipher_process_rulestr(SSL_DEFAULT_CIPHER_LIST,
&head, &tail, ca_list, c);
rule_p += 7;
if (*rule_p == ':')
rule_p++;
}
if (ok && (strlen(rule_p) > 0))
ok = ssl_cipher_process_rulestr(rule_p, &head, &tail, ca_list, c);
OPENSSL_free((void *)ca_list);
if (!ok)
{
OPENSSL_free(co_list);
return(NULL);
}
if ((cipherstack = sk_SSL_CIPHER_new_null()) == NULL)
{
OPENSSL_free(co_list);
return(NULL);
}
for (curr = head; curr != NULL; curr = curr->next)
{
#ifdef OPENSSL_FIPS
if (curr->active && (!FIPS_mode() || curr->cipher->algo_strength & SSL_FIPS))
#else
if (curr->active)
#endif
{
sk_SSL_CIPHER_push(cipherstack, curr->cipher);
#ifdef CIPHER_DEBUG
printf("<%s>\n",curr->cipher->name);
#endif
}
}
OPENSSL_free(co_list);
tmp_cipher_list = sk_SSL_CIPHER_dup(cipherstack);
if (tmp_cipher_list == NULL)
{
sk_SSL_CIPHER_free(cipherstack);
return NULL;
}
if (*cipher_list != NULL)
sk_SSL_CIPHER_free(*cipher_list);
*cipher_list = cipherstack;
if (*cipher_list_by_id != NULL)
sk_SSL_CIPHER_free(*cipher_list_by_id);
*cipher_list_by_id = tmp_cipher_list;
(void)sk_SSL_CIPHER_set_cmp_func(*cipher_list_by_id,ssl_cipher_ptr_id_cmp);
sk_SSL_CIPHER_sort(*cipher_list_by_id);
return(cipherstack);
}
ssl/ssl_lib.c:264: error: BUFFER_OVERRUN_L3
Offset: 7 Size: [6, 25] by call to `ssl_create_cipher_list`.
Showing all 9 steps of the trace
ssl/ssl_lib.c:266:3: Array declaration
264. sk=ssl_create_cipher_list(ctx->method,&(ctx->cipher_list),
265. &(ctx->cipher_list_by_id),
266. meth->version == SSL2_VERSION ? "SSLv2" : SSL_DEFAULT_CIPHER_LIST, ctx->cert);
^
267. if ((sk == NULL) || (sk_SSL_CIPHER_num(sk) <= 0))
268. {
ssl/ssl_lib.c:264:5: Call
262. ctx->method=meth;
263.
264. sk=ssl_create_cipher_list(ctx->method,&(ctx->cipher_list),
^
265. &(ctx->cipher_list_by_id),
266. meth->version == SSL2_VERSION ? "SSLv2" : SSL_DEFAULT_CIPHER_LIST, ctx->cert);
ssl/ssl_ciph.c:1460:1: <Length trace>
1458. #endif
1459.
1460. > STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method,
1461. STACK_OF(SSL_CIPHER) **cipher_list,
1462. STACK_OF(SSL_CIPHER) **cipher_list_by_id,
ssl/ssl_ciph.c:1460:1: Parameter `*rule_str`
1458. #endif
1459.
1460. > STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method,
1461. STACK_OF(SSL_CIPHER) **cipher_list,
1462. STACK_OF(SSL_CIPHER) **cipher_list_by_id,
ssl/ssl_ciph.c:1478:7: Call
1476. return NULL;
1477. #ifndef OPENSSL_NO_EC
1478. if (!check_suiteb_cipher_list(ssl_method, c, &rule_str))
^
1479. return NULL;
1480. #endif
ssl/ssl_ciph.c:1400:1: Parameter `**prule_str`
1398. }
1399. #ifndef OPENSSL_NO_EC
1400. > static int check_suiteb_cipher_list(const SSL_METHOD *meth, CERT *c,
1401. const char **prule_str)
1402. {
ssl/ssl_ciph.c:1577:2: Assignment
1575. */
1576. ok = 1;
1577. rule_p = rule_str;
^
1578. if (strncmp(rule_str,"DEFAULT",7) == 0)
1579. {
ssl/ssl_ciph.c:1582:3: Assignment
1580. ok = ssl_cipher_process_rulestr(SSL_DEFAULT_CIPHER_LIST,
1581. &head, &tail, ca_list, c);
1582. rule_p += 7;
^
1583. if (*rule_p == ':')
1584. rule_p++;
ssl/ssl_ciph.c:1583:7: Array access: Offset: 7 Size: [6, 25] by call to `ssl_create_cipher_list`
1581. &head, &tail, ca_list, c);
1582. rule_p += 7;
1583. if (*rule_p == ':')
^
1584. rule_p++;
1585. }
|
https://github.com/openssl/openssl/blob/dbb7654dc189992966ecd95ca66f7a3bb011ab9b/ssl/ssl_ciph.c/#L1583
|
d2a_code_trace_data_43007
|
int OBJ_NAME_new_index(unsigned long (*hash_func) (const char *),
int (*cmp_func) (const char *, const char *),
void (*free_func) (const char *, int, const char *))
{
int ret;
int i;
NAME_FUNCS *name_funcs;
if (name_funcs_stack == NULL) {
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
name_funcs_stack = sk_NAME_FUNCS_new_null();
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
}
if (name_funcs_stack == NULL) {
return (0);
}
ret = names_type_num;
names_type_num++;
for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) {
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
name_funcs = OPENSSL_zalloc(sizeof(*name_funcs));
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
if (name_funcs == NULL) {
OBJerr(OBJ_F_OBJ_NAME_NEW_INDEX, ERR_R_MALLOC_FAILURE);
return (0);
}
name_funcs->hash_func = lh_strhash;
name_funcs->cmp_func = OPENSSL_strcmp;
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
sk_NAME_FUNCS_push(name_funcs_stack, name_funcs);
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
}
name_funcs = sk_NAME_FUNCS_value(name_funcs_stack, ret);
if (hash_func != NULL)
name_funcs->hash_func = hash_func;
if (cmp_func != NULL)
name_funcs->cmp_func = cmp_func;
if (free_func != NULL)
name_funcs->free_func = free_func;
return (ret);
}
crypto/objects/o_names.c:94: error: MEMORY_LEAK
memory dynamically allocated by call to `CRYPTO_zalloc()` at line 85, column 22 is not reachable after line 94, column 9.
Showing all 164 steps of the trace
crypto/objects/o_names.c:64:1: start of procedure OBJ_NAME_new_index()
62. }
63.
64. > int OBJ_NAME_new_index(unsigned long (*hash_func) (const char *),
65. int (*cmp_func) (const char *, const char *),
66. void (*free_func) (const char *, int, const char *))
crypto/objects/o_names.c:72:9: Taking true branch
70. NAME_FUNCS *name_funcs;
71.
72. if (name_funcs_stack == NULL) {
^
73. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
74. name_funcs_stack = sk_NAME_FUNCS_new_null();
crypto/objects/o_names.c:73:9:
71.
72. if (name_funcs_stack == NULL) {
73. > CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
74. name_funcs_stack = sk_NAME_FUNCS_new_null();
75. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
crypto/mem_dbg.c:206:1: start of procedure CRYPTO_mem_ctrl()
204. #endif
205.
206. > int CRYPTO_mem_ctrl(int mode)
207. {
208. #ifdef OPENSSL_NO_CRYPTO_MDEBUG
crypto/mem_dbg.c:209:5:
207. {
208. #ifdef OPENSSL_NO_CRYPTO_MDEBUG
209. > return mode - mode;
210. #else
211. int ret = mh_mode;
crypto/mem_dbg.c:275:1: return from a call to CRYPTO_mem_ctrl
273. return (ret);
274. #endif
275. > }
276.
277. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
crypto/objects/o_names.c:74:9:
72. if (name_funcs_stack == NULL) {
73. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
74. > name_funcs_stack = sk_NAME_FUNCS_new_null();
75. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
76. }
crypto/objects/o_names.h:4:1: start of procedure sk_NAME_FUNCS_new_null()
2.
3. typedef struct name_funcs_st NAME_FUNCS;
4. > DEFINE_STACK_OF(NAME_FUNCS)
crypto/stack/stack.c:145:1: start of procedure sk_new_null()
143. }
144.
145. > _STACK *sk_new_null(void)
146. {
147. return sk_new((int (*)(const void *, const void *))0);
crypto/stack/stack.c:147:5:
145. _STACK *sk_new_null(void)
146. {
147. > return sk_new((int (*)(const void *, const void *))0);
148. }
149.
crypto/stack/stack.c:150:1: start of procedure sk_new()
148. }
149.
150. > _STACK *sk_new(int (*c) (const void *, const void *))
151. {
152. _STACK *ret;
crypto/stack/stack.c:154:9:
152. _STACK *ret;
153.
154. > if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL)
155. goto err;
156. if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL)
crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
155. }
156.
157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:159:5:
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. > void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:161:9: Taking true branch
159. void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
^
162. memset(ret, 0, num);
163. return ret;
crypto/mem.c:162:9:
160.
161. if (ret != NULL)
162. > memset(ret, 0, num);
163. return ret;
164. }
crypto/mem.c:163:5:
161. if (ret != NULL)
162. memset(ret, 0, num);
163. > return ret;
164. }
165.
crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
162. memset(ret, 0, num);
163. return ret;
164. > }
165.
166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/stack/stack.c:154:9: Taking false branch
152. _STACK *ret;
153.
154. if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL)
^
155. goto err;
156. if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL)
crypto/stack/stack.c:156:9:
154. if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL)
155. goto err;
156. > if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL)
157. goto err;
158. ret->comp = c;
crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
155. }
156.
157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:159:5:
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. > void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:161:9: Taking true branch
159. void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
^
162. memset(ret, 0, num);
163. return ret;
crypto/mem.c:162:9:
160.
161. if (ret != NULL)
162. > memset(ret, 0, num);
163. return ret;
164. }
crypto/mem.c:163:5:
161. if (ret != NULL)
162. memset(ret, 0, num);
163. > return ret;
164. }
165.
crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
162. memset(ret, 0, num);
163. return ret;
164. > }
165.
166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/stack/stack.c:156:9: Taking false branch
154. if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL)
155. goto err;
156. if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL)
^
157. goto err;
158. ret->comp = c;
crypto/stack/stack.c:158:5:
156. if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL)
157. goto err;
158. > ret->comp = c;
159. ret->num_alloc = MIN_NODES;
160. return (ret);
crypto/stack/stack.c:159:5:
157. goto err;
158. ret->comp = c;
159. > ret->num_alloc = MIN_NODES;
160. return (ret);
161.
crypto/stack/stack.c:160:5:
158. ret->comp = c;
159. ret->num_alloc = MIN_NODES;
160. > return (ret);
161.
162. err:
crypto/stack/stack.c:165:1: return from a call to sk_new
163. OPENSSL_free(ret);
164. return (NULL);
165. > }
166.
167. int sk_insert(_STACK *st, void *data, int loc)
crypto/stack/stack.c:148:1: return from a call to sk_new_null
146. {
147. return sk_new((int (*)(const void *, const void *))0);
148. > }
149.
150. _STACK *sk_new(int (*c) (const void *, const void *))
crypto/objects/o_names.h:4:1: return from a call to sk_NAME_FUNCS_new_null
2.
3. typedef struct name_funcs_st NAME_FUNCS;
4. > DEFINE_STACK_OF(NAME_FUNCS)
crypto/objects/o_names.c:75:9:
73. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
74. name_funcs_stack = sk_NAME_FUNCS_new_null();
75. > CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
76. }
77. if (name_funcs_stack == NULL) {
crypto/mem_dbg.c:206:1: start of procedure CRYPTO_mem_ctrl()
204. #endif
205.
206. > int CRYPTO_mem_ctrl(int mode)
207. {
208. #ifdef OPENSSL_NO_CRYPTO_MDEBUG
crypto/mem_dbg.c:209:5:
207. {
208. #ifdef OPENSSL_NO_CRYPTO_MDEBUG
209. > return mode - mode;
210. #else
211. int ret = mh_mode;
crypto/mem_dbg.c:275:1: return from a call to CRYPTO_mem_ctrl
273. return (ret);
274. #endif
275. > }
276.
277. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
crypto/objects/o_names.c:77:9: Taking false branch
75. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
76. }
77. if (name_funcs_stack == NULL) {
^
78. /* ERROR */
79. return (0);
crypto/objects/o_names.c:81:5:
79. return (0);
80. }
81. > ret = names_type_num;
82. names_type_num++;
83. for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) {
crypto/objects/o_names.c:82:5:
80. }
81. ret = names_type_num;
82. > names_type_num++;
83. for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) {
84. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
crypto/objects/o_names.c:83:10:
81. ret = names_type_num;
82. names_type_num++;
83. > for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) {
84. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
85. name_funcs = OPENSSL_zalloc(sizeof(*name_funcs));
crypto/objects/o_names.h:4:1: start of procedure sk_NAME_FUNCS_num()
2.
3. typedef struct name_funcs_st NAME_FUNCS;
4. > DEFINE_STACK_OF(NAME_FUNCS)
crypto/stack/stack.c:317:1: start of procedure sk_num()
315. }
316.
317. > int sk_num(const _STACK *st)
318. {
319. if (st == NULL)
crypto/stack/stack.c:319:9: Taking false branch
317. int sk_num(const _STACK *st)
318. {
319. if (st == NULL)
^
320. return -1;
321. return st->num;
crypto/stack/stack.c:321:5:
319. if (st == NULL)
320. return -1;
321. > return st->num;
322. }
323.
crypto/stack/stack.c:322:1: return from a call to sk_num
320. return -1;
321. return st->num;
322. > }
323.
324. void *sk_value(const _STACK *st, int i)
crypto/objects/o_names.h:4:1: return from a call to sk_NAME_FUNCS_num
2.
3. typedef struct name_funcs_st NAME_FUNCS;
4. > DEFINE_STACK_OF(NAME_FUNCS)
crypto/objects/o_names.c:83:51: Loop condition is true. Entering loop body
81. ret = names_type_num;
82. names_type_num++;
83. for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) {
^
84. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
85. name_funcs = OPENSSL_zalloc(sizeof(*name_funcs));
crypto/objects/o_names.c:84:9:
82. names_type_num++;
83. for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) {
84. > CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
85. name_funcs = OPENSSL_zalloc(sizeof(*name_funcs));
86. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
crypto/mem_dbg.c:206:1: start of procedure CRYPTO_mem_ctrl()
204. #endif
205.
206. > int CRYPTO_mem_ctrl(int mode)
207. {
208. #ifdef OPENSSL_NO_CRYPTO_MDEBUG
crypto/mem_dbg.c:209:5:
207. {
208. #ifdef OPENSSL_NO_CRYPTO_MDEBUG
209. > return mode - mode;
210. #else
211. int ret = mh_mode;
crypto/mem_dbg.c:275:1: return from a call to CRYPTO_mem_ctrl
273. return (ret);
274. #endif
275. > }
276.
277. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
crypto/objects/o_names.c:85:9:
83. for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) {
84. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
85. > name_funcs = OPENSSL_zalloc(sizeof(*name_funcs));
86. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
87. if (name_funcs == 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/objects/o_names.c:86:9:
84. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
85. name_funcs = OPENSSL_zalloc(sizeof(*name_funcs));
86. > CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
87. if (name_funcs == NULL) {
88. OBJerr(OBJ_F_OBJ_NAME_NEW_INDEX, ERR_R_MALLOC_FAILURE);
crypto/mem_dbg.c:206:1: start of procedure CRYPTO_mem_ctrl()
204. #endif
205.
206. > int CRYPTO_mem_ctrl(int mode)
207. {
208. #ifdef OPENSSL_NO_CRYPTO_MDEBUG
crypto/mem_dbg.c:209:5:
207. {
208. #ifdef OPENSSL_NO_CRYPTO_MDEBUG
209. > return mode - mode;
210. #else
211. int ret = mh_mode;
crypto/mem_dbg.c:275:1: return from a call to CRYPTO_mem_ctrl
273. return (ret);
274. #endif
275. > }
276.
277. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
crypto/objects/o_names.c:87:13: Taking false branch
85. name_funcs = OPENSSL_zalloc(sizeof(*name_funcs));
86. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
87. if (name_funcs == NULL) {
^
88. OBJerr(OBJ_F_OBJ_NAME_NEW_INDEX, ERR_R_MALLOC_FAILURE);
89. return (0);
crypto/objects/o_names.c:91:9:
89. return (0);
90. }
91. > name_funcs->hash_func = lh_strhash;
92. name_funcs->cmp_func = OPENSSL_strcmp;
93. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
crypto/objects/o_names.c:92:9:
90. }
91. name_funcs->hash_func = lh_strhash;
92. > name_funcs->cmp_func = OPENSSL_strcmp;
93. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
94. sk_NAME_FUNCS_push(name_funcs_stack, name_funcs);
crypto/objects/o_names.c:93:9:
91. name_funcs->hash_func = lh_strhash;
92. name_funcs->cmp_func = OPENSSL_strcmp;
93. > CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
94. sk_NAME_FUNCS_push(name_funcs_stack, name_funcs);
95. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
crypto/mem_dbg.c:206:1: start of procedure CRYPTO_mem_ctrl()
204. #endif
205.
206. > int CRYPTO_mem_ctrl(int mode)
207. {
208. #ifdef OPENSSL_NO_CRYPTO_MDEBUG
crypto/mem_dbg.c:209:5:
207. {
208. #ifdef OPENSSL_NO_CRYPTO_MDEBUG
209. > return mode - mode;
210. #else
211. int ret = mh_mode;
crypto/mem_dbg.c:275:1: return from a call to CRYPTO_mem_ctrl
273. return (ret);
274. #endif
275. > }
276.
277. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
crypto/objects/o_names.c:94:9:
92. name_funcs->cmp_func = OPENSSL_strcmp;
93. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
94. > sk_NAME_FUNCS_push(name_funcs_stack, name_funcs);
95. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
96. }
crypto/objects/o_names.h:4:1: start of procedure sk_NAME_FUNCS_push()
2.
3. typedef struct name_funcs_st NAME_FUNCS;
4. > DEFINE_STACK_OF(NAME_FUNCS)
crypto/stack/stack.c:259:1: start of procedure sk_push()
257. }
258.
259. > int sk_push(_STACK *st, void *data)
260. {
261. return (sk_insert(st, data, st->num));
crypto/stack/stack.c:261:5:
259. int sk_push(_STACK *st, void *data)
260. {
261. > return (sk_insert(st, data, st->num));
262. }
263.
crypto/stack/stack.c:167:1: start of procedure sk_insert()
165. }
166.
167. > int sk_insert(_STACK *st, void *data, int loc)
168. {
169. char **s;
crypto/stack/stack.c:171:9: Taking false branch
169. char **s;
170.
171. if (st == NULL)
^
172. return 0;
173. if (st->num_alloc <= st->num + 1) {
crypto/stack/stack.c:173:9: Taking false branch
171. if (st == NULL)
172. return 0;
173. if (st->num_alloc <= st->num + 1) {
^
174. s = OPENSSL_realloc((char *)st->data,
175. (unsigned int)sizeof(char *) * st->num_alloc * 2);
crypto/stack/stack.c:181:10: Taking true branch
179. st->num_alloc *= 2;
180. }
181. if ((loc >= (int)st->num) || (loc < 0))
^
182. st->data[st->num] = data;
183. else {
crypto/stack/stack.c:182:9:
180. }
181. if ((loc >= (int)st->num) || (loc < 0))
182. > st->data[st->num] = data;
183. else {
184. memmove(&(st->data[loc + 1]),
crypto/stack/stack.c:188:5:
186. st->data[loc] = data;
187. }
188. > st->num++;
189. st->sorted = 0;
190. return (st->num);
crypto/stack/stack.c:189:5:
187. }
188. st->num++;
189. > st->sorted = 0;
190. return (st->num);
191. }
crypto/stack/stack.c:190:5:
188. st->num++;
189. st->sorted = 0;
190. > return (st->num);
191. }
192.
crypto/stack/stack.c:191:1: return from a call to sk_insert
189. st->sorted = 0;
190. return (st->num);
191. > }
192.
193. void *sk_delete_ptr(_STACK *st, void *p)
crypto/stack/stack.c:262:1: return from a call to sk_push
260. {
261. return (sk_insert(st, data, st->num));
262. > }
263.
264. int sk_unshift(_STACK *st, void *data)
crypto/objects/o_names.h:4:1: return from a call to sk_NAME_FUNCS_push
2.
3. typedef struct name_funcs_st NAME_FUNCS;
4. > DEFINE_STACK_OF(NAME_FUNCS)
crypto/objects/o_names.c:95:9:
93. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
94. sk_NAME_FUNCS_push(name_funcs_stack, name_funcs);
95. > CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
96. }
97. name_funcs = sk_NAME_FUNCS_value(name_funcs_stack, ret);
crypto/mem_dbg.c:206:1: start of procedure CRYPTO_mem_ctrl()
204. #endif
205.
206. > int CRYPTO_mem_ctrl(int mode)
207. {
208. #ifdef OPENSSL_NO_CRYPTO_MDEBUG
crypto/mem_dbg.c:209:5:
207. {
208. #ifdef OPENSSL_NO_CRYPTO_MDEBUG
209. > return mode - mode;
210. #else
211. int ret = mh_mode;
crypto/mem_dbg.c:275:1: return from a call to CRYPTO_mem_ctrl
273. return (ret);
274. #endif
275. > }
276.
277. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
crypto/objects/o_names.c:83:71:
81. ret = names_type_num;
82. names_type_num++;
83. > for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) {
84. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
85. name_funcs = OPENSSL_zalloc(sizeof(*name_funcs));
crypto/objects/o_names.c:83:51: Loop condition is true. Entering loop body
81. ret = names_type_num;
82. names_type_num++;
83. for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) {
^
84. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
85. name_funcs = OPENSSL_zalloc(sizeof(*name_funcs));
crypto/objects/o_names.c:84:9:
82. names_type_num++;
83. for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) {
84. > CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
85. name_funcs = OPENSSL_zalloc(sizeof(*name_funcs));
86. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
crypto/mem_dbg.c:206:1: start of procedure CRYPTO_mem_ctrl()
204. #endif
205.
206. > int CRYPTO_mem_ctrl(int mode)
207. {
208. #ifdef OPENSSL_NO_CRYPTO_MDEBUG
crypto/mem_dbg.c:209:5:
207. {
208. #ifdef OPENSSL_NO_CRYPTO_MDEBUG
209. > return mode - mode;
210. #else
211. int ret = mh_mode;
crypto/mem_dbg.c:275:1: return from a call to CRYPTO_mem_ctrl
273. return (ret);
274. #endif
275. > }
276.
277. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
crypto/objects/o_names.c:85:9:
83. for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) {
84. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
85. > name_funcs = OPENSSL_zalloc(sizeof(*name_funcs));
86. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
87. if (name_funcs == 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/objects/o_names.c:86:9:
84. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
85. name_funcs = OPENSSL_zalloc(sizeof(*name_funcs));
86. > CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
87. if (name_funcs == NULL) {
88. OBJerr(OBJ_F_OBJ_NAME_NEW_INDEX, ERR_R_MALLOC_FAILURE);
crypto/mem_dbg.c:206:1: start of procedure CRYPTO_mem_ctrl()
204. #endif
205.
206. > int CRYPTO_mem_ctrl(int mode)
207. {
208. #ifdef OPENSSL_NO_CRYPTO_MDEBUG
crypto/mem_dbg.c:209:5:
207. {
208. #ifdef OPENSSL_NO_CRYPTO_MDEBUG
209. > return mode - mode;
210. #else
211. int ret = mh_mode;
crypto/mem_dbg.c:275:1: return from a call to CRYPTO_mem_ctrl
273. return (ret);
274. #endif
275. > }
276.
277. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
crypto/objects/o_names.c:87:13: Taking false branch
85. name_funcs = OPENSSL_zalloc(sizeof(*name_funcs));
86. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
87. if (name_funcs == NULL) {
^
88. OBJerr(OBJ_F_OBJ_NAME_NEW_INDEX, ERR_R_MALLOC_FAILURE);
89. return (0);
crypto/objects/o_names.c:91:9:
89. return (0);
90. }
91. > name_funcs->hash_func = lh_strhash;
92. name_funcs->cmp_func = OPENSSL_strcmp;
93. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
crypto/objects/o_names.c:92:9:
90. }
91. name_funcs->hash_func = lh_strhash;
92. > name_funcs->cmp_func = OPENSSL_strcmp;
93. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
94. sk_NAME_FUNCS_push(name_funcs_stack, name_funcs);
crypto/objects/o_names.c:93:9:
91. name_funcs->hash_func = lh_strhash;
92. name_funcs->cmp_func = OPENSSL_strcmp;
93. > CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
94. sk_NAME_FUNCS_push(name_funcs_stack, name_funcs);
95. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
crypto/mem_dbg.c:206:1: start of procedure CRYPTO_mem_ctrl()
204. #endif
205.
206. > int CRYPTO_mem_ctrl(int mode)
207. {
208. #ifdef OPENSSL_NO_CRYPTO_MDEBUG
crypto/mem_dbg.c:209:5:
207. {
208. #ifdef OPENSSL_NO_CRYPTO_MDEBUG
209. > return mode - mode;
210. #else
211. int ret = mh_mode;
crypto/mem_dbg.c:275:1: return from a call to CRYPTO_mem_ctrl
273. return (ret);
274. #endif
275. > }
276.
277. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
crypto/objects/o_names.c:94:9:
92. name_funcs->cmp_func = OPENSSL_strcmp;
93. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
94. > sk_NAME_FUNCS_push(name_funcs_stack, name_funcs);
95. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
96. }
crypto/objects/o_names.h:4:1: start of procedure sk_NAME_FUNCS_push()
2.
3. typedef struct name_funcs_st NAME_FUNCS;
4. > DEFINE_STACK_OF(NAME_FUNCS)
crypto/stack/stack.c:259:1: start of procedure sk_push()
257. }
258.
259. > int sk_push(_STACK *st, void *data)
260. {
261. return (sk_insert(st, data, st->num));
crypto/stack/stack.c:261:5:
259. int sk_push(_STACK *st, void *data)
260. {
261. > return (sk_insert(st, data, st->num));
262. }
263.
crypto/stack/stack.c:167:1: start of procedure sk_insert()
165. }
166.
167. > int sk_insert(_STACK *st, void *data, int loc)
168. {
169. char **s;
crypto/stack/stack.c:171:9: Taking false branch
169. char **s;
170.
171. if (st == NULL)
^
172. return 0;
173. if (st->num_alloc <= st->num + 1) {
crypto/stack/stack.c:173:9: Taking false branch
171. if (st == NULL)
172. return 0;
173. if (st->num_alloc <= st->num + 1) {
^
174. s = OPENSSL_realloc((char *)st->data,
175. (unsigned int)sizeof(char *) * st->num_alloc * 2);
crypto/stack/stack.c:181:10: Taking true branch
179. st->num_alloc *= 2;
180. }
181. if ((loc >= (int)st->num) || (loc < 0))
^
182. st->data[st->num] = data;
183. else {
crypto/stack/stack.c:182:9:
180. }
181. if ((loc >= (int)st->num) || (loc < 0))
182. > st->data[st->num] = data;
183. else {
184. memmove(&(st->data[loc + 1]),
crypto/stack/stack.c:188:5:
186. st->data[loc] = data;
187. }
188. > st->num++;
189. st->sorted = 0;
190. return (st->num);
crypto/stack/stack.c:189:5:
187. }
188. st->num++;
189. > st->sorted = 0;
190. return (st->num);
191. }
crypto/stack/stack.c:190:5:
188. st->num++;
189. st->sorted = 0;
190. > return (st->num);
191. }
192.
crypto/stack/stack.c:191:1: return from a call to sk_insert
189. st->sorted = 0;
190. return (st->num);
191. > }
192.
193. void *sk_delete_ptr(_STACK *st, void *p)
crypto/stack/stack.c:262:1: return from a call to sk_push
260. {
261. return (sk_insert(st, data, st->num));
262. > }
263.
264. int sk_unshift(_STACK *st, void *data)
crypto/objects/o_names.h:4:1: return from a call to sk_NAME_FUNCS_push
2.
3. typedef struct name_funcs_st NAME_FUNCS;
4. > DEFINE_STACK_OF(NAME_FUNCS)
|
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/crypto/objects/o_names.c/#L94
|
d2a_code_trace_data_43008
|
static int asn1_get_length(const unsigned char **pp, int *inf, long *rl,
long max)
{
const unsigned char *p = *pp;
unsigned long ret = 0;
unsigned long i;
if (max-- < 1)
return 0;
if (*p == 0x80) {
*inf = 1;
ret = 0;
p++;
} else {
*inf = 0;
i = *p & 0x7f;
if (*(p++) & 0x80) {
if (max < (long)i + 1)
return 0;
while (i && *p == 0) {
p++;
i--;
}
if (i > sizeof(long))
return 0;
while (i-- > 0) {
ret <<= 8L;
ret |= *(p++);
}
} else
ret = i;
}
if (ret > LONG_MAX)
return 0;
*pp = p;
*rl = (long)ret;
return 1;
}
crypto/asn1/a_d2i_fp.c:117: error: BUFFER_OVERRUN_L3
Offset: [2, +oo] Size: [1, 2147483644] by call to `ASN1_item_d2i`.
Showing all 24 steps of the trace
crypto/asn1/a_d2i_fp.c:112:11: Call
110. int len;
111.
112. len = asn1_d2i_read_bio(in, &b);
^
113. if (len < 0)
114. goto err;
crypto/asn1/a_d2i_fp.c:166:38: Call
164. want -= (len - off);
165.
166. if (len + want < len || !BUF_MEM_grow_clean(b, len + want)) {
^
167. ASN1err(ASN1_F_ASN1_D2I_READ_BIO, ERR_R_MALLOC_FAILURE);
168. goto err;
crypto/buffer/buffer.c:157:1: Parameter `*str->data`
155. }
156.
157. > size_t BUF_MEM_grow_clean(BUF_MEM *str, size_t len)
158. {
159. char *ret;
crypto/asn1/a_d2i_fp.c:116:5: Assignment
114. goto err;
115.
116. p = (const unsigned char *)b->data;
^
117. ret = ASN1_item_d2i(x, &p, len, it);
118. err:
crypto/asn1/a_d2i_fp.c:117:11: Call
115.
116. p = (const unsigned char *)b->data;
117. ret = ASN1_item_d2i(x, &p, len, it);
^
118. err:
119. BUF_MEM_free(b);
crypto/asn1/tasn_dec.c:143:1: Parameter `**in`
141. */
142.
143. > ASN1_VALUE *ASN1_item_d2i(ASN1_VALUE **pval,
144. const unsigned char **in, long len,
145. const ASN1_ITEM *it)
crypto/asn1/tasn_dec.c:152:9: Call
150. pval = &ptmpval;
151. asn1_tlc_clear_nc(&c);
152. if (ASN1_item_ex_d2i(pval, in, len, it, -1, 0, 0, &c) > 0)
^
153. return *pval;
154. return NULL;
crypto/asn1/tasn_dec.c:157:1: Parameter `**in`
155. }
156.
157. > int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
158. const ASN1_ITEM *it,
159. int tag, int aclass, char opt, ASN1_TLC *ctx)
crypto/asn1/tasn_dec.c:162:10: Call
160. {
161. int rv;
162. rv = asn1_item_embed_d2i(pval, in, len, it, tag, aclass, opt, ctx);
^
163. if (rv <= 0)
164. ASN1_item_ex_free(pval, it);
crypto/asn1/tasn_dec.c:173:1: Parameter `**in`
171. */
172.
173. > static int asn1_item_embed_d2i(ASN1_VALUE **pval, const unsigned char **in,
174. long len, const ASN1_ITEM *it,
175. int tag, int aclass, char opt, ASN1_TLC *ctx)
crypto/asn1/tasn_dec.c:217:9: Assignment
215.
216. case ASN1_ITYPE_MSTRING:
217. p = *in;
^
218. /* Just read in tag and class */
219. ret = asn1_check_tlen(NULL, &otag, &oclass, NULL, NULL,
crypto/asn1/tasn_dec.c:219:15: Call
217. p = *in;
218. /* Just read in tag and class */
219. ret = asn1_check_tlen(NULL, &otag, &oclass, NULL, NULL,
^
220. &p, len, -1, 0, 1, ctx);
221. if (!ret) {
crypto/asn1/tasn_dec.c:1096:1: Parameter `**in`
1094. */
1095.
1096. > static int asn1_check_tlen(long *olen, int *otag, unsigned char *oclass,
1097. char *inf, char *cst,
1098. const unsigned char **in, long len,
crypto/asn1/tasn_dec.c:1105:5: Assignment
1103. long plen;
1104. const unsigned char *p, *q;
1105. p = *in;
^
1106. q = p;
1107.
crypto/asn1/tasn_dec.c:1115:13: Call
1113. p += ctx->hdrlen;
1114. } else {
1115. i = ASN1_get_object(&p, &plen, &ptag, &pclass, len);
^
1116. if (ctx) {
1117. ctx->ret = i;
crypto/asn1/asn1_lib.c:91:1: Parameter `**pp`
89. }
90.
91. > int ASN1_get_object(const unsigned char **pp, long *plength, int *ptag,
92. int *pclass, long omax)
93. {
crypto/asn1/asn1_lib.c:96:5: Assignment
94. int i, ret;
95. long l;
96. const unsigned char *p = *pp;
^
97. int tag, xclass, inf;
98. long max = omax;
crypto/asn1/asn1_lib.c:125:9: Assignment
123. } else {
124. tag = i;
125. p++;
^
126. if (--max == 0)
127. goto err;
crypto/asn1/asn1_lib.c:131:10: Call
129. *ptag = tag;
130. *pclass = xclass;
131. if (!asn1_get_length(&p, &inf, plength, max))
^
132. goto err;
133.
crypto/asn1/asn1_lib.c:152:1: <Length trace>
150. }
151.
152. > static int asn1_get_length(const unsigned char **pp, int *inf, long *rl,
153. long max)
154. {
crypto/asn1/asn1_lib.c:152:1: Parameter `**pp`
150. }
151.
152. > static int asn1_get_length(const unsigned char **pp, int *inf, long *rl,
153. long max)
154. {
crypto/asn1/asn1_lib.c:155:5: Assignment
153. long max)
154. {
155. const unsigned char *p = *pp;
^
156. unsigned long ret = 0;
157. unsigned long i;
crypto/asn1/asn1_lib.c:168:15: Assignment
166. *inf = 0;
167. i = *p & 0x7f;
168. if (*(p++) & 0x80) {
^
169. if (max < (long)i + 1)
170. return 0;
crypto/asn1/asn1_lib.c:172:25: Array access: Offset: [2, +oo] Size: [1, 2147483644] by call to `ASN1_item_d2i`
170. return 0;
171. /* Skip leading zeroes */
172. while (i && *p == 0) {
^
173. p++;
174. i--;
|
https://github.com/openssl/openssl/blob/79c7f74d6cefd5d32fa20e69195ad3de834ce065/crypto/asn1/asn1_lib.c/#L172
|
d2a_code_trace_data_43009
|
static void contract(LHASH *lh)
{
LHASH_NODE **n,*n1,*np;
np=lh->b[lh->p+lh->pmax-1];
lh->b[lh->p+lh->pmax-1]=NULL;
if (lh->p == 0)
{
n=(LHASH_NODE **)OPENSSL_realloc(lh->b,
(unsigned int)(sizeof(LHASH_NODE *)*lh->pmax));
if (n == NULL)
{
lh->error++;
return;
}
lh->num_contract_reallocs++;
lh->num_alloc_nodes/=2;
lh->pmax/=2;
lh->p=lh->pmax-1;
lh->b=n;
}
else
lh->p--;
lh->num_nodes--;
lh->num_contracts++;
n1=lh->b[(int)lh->p];
if (n1 == NULL)
lh->b[(int)lh->p]=np;
else
{
while (n1->next != NULL)
n1=n1->next;
n1->next=np;
}
}
apps/s_server.c:823: error: INTEGER_OVERFLOW_L2
([0, +oo] - 1):unsigned32 by call to `SSL_new`.
Showing all 16 steps of the trace
apps/s_server.c:823:7: Call
821.
822. if (con == NULL) {
823. con=SSL_new(ctx);
^
824. #ifndef NO_KRB5
825. if ((con->kssl_ctx = kssl_ctx_new()) != NULL)
ssl/ssl_lib.c:175:1: Parameter `ctx->sessions->p`
173. }
174.
175. > SSL *SSL_new(SSL_CTX *ctx)
176. {
177. SSL *s;
ssl/ssl_lib.c:239:2: Call
237. s->mode=ctx->mode;
238. s->read_ahead=ctx->read_ahead; /* used to happen in SSL_clear */
239. SSL_clear(s);
^
240.
241. CRYPTO_new_ex_data(ssl_meth,s,&s->ex_data);
ssl/ssl_lib.c:86:1: Parameter `s->ctx->sessions->p`
84. };
85.
86. > int SSL_clear(SSL *s)
87. {
88. int state;
ssl/ssl_lib.c:134:6: Call
132. ssl_clear_cipher_ctx(s);
133.
134. if (ssl_clear_bad_session(s))
^
135. {
136. SSL_SESSION_free(s->session);
ssl/ssl_sess.c:614:1: Parameter `s->ctx->sessions->p`
612. }
613.
614. > int ssl_clear_bad_session(SSL *s)
615. {
616. if ( (s->session != NULL) &&
ssl/ssl_sess.c:620:3: Call
618. !(SSL_in_init(s) || SSL_in_before(s)))
619. {
620. SSL_CTX_remove_session(s->ctx,s->session);
^
621. return(1);
622. }
ssl/ssl_sess.c:413:1: Parameter `ctx->sessions->p`
411. }
412.
413. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
414. {
415. return remove_session_lock(ctx, c, 1);
ssl/ssl_sess.c:415:9: Call
413. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
414. {
415. return remove_session_lock(ctx, c, 1);
^
416. }
417.
ssl/ssl_sess.c:418:1: Parameter `ctx->sessions->p`
416. }
417.
418. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck)
419. {
420. SSL_SESSION *r;
ssl/ssl_sess.c:426:20: Call
424. {
425. if(lck) CRYPTO_w_lock(CRYPTO_LOCK_SSL_CTX);
426. r=(SSL_SESSION *)lh_delete(ctx->sessions,c);
^
427. if (r != NULL)
428. {
crypto/lhash/lhash.c:217:1: Parameter `lh->pmax`
215. }
216.
217. > void *lh_delete(LHASH *lh, void *data)
218. {
219. unsigned long hash;
crypto/lhash/lhash.c:243:3: Call
241. if ((lh->num_nodes > MIN_NODES) &&
242. (lh->down_load >= (lh->num_items*LH_LOAD_MULT/lh->num_nodes)))
243. contract(lh);
^
244.
245. return(ret);
crypto/lhash/lhash.c:352:1: <LHS trace>
350. }
351.
352. > static void contract(LHASH *lh)
353. {
354. LHASH_NODE **n,*n1,*np;
crypto/lhash/lhash.c:352:1: Parameter `lh->p`
350. }
351.
352. > static void contract(LHASH *lh)
353. {
354. LHASH_NODE **n,*n1,*np;
crypto/lhash/lhash.c:356:5: Binary operation: ([0, +oo] - 1):unsigned32 by call to `SSL_new`
354. LHASH_NODE **n,*n1,*np;
355.
356. np=lh->b[lh->p+lh->pmax-1];
^
357. lh->b[lh->p+lh->pmax-1]=NULL; /* 24/07-92 - eay - weird but :-( */
358. if (lh->p == 0)
|
https://github.com/openssl/openssl/blob/f9b3bff6f7e38960bb87a5623fbcbc45ee952c49/crypto/lhash/lhash.c/#L356
|
d2a_code_trace_data_43010
|
static void contract(OPENSSL_LHASH *lh)
{
OPENSSL_LH_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 = OPENSSL_realloc(lh->b,
(unsigned int)(sizeof(OPENSSL_LH_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;
}
}
crypto/core_namemap.c:24: error: BUFFER_OVERRUN_L3
Offset: [-1, +oo] Size: [1, +oo] by call to `OPENSSL_LH_delete`.
Showing all 10 steps of the trace
crypto/core_namemap.c:24:1: Parameter `lh->pmax`
22. } NAMENUM_ENTRY;
23.
24. > DEFINE_LHASH_OF(NAMENUM_ENTRY);
25.
26. /*-
crypto/core_namemap.c:24:1: Call
22. } NAMENUM_ENTRY;
23.
24. > DEFINE_LHASH_OF(NAMENUM_ENTRY);
25.
26. /*-
crypto/lhash/lhash.c:137:1: Parameter `lh->pmax`
135. }
136.
137. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data)
138. {
139. unsigned long hash;
crypto/lhash/lhash.c:160:9: Call
158. if ((lh->num_nodes > MIN_NODES) &&
159. (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
160. contract(lh);
^
161.
162. return ret;
crypto/lhash/lhash.c:269:1: <Offset trace>
267. }
268.
269. > static void contract(OPENSSL_LHASH *lh)
270. {
271. OPENSSL_LH_NODE **n, *n1, *np;
crypto/lhash/lhash.c:269:1: Parameter `lh->p`
267. }
268.
269. > static void contract(OPENSSL_LHASH *lh)
270. {
271. OPENSSL_LH_NODE **n, *n1, *np;
crypto/lhash/lhash.c:289:9: Assignment
287. lh->b = n;
288. } else
289. lh->p--;
^
290.
291. lh->num_nodes--;
crypto/lhash/lhash.c:269:1: <Length trace>
267. }
268.
269. > static void contract(OPENSSL_LHASH *lh)
270. {
271. OPENSSL_LH_NODE **n, *n1, *np;
crypto/lhash/lhash.c:269:1: Parameter `*lh->b`
267. }
268.
269. > static void contract(OPENSSL_LHASH *lh)
270. {
271. OPENSSL_LH_NODE **n, *n1, *np;
crypto/lhash/lhash.c:294:10: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `OPENSSL_LH_delete`
292. lh->num_contracts++;
293.
294. n1 = lh->b[(int)lh->p];
^
295. if (n1 == NULL)
296. lh->b[(int)lh->p] = np;
|
https://github.com/openssl/openssl/blob/be1dc984e1a5938170188cbdb6e536f1e7ac1656/crypto/lhash/lhash.c/#L294
|
d2a_code_trace_data_43011
|
BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
{
bn_check_top(b);
if (a == b)
return a;
if (bn_wexpand(a, b->top) == NULL)
return NULL;
if (b->top > 0)
memcpy(a->d, b->d, sizeof(b->d[0]) * b->top);
a->neg = b->neg;
a->top = b->top;
a->flags |= b->flags & BN_FLG_FIXED_TOP;
bn_check_top(a);
return a;
}
crypto/ec/ec_key.c:395: error: BUFFER_OVERRUN_L3
Offset added: [8, +oo] Size: [0, 536870848] by call to `EC_POINT_mul`.
Showing all 16 steps of the trace
crypto/ec/ec_key.c:395:10: Call
393. }
394. /* 5.6.2.3.3 (Step 4) : pub_key * order is the point at infinity. */
395. if (!EC_POINT_mul(eckey->group, point, NULL, eckey->pub_key, order, ctx)) {
^
396. ECerr(EC_F_EC_KEY_SIMPLE_CHECK_KEY, ERR_R_EC_LIB);
397. goto err;
crypto/ec/ec_lib.c:971:1: Parameter `g_scalar->top`
969. }
970.
971. > int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *g_scalar,
972. const EC_POINT *point, const BIGNUM *p_scalar, BN_CTX *ctx)
973. {
crypto/ec/ec_lib.c:982:12: Call
980. scalars[0] = p_scalar;
981.
982. return EC_POINTs_mul(group, r, g_scalar,
^
983. (point != NULL
984. && p_scalar != NULL), points, scalars, ctx);
crypto/ec/ec_lib.c:933:1: Parameter `scalar->top`
931. */
932.
933. > int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
934. size_t num, const EC_POINT *points[],
935. const BIGNUM *scalars[], BN_CTX *ctx)
crypto/ec/ec_lib.c:965:15: Call
963. else
964. /* use default */
965. ret = ec_wNAF_mul(group, r, scalar, num, points, scalars, ctx);
^
966.
967. BN_CTX_free(new_ctx);
crypto/ec/ec_mult.c:410:1: Parameter `scalar->top`
408. * in the addition if scalar != NULL
409. */
410. > int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
411. size_t num, const EC_POINT *points[], const BIGNUM *scalars[],
412. BN_CTX *ctx)
crypto/ec/ec_mult.c:453:20: Call
451. * always call the ladder version.
452. */
453. return ec_scalar_mul_ladder(group, r, scalar, NULL, ctx);
^
454. }
455. if ((scalar == NULL) && (num == 1) && (scalars[0] != group->order)) {
crypto/ec/ec_mult.c:139:1: Parameter `scalar->top`
137. * Returns 1 on success, 0 otherwise.
138. */
139. > int ec_scalar_mul_ladder(const EC_GROUP *group, EC_POINT *r,
140. const BIGNUM *scalar, const EC_POINT *point,
141. BN_CTX *ctx)
crypto/ec/ec_mult.c:215:10: Call
213. }
214.
215. if (!BN_copy(k, scalar)) {
^
216. ECerr(EC_F_EC_SCALAR_MUL_LADDER, ERR_R_BN_LIB);
217. goto err;
crypto/bn/bn_lib.c:281:1: <Offset trace>
279. }
280.
281. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
282. {
283. bn_check_top(b);
crypto/bn/bn_lib.c:281:1: Parameter `b->top`
279. }
280.
281. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
282. {
283. bn_check_top(b);
crypto/bn/bn_lib.c:281:1: <Length trace>
279. }
280.
281. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
282. {
283. bn_check_top(b);
crypto/bn/bn_lib.c:281:1: Parameter `*a->d`
279. }
280.
281. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
282. {
283. bn_check_top(b);
crypto/bn/bn_lib.c:287:9: Call
285. if (a == b)
286. return a;
287. if (bn_wexpand(a, b->top) == NULL)
^
288. return NULL;
289.
crypto/bn/bn_lib.c:962:1: Parameter `*a->d`
960. }
961.
962. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
963. {
964. return (words <= a->dmax) ? a : bn_expand2(a, words);
crypto/bn/bn_lib.c:291:9: Array access: Offset added: [8, +oo] Size: [0, 536870848] by call to `EC_POINT_mul`
289.
290. if (b->top > 0)
291. memcpy(a->d, b->d, sizeof(b->d[0]) * b->top);
^
292.
293. a->neg = b->neg;
|
https://github.com/openssl/openssl/blob/3051bf2afab7ac8b7b9c64e68755d1addd2fb8ff/crypto/bn/bn_lib.c/#L291
|
d2a_code_trace_data_43012
|
static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
{
BN_ULONG *a = NULL;
if (words > (INT_MAX / (4 * BN_BITS2))) {
BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_BIGNUM_TOO_LONG);
return NULL;
}
if (BN_get_flags(b, BN_FLG_STATIC_DATA)) {
BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA);
return NULL;
}
if (BN_get_flags(b, BN_FLG_SECURE))
a = OPENSSL_secure_zalloc(words * sizeof(*a));
else
a = OPENSSL_zalloc(words * sizeof(*a));
if (a == NULL) {
BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE);
return NULL;
}
assert(b->top <= words);
if (b->top > 0)
memcpy(a, b->d, sizeof(*a) * b->top);
return a;
}
crypto/ec/ecp_oct.c:86: error: BUFFER_OVERRUN_L3
Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_mod_add_quick`.
Showing all 16 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:128:1: Parameter `r->top`
126.
127. /* slow but works */
128. > int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,
129. BN_CTX *ctx)
130. {
crypto/ec/ecp_oct.c:86:14: Call
84. }
85.
86. if (!BN_mod_add_quick(tmp1, tmp1, tmp2, group->field))
^
87. goto err;
88. }
crypto/bn/bn_mod.c:94:1: Parameter `*r->d`
92. }
93.
94. > int BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
95. const BIGNUM *m)
96. {
crypto/bn/bn_mod.c:97:15: Call
95. const BIGNUM *m)
96. {
97. int ret = bn_mod_add_fixed_top(r, a, b, m);
^
98.
99. if (ret)
crypto/bn/bn_mod.c:48:1: Parameter `*r->d`
46. * move depending on whether or not subtraction borrowed.
47. */
48. > int bn_mod_add_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
49. const BIGNUM *m)
50. {
crypto/bn/bn_mod.c:56:9: Call
54. const BN_ULONG *ap, *bp;
55.
56. if (bn_wexpand(r, mtop) == NULL)
^
57. return 0;
58.
crypto/bn/bn_lib.c:948:1: Parameter `*a->d`
946. }
947.
948. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
949. {
950. return (words <= a->dmax) ? a : bn_expand2(a, words);
crypto/bn/bn_lib.c:950:37: Call
948. BIGNUM *bn_wexpand(BIGNUM *a, int words)
949. {
950. return (words <= a->dmax) ? a : bn_expand2(a, words);
^
951. }
952.
crypto/bn/bn_lib.c:245:1: Parameter `*b->d`
243. */
244.
245. > BIGNUM *bn_expand2(BIGNUM *b, int words)
246. {
247. if (words > b->dmax) {
crypto/bn/bn_lib.c:248:23: Call
246. {
247. if (words > b->dmax) {
248. BN_ULONG *a = bn_expand_internal(b, words);
^
249. if (!a)
250. return NULL;
crypto/bn/bn_lib.c:209:1: <Offset trace>
207. /* This is used by bn_expand2() */
208. /* The caller MUST check that words > b->dmax before calling this */
209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
210. {
211. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:209:1: Parameter `b->top`
207. /* This is used by bn_expand2() */
208. /* The caller MUST check that words > b->dmax before calling this */
209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
210. {
211. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:209:1: <Length trace>
207. /* This is used by bn_expand2() */
208. /* The caller MUST check that words > b->dmax before calling this */
209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
210. {
211. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:209:1: Parameter `*b->d`
207. /* This is used by bn_expand2() */
208. /* The caller MUST check that words > b->dmax before calling this */
209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
210. {
211. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:232:9: Array access: Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_mod_add_quick`
230. assert(b->top <= words);
231. if (b->top > 0)
232. memcpy(a, b->d, sizeof(*a) * b->top);
^
233.
234. return a;
|
https://github.com/openssl/openssl/blob/793f19e47c69558e39c702da75c27e0509baf379/crypto/bn/bn_lib.c/#L232
|
d2a_code_trace_data_43013
|
static int opt_vstats(const char *opt, const char *arg)
{
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);
return opt_vstats_file(opt, filename);
}
avconv.c:3943: error: Null Dereference
pointer `today` last assigned on line 3941 could be null and is dereferenced at line 3943, column 69.
avconv.c:3937:1: start of procedure opt_vstats()
3935. }
3936.
3937. static int opt_vstats(const char *opt, const char *arg)
^
3938. {
3939. char filename[40];
avconv.c:3940:5:
3938. {
3939. char filename[40];
3940. time_t today2 = time(NULL);
^
3941. struct tm *today = localtime(&today2);
3942.
avconv.c:3941:5:
3939. char filename[40];
3940. time_t today2 = time(NULL);
3941. struct tm *today = localtime(&today2);
^
3942.
3943. snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min,
avconv.c:3943:5:
3941. struct tm *today = localtime(&today2);
3942.
3943. snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min,
^
3944. today->tm_sec);
3945. return opt_vstats_file(opt, filename);
|
https://github.com/libav/libav/blob/8664682d0e6b6071ca7b3f6b9e350305d3fbcf76/avconv.c/#L3943
|
d2a_code_trace_data_43014
|
int cipher_generic_block_update(void *vctx, unsigned char *out, size_t *outl,
size_t outsize, const unsigned char *in,
size_t inl)
{
size_t outlint = 0;
PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
size_t nextblocks = fillblock(ctx->buf, &ctx->bufsz, GENERIC_BLOCK_SIZE, &in,
&inl);
if (ctx->bufsz == GENERIC_BLOCK_SIZE && (ctx->enc || inl > 0 || !ctx->pad)) {
if (outsize < GENERIC_BLOCK_SIZE) {
ERR_raise(ERR_LIB_PROV, PROV_R_OUTPUT_BUFFER_TOO_SMALL);
return 0;
}
if (!ctx->hw->cipher(ctx, out, ctx->buf, GENERIC_BLOCK_SIZE)) {
ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_FAILED);
return 0;
}
ctx->bufsz = 0;
outlint = GENERIC_BLOCK_SIZE;
out += GENERIC_BLOCK_SIZE;
}
if (nextblocks > 0) {
if (!ctx->enc && ctx->pad && nextblocks == inl) {
if (!ossl_assert(inl >= GENERIC_BLOCK_SIZE)) {
ERR_raise(ERR_LIB_PROV, PROV_R_OUTPUT_BUFFER_TOO_SMALL);
return 0;
}
nextblocks -= GENERIC_BLOCK_SIZE;
}
outlint += nextblocks;
if (outsize < outlint) {
ERR_raise(ERR_LIB_PROV, PROV_R_OUTPUT_BUFFER_TOO_SMALL);
return 0;
}
if (!ctx->hw->cipher(ctx, out, in, nextblocks)) {
ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_FAILED);
return 0;
}
in += nextblocks;
inl -= nextblocks;
}
if (!trailingdata(ctx->buf, &ctx->bufsz, GENERIC_BLOCK_SIZE, &in, &inl)) {
return 0;
}
*outl = outlint;
return inl == 0;
}
providers/common/ciphers/cipher_common.c:191: error: INTEGER_OVERFLOW_L2
([1, +oo] - 16):unsigned64.
Showing all 4 steps of the trace
providers/common/ciphers/cipher_common.c:164:25: <LHS trace>
162. size_t outlint = 0;
163. PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
164. size_t nextblocks = fillblock(ctx->buf, &ctx->bufsz, GENERIC_BLOCK_SIZE, &in,
^
165. &inl);
166.
providers/common/ciphers/cipher_common.c:164:25: Call
162. size_t outlint = 0;
163. PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
164. size_t nextblocks = fillblock(ctx->buf, &ctx->bufsz, GENERIC_BLOCK_SIZE, &in,
^
165. &inl);
166.
providers/common/ciphers/block.c:33:1: Parameter `blocksize`
31. * which is a multiple of the blocksize.
32. */
33. > size_t fillblock(unsigned char *buf, size_t *buflen, size_t blocksize,
34. const unsigned char **in, size_t *inlen)
35. {
providers/common/ciphers/cipher_common.c:191:13: Binary operation: ([1, +oo] - 16):unsigned64
189. return 0;
190. }
191. nextblocks -= GENERIC_BLOCK_SIZE;
^
192. }
193. outlint += nextblocks;
|
https://github.com/openssl/openssl/blob/e1178600cc5d40b1e21c4a01d224afd2d8c7498a/providers/common/ciphers/cipher_common.c/#L191
|
d2a_code_trace_data_43015
|
int ff_hevc_decode_short_term_rps(HEVCContext *s, ShortTermRPS *rps,
const HEVCSPS *sps, int is_slice_header)
{
HEVCLocalContext *lc = &s->HEVClc;
uint8_t rps_predict = 0;
int delta_poc;
int k0 = 0;
int k1 = 0;
int k = 0;
int i;
GetBitContext *gb = &lc->gb;
if (rps != sps->st_rps && sps->nb_st_rps)
rps_predict = get_bits1(gb);
if (rps_predict) {
const ShortTermRPS *rps_ridx;
int delta_rps, abs_delta_rps;
uint8_t use_delta_flag = 0;
uint8_t delta_rps_sign;
if (is_slice_header) {
unsigned int delta_idx = get_ue_golomb_long(gb) + 1;
if (delta_idx > sps->nb_st_rps) {
av_log(s->avctx, AV_LOG_ERROR,
"Invalid value of delta_idx in slice header RPS: %d > %d.\n",
delta_idx, sps->nb_st_rps);
return AVERROR_INVALIDDATA;
}
rps_ridx = &sps->st_rps[sps->nb_st_rps - delta_idx];
} else
rps_ridx = &sps->st_rps[rps - sps->st_rps - 1];
delta_rps_sign = get_bits1(gb);
abs_delta_rps = get_ue_golomb_long(gb) + 1;
delta_rps = (1 - (delta_rps_sign << 1)) * abs_delta_rps;
for (i = 0; i <= rps_ridx->num_delta_pocs; i++) {
int used = rps->used[k] = get_bits1(gb);
if (!used)
use_delta_flag = get_bits1(gb);
if (used || use_delta_flag) {
if (i < rps_ridx->num_delta_pocs)
delta_poc = delta_rps + rps_ridx->delta_poc[i];
else
delta_poc = delta_rps;
rps->delta_poc[k] = delta_poc;
if (delta_poc < 0)
k0++;
else
k1++;
k++;
}
}
rps->num_delta_pocs = k;
rps->num_negative_pics = k0;
if (rps->num_delta_pocs != 0) {
int used, tmp;
for (i = 1; i < rps->num_delta_pocs; i++) {
delta_poc = rps->delta_poc[i];
used = rps->used[i];
for (k = i - 1; k >= 0; k--) {
tmp = rps->delta_poc[k];
if (delta_poc < tmp) {
rps->delta_poc[k + 1] = tmp;
rps->used[k + 1] = rps->used[k];
rps->delta_poc[k] = delta_poc;
rps->used[k] = used;
}
}
}
}
if ((rps->num_negative_pics >> 1) != 0) {
int used;
k = rps->num_negative_pics - 1;
for (i = 0; i < rps->num_negative_pics >> 1; i++) {
delta_poc = rps->delta_poc[i];
used = rps->used[i];
rps->delta_poc[i] = rps->delta_poc[k];
rps->used[i] = rps->used[k];
rps->delta_poc[k] = delta_poc;
rps->used[k] = used;
k--;
}
}
} else {
unsigned int prev, nb_positive_pics;
rps->num_negative_pics = get_ue_golomb_long(gb);
nb_positive_pics = get_ue_golomb_long(gb);
if (rps->num_negative_pics >= MAX_REFS ||
nb_positive_pics >= MAX_REFS) {
av_log(s->avctx, AV_LOG_ERROR, "Too many refs in a short term RPS.\n");
return AVERROR_INVALIDDATA;
}
rps->num_delta_pocs = rps->num_negative_pics + nb_positive_pics;
if (rps->num_delta_pocs) {
prev = 0;
for (i = 0; i < rps->num_negative_pics; i++) {
delta_poc = get_ue_golomb_long(gb) + 1;
prev -= delta_poc;
rps->delta_poc[i] = prev;
rps->used[i] = get_bits1(gb);
}
prev = 0;
for (i = 0; i < nb_positive_pics; i++) {
delta_poc = get_ue_golomb_long(gb) + 1;
prev += delta_poc;
rps->delta_poc[rps->num_negative_pics + i] = prev;
rps->used[rps->num_negative_pics + i] = get_bits1(gb);
}
}
}
return 0;
}
libavcodec/hevc_ps.c:151: error: Integer Overflow L2
([0, +oo] - 1):unsigned32.
libavcodec/hevc_ps.c:79:5: <LHS trace>
77. uint8_t rps_predict = 0;
78. int delta_poc;
79. int k0 = 0;
^
80. int k1 = 0;
81. int k = 0;
libavcodec/hevc_ps.c:79:5: Assignment
77. uint8_t rps_predict = 0;
78. int delta_poc;
79. int k0 = 0;
^
80. int k1 = 0;
81. int k = 0;
libavcodec/hevc_ps.c:131:9: Assignment
129.
130. rps->num_delta_pocs = k;
131. rps->num_negative_pics = k0;
^
132. // sort in increasing order (smallest first)
133. if (rps->num_delta_pocs != 0) {
libavcodec/hevc_ps.c:151:13: Binary operation: ([0, +oo] - 1):unsigned32
149. if ((rps->num_negative_pics >> 1) != 0) {
150. int used;
151. k = rps->num_negative_pics - 1;
^
152. // flip the negative values to largest first
153. for (i = 0; i < rps->num_negative_pics >> 1; i++) {
|
https://github.com/libav/libav/blob/e22ebd04bcab7f86548794556c28ecca46d9c2ac/libavcodec/hevc_ps.c/#L151
|
d2a_code_trace_data_43016
|
static int encode_test_run(EVP_TEST *t)
{
ENCODE_DATA *edata = t->data;
unsigned char *encode_out = NULL, *decode_out = NULL;
int output_len, chunk_len;
EVP_ENCODE_CTX *decode_ctx;
if (!TEST_ptr(decode_ctx = EVP_ENCODE_CTX_new())) {
t->err = "INTERNAL_ERROR";
goto err;
}
if (edata->encoding == BASE64_CANONICAL_ENCODING) {
EVP_ENCODE_CTX *encode_ctx;
if (!TEST_ptr(encode_ctx = EVP_ENCODE_CTX_new())
|| !TEST_ptr(encode_out =
OPENSSL_malloc(EVP_ENCODE_LENGTH(edata->input_len))))
goto err;
EVP_EncodeInit(encode_ctx);
EVP_EncodeUpdate(encode_ctx, encode_out, &chunk_len,
edata->input, edata->input_len);
output_len = chunk_len;
EVP_EncodeFinal(encode_ctx, encode_out + chunk_len, &chunk_len);
output_len += chunk_len;
EVP_ENCODE_CTX_free(encode_ctx);
if (!compare_mem(edata->output, edata->output_len,
encode_out, output_len)) {
t->err = "BAD_ENCODING";
goto err;
}
}
if (!TEST_ptr(decode_out =
OPENSSL_malloc(EVP_DECODE_LENGTH(edata->output_len))))
goto err;
EVP_DecodeInit(decode_ctx);
if (EVP_DecodeUpdate(decode_ctx, decode_out, &chunk_len, edata->output,
edata->output_len) < 0) {
t->err = "DECODE_ERROR";
goto err;
}
output_len = chunk_len;
if (EVP_DecodeFinal(decode_ctx, decode_out + chunk_len, &chunk_len) != 1) {
t->err = "DECODE_ERROR";
goto err;
}
output_len += chunk_len;
if (edata->encoding != BASE64_INVALID_ENCODING
&& !compare_mem(edata->input, edata->input_len,
decode_out, output_len)) {
t->err = "BAD_DECODING";
goto err;
}
t->err = NULL;
err:
OPENSSL_free(encode_out);
OPENSSL_free(decode_out);
EVP_ENCODE_CTX_free(decode_ctx);
return 1;
}
test/evp_test.c:1816: error: MEMORY_LEAK
memory dynamically allocated to `encode_ctx` by call to `EVP_ENCODE_CTX_new()` at line 1815, column 14 is not reachable after line 1816, column 21.
Showing all 72 steps of the trace
test/evp_test.c:1800:1: start of procedure encode_test_run()
1798. }
1799.
1800. > static int encode_test_run(EVP_TEST *t)
1801. {
1802. ENCODE_DATA *edata = t->data;
test/evp_test.c:1802:5:
1800. static int encode_test_run(EVP_TEST *t)
1801. {
1802. > ENCODE_DATA *edata = t->data;
1803. unsigned char *encode_out = NULL, *decode_out = NULL;
1804. int output_len, chunk_len;
test/evp_test.c:1803:5:
1801. {
1802. ENCODE_DATA *edata = t->data;
1803. > unsigned char *encode_out = NULL, *decode_out = NULL;
1804. int output_len, chunk_len;
1805. EVP_ENCODE_CTX *decode_ctx;
test/evp_test.c:1807:10:
1805. EVP_ENCODE_CTX *decode_ctx;
1806.
1807. > if (!TEST_ptr(decode_ctx = EVP_ENCODE_CTX_new())) {
1808. t->err = "INTERNAL_ERROR";
1809. goto err;
crypto/evp/encode.c:96:1: start of procedure EVP_ENCODE_CTX_new()
94. #endif
95.
96. > EVP_ENCODE_CTX *EVP_ENCODE_CTX_new(void)
97. {
98. return OPENSSL_zalloc(sizeof(EVP_ENCODE_CTX));
crypto/evp/encode.c:98:5:
96. EVP_ENCODE_CTX *EVP_ENCODE_CTX_new(void)
97. {
98. > return OPENSSL_zalloc(sizeof(EVP_ENCODE_CTX));
99. }
100.
crypto/mem.c:186:1: start of procedure CRYPTO_zalloc()
184. }
185.
186. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
187. {
188. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:188:5:
186. void *CRYPTO_zalloc(size_t num, const char *file, int line)
187. {
188. > void *ret = CRYPTO_malloc(num, file, line);
189.
190. FAILTEST();
crypto/mem.c:158:1: start of procedure CRYPTO_malloc()
156. #endif
157.
158. > void *CRYPTO_malloc(size_t num, const char *file, int line)
159. {
160. void *ret = NULL;
crypto/mem.c:160:5:
158. void *CRYPTO_malloc(size_t num, const char *file, int line)
159. {
160. > void *ret = NULL;
161.
162. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
crypto/mem.c:162:9: Taking false branch
160. void *ret = NULL;
161.
162. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
^
163. return malloc_impl(num, file, line);
164.
crypto/mem.c:165:9: Taking false branch
163. return malloc_impl(num, file, line);
164.
165. if (num == 0)
^
166. return NULL;
167.
crypto/mem.c:169:5:
167.
168. FAILTEST();
169. > allow_customize = 0;
170. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
171. if (call_malloc_debug) {
crypto/mem.c:179:5:
177. }
178. #else
179. > osslargused(file); osslargused(line);
180. ret = malloc(num);
181. #endif
crypto/mem.c:179:24:
177. }
178. #else
179. > osslargused(file); osslargused(line);
180. ret = malloc(num);
181. #endif
crypto/mem.c:180:5:
178. #else
179. osslargused(file); osslargused(line);
180. > ret = malloc(num);
181. #endif
182.
crypto/mem.c:183:5:
181. #endif
182.
183. > return ret;
184. }
185.
crypto/mem.c:184:1: return from a call to CRYPTO_malloc
182.
183. return ret;
184. > }
185.
186. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:191:9: Taking true branch
189.
190. FAILTEST();
191. if (ret != NULL)
^
192. memset(ret, 0, num);
193. return ret;
crypto/mem.c:192:9:
190. FAILTEST();
191. if (ret != NULL)
192. > memset(ret, 0, num);
193. return ret;
194. }
crypto/mem.c:193:5:
191. if (ret != NULL)
192. memset(ret, 0, num);
193. > return ret;
194. }
195.
crypto/mem.c:194:1: return from a call to CRYPTO_zalloc
192. memset(ret, 0, num);
193. return ret;
194. > }
195.
196. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/evp/encode.c:99:1: return from a call to EVP_ENCODE_CTX_new
97. {
98. return OPENSSL_zalloc(sizeof(EVP_ENCODE_CTX));
99. > }
100.
101. void EVP_ENCODE_CTX_free(EVP_ENCODE_CTX *ctx)
test/testutil/tests.c:462:1: start of procedure test_ptr()
460. }
461.
462. > int test_ptr(const char *file, int line, const char *s, const void *p)
463. {
464. if (p != NULL)
test/testutil/tests.c:464:9: Taking true branch
462. int test_ptr(const char *file, int line, const char *s, const void *p)
463. {
464. if (p != NULL)
^
465. return 1;
466. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
test/testutil/tests.c:465:9:
463. {
464. if (p != NULL)
465. > return 1;
466. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
467. return 0;
test/testutil/tests.c:468:1: return from a call to test_ptr
466. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
467. return 0;
468. > }
469.
470. int test_true(const char *file, int line, const char *s, int b)
test/evp_test.c:1807:10: Taking false branch
1805. EVP_ENCODE_CTX *decode_ctx;
1806.
1807. if (!TEST_ptr(decode_ctx = EVP_ENCODE_CTX_new())) {
^
1808. t->err = "INTERNAL_ERROR";
1809. goto err;
test/evp_test.c:1812:9: Taking true branch
1810. }
1811.
1812. if (edata->encoding == BASE64_CANONICAL_ENCODING) {
^
1813. EVP_ENCODE_CTX *encode_ctx;
1814.
test/evp_test.c:1815:14:
1813. EVP_ENCODE_CTX *encode_ctx;
1814.
1815. > if (!TEST_ptr(encode_ctx = EVP_ENCODE_CTX_new())
1816. || !TEST_ptr(encode_out =
1817. OPENSSL_malloc(EVP_ENCODE_LENGTH(edata->input_len))))
crypto/evp/encode.c:96:1: start of procedure EVP_ENCODE_CTX_new()
94. #endif
95.
96. > EVP_ENCODE_CTX *EVP_ENCODE_CTX_new(void)
97. {
98. return OPENSSL_zalloc(sizeof(EVP_ENCODE_CTX));
crypto/evp/encode.c:98:5:
96. EVP_ENCODE_CTX *EVP_ENCODE_CTX_new(void)
97. {
98. > return OPENSSL_zalloc(sizeof(EVP_ENCODE_CTX));
99. }
100.
crypto/mem.c:186:1: start of procedure CRYPTO_zalloc()
184. }
185.
186. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
187. {
188. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:188:5:
186. void *CRYPTO_zalloc(size_t num, const char *file, int line)
187. {
188. > void *ret = CRYPTO_malloc(num, file, line);
189.
190. FAILTEST();
crypto/mem.c:158:1: start of procedure CRYPTO_malloc()
156. #endif
157.
158. > void *CRYPTO_malloc(size_t num, const char *file, int line)
159. {
160. void *ret = NULL;
crypto/mem.c:160:5:
158. void *CRYPTO_malloc(size_t num, const char *file, int line)
159. {
160. > void *ret = NULL;
161.
162. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
crypto/mem.c:162:9: Taking false branch
160. void *ret = NULL;
161.
162. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
^
163. return malloc_impl(num, file, line);
164.
crypto/mem.c:165:9: Taking false branch
163. return malloc_impl(num, file, line);
164.
165. if (num == 0)
^
166. return NULL;
167.
crypto/mem.c:169:5:
167.
168. FAILTEST();
169. > allow_customize = 0;
170. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
171. if (call_malloc_debug) {
crypto/mem.c:179:5:
177. }
178. #else
179. > osslargused(file); osslargused(line);
180. ret = malloc(num);
181. #endif
crypto/mem.c:179:24:
177. }
178. #else
179. > osslargused(file); osslargused(line);
180. ret = malloc(num);
181. #endif
crypto/mem.c:180:5:
178. #else
179. osslargused(file); osslargused(line);
180. > ret = malloc(num);
181. #endif
182.
crypto/mem.c:183:5:
181. #endif
182.
183. > return ret;
184. }
185.
crypto/mem.c:184:1: return from a call to CRYPTO_malloc
182.
183. return ret;
184. > }
185.
186. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:191:9: Taking true branch
189.
190. FAILTEST();
191. if (ret != NULL)
^
192. memset(ret, 0, num);
193. return ret;
crypto/mem.c:192:9:
190. FAILTEST();
191. if (ret != NULL)
192. > memset(ret, 0, num);
193. return ret;
194. }
crypto/mem.c:193:5:
191. if (ret != NULL)
192. memset(ret, 0, num);
193. > return ret;
194. }
195.
crypto/mem.c:194:1: return from a call to CRYPTO_zalloc
192. memset(ret, 0, num);
193. return ret;
194. > }
195.
196. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/evp/encode.c:99:1: return from a call to EVP_ENCODE_CTX_new
97. {
98. return OPENSSL_zalloc(sizeof(EVP_ENCODE_CTX));
99. > }
100.
101. void EVP_ENCODE_CTX_free(EVP_ENCODE_CTX *ctx)
test/testutil/tests.c:462:1: start of procedure test_ptr()
460. }
461.
462. > int test_ptr(const char *file, int line, const char *s, const void *p)
463. {
464. if (p != NULL)
test/testutil/tests.c:464:9: Taking true branch
462. int test_ptr(const char *file, int line, const char *s, const void *p)
463. {
464. if (p != NULL)
^
465. return 1;
466. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
test/testutil/tests.c:465:9:
463. {
464. if (p != NULL)
465. > return 1;
466. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
467. return 0;
test/testutil/tests.c:468:1: return from a call to test_ptr
466. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
467. return 0;
468. > }
469.
470. int test_true(const char *file, int line, const char *s, int b)
test/evp_test.c:1815:14: Taking false branch
1813. EVP_ENCODE_CTX *encode_ctx;
1814.
1815. if (!TEST_ptr(encode_ctx = EVP_ENCODE_CTX_new())
^
1816. || !TEST_ptr(encode_out =
1817. OPENSSL_malloc(EVP_ENCODE_LENGTH(edata->input_len))))
test/evp_test.c:1816:21:
1814.
1815. if (!TEST_ptr(encode_ctx = EVP_ENCODE_CTX_new())
1816. > || !TEST_ptr(encode_out =
1817. OPENSSL_malloc(EVP_ENCODE_LENGTH(edata->input_len))))
1818. goto err;
crypto/mem.c:158:1: start of procedure CRYPTO_malloc()
156. #endif
157.
158. > void *CRYPTO_malloc(size_t num, const char *file, int line)
159. {
160. void *ret = NULL;
crypto/mem.c:160:5:
158. void *CRYPTO_malloc(size_t num, const char *file, int line)
159. {
160. > void *ret = NULL;
161.
162. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
crypto/mem.c:162:9: Taking true branch
160. void *ret = NULL;
161.
162. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
^
163. return malloc_impl(num, file, line);
164.
crypto/mem.c:162:32: Taking true branch
160. void *ret = NULL;
161.
162. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
^
163. return malloc_impl(num, file, line);
164.
crypto/mem.c:163:9: Skipping __function_pointer__(): unresolved function pointer
161.
162. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
163. return malloc_impl(num, file, line);
^
164.
165. if (num == 0)
crypto/mem.c:184:1: return from a call to CRYPTO_malloc
182.
183. return ret;
184. > }
185.
186. void *CRYPTO_zalloc(size_t num, const char *file, int line)
test/testutil/tests.c:462:1: start of procedure test_ptr()
460. }
461.
462. > int test_ptr(const char *file, int line, const char *s, const void *p)
463. {
464. if (p != NULL)
test/testutil/tests.c:464:9: Taking false branch
462. int test_ptr(const char *file, int line, const char *s, const void *p)
463. {
464. if (p != NULL)
^
465. return 1;
466. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
test/testutil/tests.c:466:5:
464. if (p != NULL)
465. return 1;
466. > test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
467. return 0;
468. }
test/testutil/tests.c:347:1: start of procedure test_fail_message()
345. }
346.
347. > static void test_fail_message(const char *prefix, const char *file,
348. int line, const char *type,
349. const char *left, const char *right,
test/testutil/tests.c:354:5:
352. va_list ap;
353.
354. > va_start(ap, fmt);
355. test_fail_message_va(prefix, file, line, type, left, right, op, fmt, ap);
356. va_end(ap);
test/testutil/tests.c:355:5: Skipping test_fail_message_va(): empty list of specs
353.
354. va_start(ap, fmt);
355. test_fail_message_va(prefix, file, line, type, left, right, op, fmt, ap);
^
356. va_end(ap);
357. }
test/testutil/tests.c:356:5:
354. va_start(ap, fmt);
355. test_fail_message_va(prefix, file, line, type, left, right, op, fmt, ap);
356. > va_end(ap);
357. }
358.
test/testutil/tests.c:357:1: return from a call to test_fail_message
355. test_fail_message_va(prefix, file, line, type, left, right, op, fmt, ap);
356. va_end(ap);
357. > }
358.
359. void test_info_c90(const char *desc, ...)
test/testutil/tests.c:467:5:
465. return 1;
466. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
467. > return 0;
468. }
469.
test/testutil/tests.c:468:1: return from a call to test_ptr
466. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
467. return 0;
468. > }
469.
470. int test_true(const char *file, int line, const char *s, int b)
test/evp_test.c:1816:21: Taking true branch
1814.
1815. if (!TEST_ptr(encode_ctx = EVP_ENCODE_CTX_new())
1816. || !TEST_ptr(encode_out =
^
1817. OPENSSL_malloc(EVP_ENCODE_LENGTH(edata->input_len))))
1818. goto err;
|
https://github.com/openssl/openssl/blob/69b4c01fd26e6eb72b156ed3014522c3295a7669/test/evp_test.c/#L1816
|
d2a_code_trace_data_43017
|
void av_free(void *ptr)
{
#if CONFIG_MEMALIGN_HACK
if (ptr)
free((char*)ptr - ((char*)ptr)[-1]);
#else
free(ptr);
#endif
}
libavformat/movenchint.c:244: error: Use After Free
call to `sample_queue_pop()` eventually accesses memory that was invalidated by call to `free()` on line 244 indirectly during the call to `sample_queue_pop()`.
libavformat/movenchint.c:215:1: invalidation part of the trace starts here
213. * @return 0 if a match was found, < 0 if no match was found
214. */
215. static int find_sample_match(const uint8_t *data, int len,
^
216. HintSampleQueue *queue, int *pos,
217. int *match_sample, int *match_offset,
libavformat/movenchint.c:215:1: parameter `queue` of find_sample_match
213. * @return 0 if a match was found, < 0 if no match was found
214. */
215. static int find_sample_match(const uint8_t *data, int len,
^
216. HintSampleQueue *queue, int *pos,
217. int *match_sample, int *match_offset,
libavformat/movenchint.c:244:13: when calling `sample_queue_pop` here
242. } else {
243. /* No match for this sample, remove it */
244. sample_queue_pop(queue);
^
245. }
246. }
libavformat/movenchint.c:70:1: parameter `queue` of sample_queue_pop
68. * Remove the first sample from the sample queue.
69. */
70. static void sample_queue_pop(HintSampleQueue *queue)
^
71. {
72. if (queue->len <= 0)
libavformat/movenchint.c:75:9: when calling `av_free` here
73. return;
74. if (queue->samples[0].own_data)
75. av_free(queue->samples[0].data);
^
76. queue->len--;
77. memmove(queue->samples, queue->samples + 1, sizeof(HintSample)*queue->len);
libavutil/mem.c:137:1: parameter `ptr` of av_free
135. }
136.
137. void av_free(void *ptr)
^
138. {
139. #if CONFIG_MEMALIGN_HACK
libavutil/mem.c:143:5: was invalidated by call to `free()`
141. free((char*)ptr - ((char*)ptr)[-1]);
142. #else
143. free(ptr);
^
144. #endif
145. }
libavformat/movenchint.c:215:1: use-after-lifetime part of the trace starts here
213. * @return 0 if a match was found, < 0 if no match was found
214. */
215. static int find_sample_match(const uint8_t *data, int len,
^
216. HintSampleQueue *queue, int *pos,
217. int *match_sample, int *match_offset,
libavformat/movenchint.c:215:1: parameter `queue` of find_sample_match
213. * @return 0 if a match was found, < 0 if no match was found
214. */
215. static int find_sample_match(const uint8_t *data, int len,
^
216. HintSampleQueue *queue, int *pos,
217. int *match_sample, int *match_offset,
libavformat/movenchint.c:244:13: when calling `sample_queue_pop` here
242. } else {
243. /* No match for this sample, remove it */
244. sample_queue_pop(queue);
^
245. }
246. }
libavformat/movenchint.c:70:1: parameter `queue` of sample_queue_pop
68. * Remove the first sample from the sample queue.
69. */
70. static void sample_queue_pop(HintSampleQueue *queue)
^
71. {
72. if (queue->len <= 0)
libavformat/movenchint.c:75:9: when calling `av_free` here
73. return;
74. if (queue->samples[0].own_data)
75. av_free(queue->samples[0].data);
^
76. queue->len--;
77. memmove(queue->samples, queue->samples + 1, sizeof(HintSample)*queue->len);
libavutil/mem.c:137:1: parameter `ptr` of av_free
135. }
136.
137. void av_free(void *ptr)
^
138. {
139. #if CONFIG_MEMALIGN_HACK
libavutil/mem.c:143:5: invalid access occurs here
141. free((char*)ptr - ((char*)ptr)[-1]);
142. #else
143. free(ptr);
^
144. #endif
145. }
|
https://github.com/libav/libav/blob/bf61ef2316b6b6eac815fe5ada98d2ed41086164/libavutil/mem.c/#L143
|
d2a_code_trace_data_43018
|
static ASN1_INTEGER *create_nonce(int bits)
{
unsigned char buf[20];
ASN1_INTEGER *nonce = NULL;
int len = (bits - 1) / 8 + 1;
int i;
if (len > (int)sizeof(buf))
goto err;
if (RAND_bytes(buf, len) <= 0)
goto err;
for (i = 0; i < len && !buf[i]; ++i)
continue;
if ((nonce = ASN1_INTEGER_new()) == NULL)
goto err;
OPENSSL_free(nonce->data);
nonce->length = len - i;
nonce->data = app_malloc(nonce->length + 1, "nonce buffer");
memcpy(nonce->data, buf + i, nonce->length);
return nonce;
err:
BIO_printf(bio_err, "could not create nonce\n");
ASN1_INTEGER_free(nonce);
return NULL;
}
apps/ts.c:545: error: NULL_DEREFERENCE
pointer `nonce->data` last assigned on line 544 could be null and is dereferenced by call to `memcpy()` at line 545, column 5.
Showing all 37 steps of the trace
apps/ts.c:525:1: start of procedure create_nonce()
523. }
524.
525. > static ASN1_INTEGER *create_nonce(int bits)
526. {
527. unsigned char buf[20];
apps/ts.c:528:5:
526. {
527. unsigned char buf[20];
528. > ASN1_INTEGER *nonce = NULL;
529. int len = (bits - 1) / 8 + 1;
530. int i;
apps/ts.c:529:5:
527. unsigned char buf[20];
528. ASN1_INTEGER *nonce = NULL;
529. > int len = (bits - 1) / 8 + 1;
530. int i;
531.
apps/ts.c:532:9: Taking false branch
530. int i;
531.
532. if (len > (int)sizeof(buf))
^
533. goto err;
534. if (RAND_bytes(buf, len) <= 0)
apps/ts.c:534:9: Taking false branch
532. if (len > (int)sizeof(buf))
533. goto err;
534. if (RAND_bytes(buf, len) <= 0)
^
535. goto err;
536.
apps/ts.c:538:10:
536.
537. /* Find the first non-zero byte and creating ASN1_INTEGER object. */
538. > for (i = 0; i < len && !buf[i]; ++i)
539. continue;
540. if ((nonce = ASN1_INTEGER_new()) == NULL)
apps/ts.c:538:17: Loop condition is false. Leaving loop
536.
537. /* Find the first non-zero byte and creating ASN1_INTEGER object. */
538. for (i = 0; i < len && !buf[i]; ++i)
^
539. continue;
540. if ((nonce = ASN1_INTEGER_new()) == NULL)
apps/ts.c:540:9:
538. for (i = 0; i < len && !buf[i]; ++i)
539. continue;
540. > if ((nonce = ASN1_INTEGER_new()) == NULL)
541. goto err;
542. OPENSSL_free(nonce->data);
crypto/asn1/tasn_typ.c:29:1: start of procedure ASN1_INTEGER_new()
27.
28. IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_OCTET_STRING)
29. > IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_INTEGER)
30. IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_ENUMERATED)
31. IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_BIT_STRING)
crypto/asn1/tasn_typ.c:29:1: return from a call to ASN1_INTEGER_new
27.
28. IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_OCTET_STRING)
29. > IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_INTEGER)
30. IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_ENUMERATED)
31. IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_BIT_STRING)
apps/ts.c:540:9: Taking false branch
538. for (i = 0; i < len && !buf[i]; ++i)
539. continue;
540. if ((nonce = ASN1_INTEGER_new()) == NULL)
^
541. goto err;
542. OPENSSL_free(nonce->data);
apps/ts.c:542:5:
540. if ((nonce = ASN1_INTEGER_new()) == NULL)
541. goto err;
542. > OPENSSL_free(nonce->data);
543. nonce->length = len - i;
544. nonce->data = app_malloc(nonce->length + 1, "nonce buffer");
crypto/mem.c:295:1: start of procedure CRYPTO_free()
293. }
294.
295. > void CRYPTO_free(void *str, const char *file, int line)
296. {
297. INCREMENT(free_count);
crypto/mem.c:298:9: Taking true branch
296. {
297. INCREMENT(free_count);
298. if (free_impl != NULL && free_impl != &CRYPTO_free) {
^
299. free_impl(str, file, line);
300. return;
crypto/mem.c:298:30: Taking true branch
296. {
297. INCREMENT(free_count);
298. if (free_impl != NULL && free_impl != &CRYPTO_free) {
^
299. free_impl(str, file, line);
300. return;
crypto/mem.c:299:9: Skipping __function_pointer__(): unresolved function pointer
297. INCREMENT(free_count);
298. if (free_impl != NULL && free_impl != &CRYPTO_free) {
299. free_impl(str, file, line);
^
300. return;
301. }
crypto/mem.c:300:9:
298. if (free_impl != NULL && free_impl != &CRYPTO_free) {
299. free_impl(str, file, line);
300. > return;
301. }
302.
crypto/mem.c:314:1: return from a call to CRYPTO_free
312. free(str);
313. #endif
314. > }
315.
316. void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)
apps/ts.c:543:5:
541. goto err;
542. OPENSSL_free(nonce->data);
543. > nonce->length = len - i;
544. nonce->data = app_malloc(nonce->length + 1, "nonce buffer");
545. memcpy(nonce->data, buf + i, nonce->length);
apps/ts.c:544:5:
542. OPENSSL_free(nonce->data);
543. nonce->length = len - i;
544. > nonce->data = app_malloc(nonce->length + 1, "nonce buffer");
545. memcpy(nonce->data, buf + i, nonce->length);
546. return nonce;
test/testutil/apps_mem.c:14:1: start of procedure app_malloc()
12. /* shim that avoids sucking in too much from apps/apps.c */
13.
14. > void* app_malloc(int sz, const char *what)
15. {
16. void *vp = OPENSSL_malloc(sz);
test/testutil/apps_mem.c:16:5:
14. void* app_malloc(int sz, const char *what)
15. {
16. > void *vp = OPENSSL_malloc(sz);
17.
18. return vp;
crypto/mem.c:192:1: start of procedure CRYPTO_malloc()
190. #endif
191.
192. > void *CRYPTO_malloc(size_t num, const char *file, int line)
193. {
194. void *ret = NULL;
crypto/mem.c:194:5:
192. void *CRYPTO_malloc(size_t num, const char *file, int line)
193. {
194. > void *ret = NULL;
195.
196. INCREMENT(malloc_count);
crypto/mem.c:197:9: Taking true 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:197:32: Taking false branch
195.
196. INCREMENT(malloc_count);
197. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
^
198. return malloc_impl(num, file, line);
199.
crypto/mem.c:200:9: Taking false branch
198. return malloc_impl(num, file, line);
199.
200. if (num == 0)
^
201. return NULL;
202.
crypto/mem.c:204:9: Taking true branch
202.
203. FAILTEST();
204. if (allow_customize) {
^
205. /*
206. * Disallow customization after the first allocation. We only set this
crypto/mem.c:210:9:
208. * allocation.
209. */
210. > allow_customize = 0;
211. }
212. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
crypto/mem.c:221:5:
219. }
220. #else
221. > (void)(file); (void)(line);
222. ret = malloc(num);
223. #endif
crypto/mem.c:221:19:
219. }
220. #else
221. > (void)(file); (void)(line);
222. ret = malloc(num);
223. #endif
crypto/mem.c:222:5:
220. #else
221. (void)(file); (void)(line);
222. > ret = malloc(num);
223. #endif
224.
crypto/mem.c:225:5:
223. #endif
224.
225. > return ret;
226. }
227.
crypto/mem.c:226:1: return from a call to CRYPTO_malloc
224.
225. return ret;
226. > }
227.
228. void *CRYPTO_zalloc(size_t num, const char *file, int line)
test/testutil/apps_mem.c:18:5:
16. void *vp = OPENSSL_malloc(sz);
17.
18. > return vp;
19. }
test/testutil/apps_mem.c:19:1: return from a call to app_malloc
17.
18. return vp;
19. > }
apps/ts.c:545:5:
543. nonce->length = len - i;
544. nonce->data = app_malloc(nonce->length + 1, "nonce buffer");
545. > memcpy(nonce->data, buf + i, nonce->length);
546. return nonce;
547.
|
https://github.com/openssl/openssl/blob/ce506d27ab5e7d17dfe3fe649768a0d19b6c86ee/apps/ts.c/#L545
|
d2a_code_trace_data_43019
|
void OSSL_trace_end(int category, BIO * channel)
{
#ifndef OPENSSL_NO_TRACE
char *suffix = NULL;
category = ossl_trace_get_category(category);
suffix = trace_channels[category].suffix;
if (channel != NULL
&& ossl_assert(channel == current_channel)) {
(void)BIO_flush(channel);
switch (trace_channels[category].type) {
case t_channel:
if (suffix != NULL) {
(void)BIO_puts(channel, suffix);
(void)BIO_puts(channel, "\n");
}
break;
case t_callback:
(void)BIO_ctrl(channel, OSSL_TRACE_CTRL_END,
suffix == NULL ? 0 : strlen(suffix), suffix);
break;
}
current_channel = NULL;
CRYPTO_THREAD_unlock(trace_lock);
}
#endif
}
crypto/trace.c:475: error: BUFFER_OVERRUN_L3
Offset: [-1, 12] Size: 13.
Showing all 7 steps of the trace
crypto/trace.c:474:16: <Offset trace>
472. char *suffix = NULL;
473.
474. category = ossl_trace_get_category(category);
^
475. suffix = trace_channels[category].suffix;
476. if (channel != NULL
crypto/trace.c:474:16: Call
472. char *suffix = NULL;
473.
474. category = ossl_trace_get_category(category);
^
475. suffix = trace_channels[category].suffix;
476. if (channel != NULL
crypto/trace.c:422:9: Assignment
420. {
421. if (category < 0 || category >= OSSL_TRACE_CATEGORY_NUM)
422. return -1;
^
423. if (trace_channels[category].bio != NULL)
424. return category;
crypto/trace.c:474:5: Assignment
472. char *suffix = NULL;
473.
474. category = ossl_trace_get_category(category);
^
475. suffix = trace_channels[category].suffix;
476. if (channel != NULL
crypto/trace.c:160:1: <Length trace>
158.
159. /* We use one trace channel for each trace category */
160. > static struct {
161. enum { t_channel, t_callback } type;
162. BIO *bio;
crypto/trace.c:160:1: Array declaration
158.
159. /* We use one trace channel for each trace category */
160. > static struct {
161. enum { t_channel, t_callback } type;
162. BIO *bio;
crypto/trace.c:475:14: Array access: Offset: [-1, 12] Size: 13
473.
474. category = ossl_trace_get_category(category);
475. suffix = trace_channels[category].suffix;
^
476. if (channel != NULL
477. && ossl_assert(channel == current_channel)) {
|
https://github.com/openssl/openssl/blob/18e1e302452e6dea4500b6f981cee7e151294dea/crypto/trace.c/#L475
|
d2a_code_trace_data_43020
|
void RAND_add(const void *buf, int num, double randomness)
{
const RAND_METHOD *meth = RAND_get_rand_method();
if (meth->add != NULL)
meth->add(buf, num, randomness);
}
crypto/rand/rand_lib.c:842: error: NULL_DEREFERENCE
pointer `meth` last assigned on line 840 could be null and is dereferenced at line 842, column 9.
Showing all 6 steps of the trace
crypto/rand/rand_lib.c:838:1: start of procedure RAND_add()
836. }
837.
838. > void RAND_add(const void *buf, int num, double randomness)
839. {
840. const RAND_METHOD *meth = RAND_get_rand_method();
crypto/rand/rand_lib.c:840:5:
838. void RAND_add(const void *buf, int num, double randomness)
839. {
840. > const RAND_METHOD *meth = RAND_get_rand_method();
841.
842. if (meth->add != NULL)
crypto/rand/rand_lib.c:770:1: start of procedure RAND_get_rand_method()
768. #endif
769.
770. > const RAND_METHOD *RAND_get_rand_method(void)
771. {
772. #ifdef FIPS_MODE
crypto/rand/rand_lib.c:773:5:
771. {
772. #ifdef FIPS_MODE
773. > return NULL;
774. #else
775. const RAND_METHOD *tmp_meth = NULL;
crypto/rand/rand_lib.c:802:1: return from a call to RAND_get_rand_method
800. return tmp_meth;
801. #endif
802. > }
803.
804. #if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODE)
crypto/rand/rand_lib.c:842:9:
840. const RAND_METHOD *meth = RAND_get_rand_method();
841.
842. > if (meth->add != NULL)
843. meth->add(buf, num, randomness);
844. }
|
https://github.com/openssl/openssl/blob/6b3d0423528b049d04b299a8588a32d5c1224717/crypto/rand/rand_lib.c/#L842
|
d2a_code_trace_data_43021
|
static int bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom)
{
unsigned char *buf = NULL;
int ret = 0, bit, bytes, mask;
time_t tim;
if (bits == 0) {
if (top != BN_RAND_TOP_ANY || bottom != BN_RAND_BOTTOM_ANY)
goto toosmall;
BN_zero(rnd);
return 1;
}
if (bits < 0 || (bits == 1 && top > 0))
goto toosmall;
bytes = (bits + 7) / 8;
bit = (bits - 1) % 8;
mask = 0xff << (bit + 1);
buf = OPENSSL_malloc(bytes);
if (buf == NULL) {
BNerr(BN_F_BNRAND, ERR_R_MALLOC_FAILURE);
goto err;
}
time(&tim);
RAND_add(&tim, sizeof(tim), 0.0);
if (RAND_bytes(buf, bytes) <= 0)
goto err;
if (pseudorand == 2) {
int i;
unsigned char c;
for (i = 0; i < bytes; i++) {
if (RAND_bytes(&c, 1) <= 0)
goto err;
if (c >= 128 && i > 0)
buf[i] = buf[i - 1];
else if (c < 42)
buf[i] = 0;
else if (c < 84)
buf[i] = 255;
}
}
if (top >= 0) {
if (top) {
if (bit == 0) {
buf[0] = 1;
buf[1] |= 0x80;
} else {
buf[0] |= (3 << (bit - 1));
}
} else {
buf[0] |= (1 << bit);
}
}
buf[0] &= ~mask;
if (bottom)
buf[bytes - 1] |= 1;
if (!BN_bin2bn(buf, bytes, rnd))
goto err;
ret = 1;
err:
OPENSSL_clear_free(buf, bytes);
bn_check_top(rnd);
return (ret);
toosmall:
BNerr(BN_F_BNRAND, BN_R_BITS_TOO_SMALL);
return 0;
}
test/bntest.c:452: error: BUFFER_OVERRUN_L3
Offset: [-1, 1030] Size: [1, 1031] by call to `BN_bntest_rand`.
Showing all 12 steps of the trace
test/bntest.c:452:9: Call
450.
451. for (i = 0; i < NUM0; i++) {
452. BN_bntest_rand(a, 1024, 0, 0);
^
453. for (j = 0; j < 2; j++) {
454. BN_GF2m_mod(c, a, b[j]);
crypto/bn/bn_rand.c:106:1: Parameter `bits`
104. }
105.
106. > int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom)
107. {
108. return bnrand(2, rnd, bits, top, bottom);
crypto/bn/bn_rand.c:108:12: Call
106. int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom)
107. {
108. return bnrand(2, rnd, bits, top, bottom);
^
109. }
110.
crypto/bn/bn_rand.c:56:14: <Offset trace>
54. unsigned char c;
55.
56. for (i = 0; i < bytes; i++) {
^
57. if (RAND_bytes(&c, 1) <= 0)
58. goto err;
crypto/bn/bn_rand.c:56:14: Assignment
54. unsigned char c;
55.
56. for (i = 0; i < bytes; i++) {
^
57. if (RAND_bytes(&c, 1) <= 0)
58. goto err;
crypto/bn/bn_rand.c:17:1: <Length trace>
15. #include <openssl/sha.h>
16.
17. > static int bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom)
18. {
19. unsigned char *buf = NULL;
crypto/bn/bn_rand.c:17:1: Parameter `bits`
15. #include <openssl/sha.h>
16.
17. > static int bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom)
18. {
19. unsigned char *buf = NULL;
crypto/bn/bn_rand.c:32:5: Assignment
30. goto toosmall;
31.
32. bytes = (bits + 7) / 8;
^
33. bit = (bits - 1) % 8;
34. mask = 0xff << (bit + 1);
crypto/bn/bn_rand.c:36:11: Call
34. mask = 0xff << (bit + 1);
35.
36. buf = OPENSSL_malloc(bytes);
^
37. if (buf == NULL) {
38. BNerr(BN_F_BNRAND, ERR_R_MALLOC_FAILURE);
crypto/mem.c:79:9: Assignment
77.
78. if (num <= 0)
79. return NULL;
^
80.
81. allow_customize = 0;
crypto/bn/bn_rand.c:36:5: Assignment
34. mask = 0xff << (bit + 1);
35.
36. buf = OPENSSL_malloc(bytes);
^
37. if (buf == NULL) {
38. BNerr(BN_F_BNRAND, ERR_R_MALLOC_FAILURE);
crypto/bn/bn_rand.c:82:9: Array access: Offset: [-1, 1030] Size: [1, 1031] by call to `BN_bntest_rand`
80. buf[0] &= ~mask;
81. if (bottom) /* set bottom bit if requested */
82. buf[bytes - 1] |= 1;
^
83. if (!BN_bin2bn(buf, bytes, rnd))
84. goto err;
|
https://github.com/openssl/openssl/blob/0282aeb690d63fab73a07191b63300a2fe30d212/crypto/bn/bn_rand.c/#L82
|
d2a_code_trace_data_43022
|
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: [31, +oo] Size: [0, 8388607] by call to `BN_mod_mul`.
Showing all 15 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:110:5: Assignment
108. BN_ULONG *rp;
109.
110. max = n * 2;
^
111. ap = a;
112. rp = r;
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:113:13: Array access: Offset: [31, +oo] Size: [0, 8388607] by call to `BN_mod_mul`
111. ap = a;
112. rp = r;
113. rp[0] = rp[max - 1] = 0;
^
114. rp++;
115. j = n;
|
https://github.com/openssl/openssl/blob/69588edbaa424beb71c6a9b1be416588232cb78c/crypto/bn/bn_sqr.c/#L113
|
d2a_code_trace_data_43023
|
BIGNUM *load_serial(char *serialfile, int create, ASN1_INTEGER **retai)
{
BIO *in = NULL;
BIGNUM *ret = NULL;
char buf[1024];
ASN1_INTEGER *ai = NULL;
ai = ASN1_INTEGER_new();
if (ai == NULL)
goto err;
in = BIO_new_file(serialfile, "r");
if (in == NULL) {
if (!create) {
perror(serialfile);
goto err;
}
ERR_clear_error();
ret = BN_new();
if (ret == NULL || !rand_serial(ret, ai))
BIO_printf(bio_err, "Out of memory\n");
} else {
if (!a2i_ASN1_INTEGER(in, ai, buf, 1024)) {
BIO_printf(bio_err, "unable to load number from %s\n",
serialfile);
goto err;
}
ret = ASN1_INTEGER_to_BN(ai, NULL);
if (ret == NULL) {
BIO_printf(bio_err,
"error converting number from bin to BIGNUM\n");
goto err;
}
}
if (ret && retai) {
*retai = ai;
ai = NULL;
}
err:
BIO_free(in);
ASN1_INTEGER_free(ai);
return (ret);
}
apps/apps.c:1422: error: MEMORY_LEAK
memory dynamically allocated by call to `ASN1_INTEGER_new()` at line 1388, column 10 is not reachable after line 1422, column 5.
Showing all 71 steps of the trace
apps/apps.c:1381:1: start of procedure load_serial()
1379. #undef BSIZE
1380. #define BSIZE 256
1381. > BIGNUM *load_serial(char *serialfile, int create, ASN1_INTEGER **retai)
1382. {
1383. BIO *in = NULL;
apps/apps.c:1383:5:
1381. BIGNUM *load_serial(char *serialfile, int create, ASN1_INTEGER **retai)
1382. {
1383. > BIO *in = NULL;
1384. BIGNUM *ret = NULL;
1385. char buf[1024];
apps/apps.c:1384:5:
1382. {
1383. BIO *in = NULL;
1384. > BIGNUM *ret = NULL;
1385. char buf[1024];
1386. ASN1_INTEGER *ai = NULL;
apps/apps.c:1386:5:
1384. BIGNUM *ret = NULL;
1385. char buf[1024];
1386. > ASN1_INTEGER *ai = NULL;
1387.
1388. ai = ASN1_INTEGER_new();
apps/apps.c:1388:5:
1386. ASN1_INTEGER *ai = NULL;
1387.
1388. > ai = ASN1_INTEGER_new();
1389. if (ai == NULL)
1390. goto err;
crypto/asn1/tasn_typ.c:78:1: start of procedure ASN1_INTEGER_new()
76.
77. IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_OCTET_STRING)
78. > IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_INTEGER)
79. IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_ENUMERATED)
80. IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_BIT_STRING)
crypto/asn1/asn1_lib.c:349:1: start of procedure ASN1_STRING_type_new()
347. }
348.
349. > ASN1_STRING *ASN1_STRING_type_new(int type)
350. {
351. ASN1_STRING *ret;
crypto/asn1/asn1_lib.c:353:5:
351. ASN1_STRING *ret;
352.
353. > ret = OPENSSL_zalloc(sizeof(*ret));
354. if (ret == NULL) {
355. ASN1err(ASN1_F_ASN1_STRING_TYPE_NEW, ERR_R_MALLOC_FAILURE);
crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
155. }
156.
157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:159:5:
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. > void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:161:9: Taking true branch
159. void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
^
162. memset(ret, 0, num);
163. return ret;
crypto/mem.c:162:9:
160.
161. if (ret != NULL)
162. > memset(ret, 0, num);
163. return ret;
164. }
crypto/mem.c:163:5:
161. if (ret != NULL)
162. memset(ret, 0, num);
163. > return ret;
164. }
165.
crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
162. memset(ret, 0, num);
163. return ret;
164. > }
165.
166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/asn1/asn1_lib.c:354:9: Taking false branch
352.
353. ret = OPENSSL_zalloc(sizeof(*ret));
354. if (ret == NULL) {
^
355. ASN1err(ASN1_F_ASN1_STRING_TYPE_NEW, ERR_R_MALLOC_FAILURE);
356. return (NULL);
crypto/asn1/asn1_lib.c:358:5:
356. return (NULL);
357. }
358. > ret->type = type;
359. return (ret);
360. }
crypto/asn1/asn1_lib.c:359:5:
357. }
358. ret->type = type;
359. > return (ret);
360. }
361.
crypto/asn1/asn1_lib.c:360:1: return from a call to ASN1_STRING_type_new
358. ret->type = type;
359. return (ret);
360. > }
361.
362. void ASN1_STRING_free(ASN1_STRING *a)
crypto/asn1/tasn_typ.c:78:1: return from a call to ASN1_INTEGER_new
76.
77. IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_OCTET_STRING)
78. > IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_INTEGER)
79. IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_ENUMERATED)
80. IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_BIT_STRING)
apps/apps.c:1389:9: Taking false branch
1387.
1388. ai = ASN1_INTEGER_new();
1389. if (ai == NULL)
^
1390. goto err;
1391.
apps/apps.c:1392:5: Skipping BIO_new_file(): empty list of specs
1390. goto err;
1391.
1392. in = BIO_new_file(serialfile, "r");
^
1393. if (in == NULL) {
1394. if (!create) {
apps/apps.c:1393:9: Taking false branch
1391.
1392. in = BIO_new_file(serialfile, "r");
1393. if (in == NULL) {
^
1394. if (!create) {
1395. perror(serialfile);
apps/apps.c:1403:14: Taking true branch
1401. BIO_printf(bio_err, "Out of memory\n");
1402. } else {
1403. if (!a2i_ASN1_INTEGER(in, ai, buf, 1024)) {
^
1404. BIO_printf(bio_err, "unable to load number from %s\n",
1405. serialfile);
apps/apps.c:1404:13: Skipping BIO_printf(): empty list of specs
1402. } else {
1403. if (!a2i_ASN1_INTEGER(in, ai, buf, 1024)) {
1404. BIO_printf(bio_err, "unable to load number from %s\n",
^
1405. serialfile);
1406. goto err;
apps/apps.c:1420:2:
1418. ai = NULL;
1419. }
1420. > err:
1421. BIO_free(in);
1422. ASN1_INTEGER_free(ai);
apps/apps.c:1421:5:
1419. }
1420. err:
1421. > BIO_free(in);
1422. ASN1_INTEGER_free(ai);
1423. return (ret);
crypto/bio/bio_lib.c:106:1: start of procedure BIO_free()
104. }
105.
106. > int BIO_free(BIO *a)
107. {
108. int i;
crypto/bio/bio_lib.c:110:9: Taking false branch
108. int i;
109.
110. if (a == NULL)
^
111. return (0);
112.
crypto/bio/bio_lib.c:113:5:
111. return (0);
112.
113. > i = CRYPTO_add(&a->references, -1, CRYPTO_LOCK_BIO);
114. #ifdef REF_PRINT
115. REF_PRINT("BIO", a);
crypto/lock.c:456:1: start of procedure CRYPTO_add_lock()
454. }
455.
456. > int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,
457. int line)
458. {
crypto/lock.c:459:5:
457. int line)
458. {
459. > int ret = 0;
460.
461. if (add_lock_callback != NULL) {
crypto/lock.c:461:9: Taking false branch
459. int ret = 0;
460.
461. if (add_lock_callback != NULL) {
^
462. #ifdef LOCK_DEBUG
463. int before = *pointer;
crypto/lock.c:477:9:
475. #endif
476. } else {
477. > CRYPTO_lock(CRYPTO_LOCK | CRYPTO_WRITE, type, file, line);
478.
479. ret = *pointer + amount;
crypto/lock.c:414:1: start of procedure CRYPTO_lock()
412. }
413.
414. > void CRYPTO_lock(int mode, int type, const char *file, int line)
415. {
416. #ifdef LOCK_DEBUG
crypto/lock.c:441:9: Taking false branch
439. }
440. #endif
441. if (type < 0) {
^
442. if (dynlock_lock_callback != NULL) {
443. struct CRYPTO_dynlock_value *pointer
crypto/lock.c:452:16: Taking false branch
450. CRYPTO_destroy_dynlockid(type);
451. }
452. } else if (locking_callback != NULL)
^
453. locking_callback(mode, type, file, line);
454. }
crypto/lock.c:441:5:
439. }
440. #endif
441. > if (type < 0) {
442. if (dynlock_lock_callback != NULL) {
443. struct CRYPTO_dynlock_value *pointer
crypto/lock.c:454:1: return from a call to CRYPTO_lock
452. } else if (locking_callback != NULL)
453. locking_callback(mode, type, file, line);
454. > }
455.
456. int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,
crypto/lock.c:479:9:
477. CRYPTO_lock(CRYPTO_LOCK | CRYPTO_WRITE, type, file, line);
478.
479. > ret = *pointer + amount;
480. #ifdef LOCK_DEBUG
481. {
crypto/lock.c:490:9:
488. }
489. #endif
490. > *pointer = ret;
491. CRYPTO_lock(CRYPTO_UNLOCK | CRYPTO_WRITE, type, file, line);
492. }
crypto/lock.c:491:9:
489. #endif
490. *pointer = ret;
491. > CRYPTO_lock(CRYPTO_UNLOCK | CRYPTO_WRITE, type, file, line);
492. }
493. return (ret);
crypto/lock.c:414:1: start of procedure CRYPTO_lock()
412. }
413.
414. > void CRYPTO_lock(int mode, int type, const char *file, int line)
415. {
416. #ifdef LOCK_DEBUG
crypto/lock.c:441:9: Taking false branch
439. }
440. #endif
441. if (type < 0) {
^
442. if (dynlock_lock_callback != NULL) {
443. struct CRYPTO_dynlock_value *pointer
crypto/lock.c:452:16: Taking false branch
450. CRYPTO_destroy_dynlockid(type);
451. }
452. } else if (locking_callback != NULL)
^
453. locking_callback(mode, type, file, line);
454. }
crypto/lock.c:441:5:
439. }
440. #endif
441. > if (type < 0) {
442. if (dynlock_lock_callback != NULL) {
443. struct CRYPTO_dynlock_value *pointer
crypto/lock.c:454:1: return from a call to CRYPTO_lock
452. } else if (locking_callback != NULL)
453. locking_callback(mode, type, file, line);
454. > }
455.
456. int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,
crypto/lock.c:493:5:
491. CRYPTO_lock(CRYPTO_UNLOCK | CRYPTO_WRITE, type, file, line);
492. }
493. > return (ret);
494. }
495.
crypto/lock.c:494:1: return from a call to CRYPTO_add_lock
492. }
493. return (ret);
494. > }
495.
496. const char *CRYPTO_get_lock_name(int type)
crypto/bio/bio_lib.c:117:9: Taking false branch
115. REF_PRINT("BIO", a);
116. #endif
117. if (i > 0)
^
118. return (1);
119. #ifdef REF_CHECK
crypto/bio/bio_lib.c:125:10: Taking true branch
123. }
124. #endif
125. if ((a->callback != NULL) &&
^
126. ((i = (int)a->callback(a, BIO_CB_FREE, NULL, 0, 0L, 1L)) <= 0))
127. return (i);
crypto/bio/bio_lib.c:126:10: Taking true branch
124. #endif
125. if ((a->callback != NULL) &&
126. ((i = (int)a->callback(a, BIO_CB_FREE, NULL, 0, 0L, 1L)) <= 0))
^
127. return (i);
128.
crypto/bio/bio_lib.c:127:9:
125. if ((a->callback != NULL) &&
126. ((i = (int)a->callback(a, BIO_CB_FREE, NULL, 0, 0L, 1L)) <= 0))
127. > return (i);
128.
129. CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, a, &a->ex_data);
crypto/bio/bio_lib.c:135:1: return from a call to BIO_free
133. OPENSSL_free(a);
134. return (1);
135. > }
136.
137. void BIO_vfree(BIO *a)
apps/apps.c:1422:5:
1420. err:
1421. BIO_free(in);
1422. > ASN1_INTEGER_free(ai);
1423. return (ret);
1424. }
crypto/asn1/tasn_typ.c:78:1: start of procedure ASN1_INTEGER_free()
76.
77. IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_OCTET_STRING)
78. > IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_INTEGER)
79. IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_ENUMERATED)
80. IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_BIT_STRING)
crypto/asn1/asn1_lib.c:362:1: start of procedure ASN1_STRING_free()
360. }
361.
362. > void ASN1_STRING_free(ASN1_STRING *a)
363. {
364. if (a == NULL)
crypto/asn1/asn1_lib.c:364:9: Taking false branch
362. void ASN1_STRING_free(ASN1_STRING *a)
363. {
364. if (a == NULL)
^
365. return;
366. if (!(a->flags & ASN1_STRING_FLAG_NDEF))
crypto/asn1/asn1_lib.c:366:11: Taking false branch
364. if (a == NULL)
365. return;
366. if (!(a->flags & ASN1_STRING_FLAG_NDEF))
^
367. OPENSSL_free(a->data);
368. if (!(a->flags & ASN1_STRING_FLAG_EMBED))
crypto/asn1/asn1_lib.c:368:11: Taking false branch
366. if (!(a->flags & ASN1_STRING_FLAG_NDEF))
367. OPENSSL_free(a->data);
368. if (!(a->flags & ASN1_STRING_FLAG_EMBED))
^
369. OPENSSL_free(a);
370. }
crypto/asn1/asn1_lib.c:368:5:
366. if (!(a->flags & ASN1_STRING_FLAG_NDEF))
367. OPENSSL_free(a->data);
368. > if (!(a->flags & ASN1_STRING_FLAG_EMBED))
369. OPENSSL_free(a);
370. }
crypto/asn1/asn1_lib.c:370:1: return from a call to ASN1_STRING_free
368. if (!(a->flags & ASN1_STRING_FLAG_EMBED))
369. OPENSSL_free(a);
370. > }
371.
372. void ASN1_STRING_clear_free(ASN1_STRING *a)
crypto/asn1/tasn_typ.c:78:1: return from a call to ASN1_INTEGER_free
76.
77. IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_OCTET_STRING)
78. > IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_INTEGER)
79. IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_ENUMERATED)
80. IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_BIT_STRING)
|
https://github.com/openssl/openssl/blob/fe05264e32327e33f0b0c091479affeecbf55e89/apps/apps.c/#L1422
|
d2a_code_trace_data_43024
|
static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size)
{
EightBpsContext * const c = avctx->priv_data;
const unsigned char *encoded = buf;
unsigned char *pixptr, *pixptr_end;
unsigned int height = avctx->height;
unsigned int dlen, p, row;
const unsigned char *lp, *dp;
unsigned char count;
unsigned int px_inc;
unsigned int planes = c->planes;
unsigned char *planemap = c->planemap;
if(c->pic.data[0])
avctx->release_buffer(avctx, &c->pic);
c->pic.reference = 0;
c->pic.buffer_hints = FF_BUFFER_HINTS_VALID;
if(avctx->get_buffer(avctx, &c->pic) < 0){
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}
dp = encoded + planes * (height << 1);
if (planes == 4)
planes--;
px_inc = planes + (avctx->pix_fmt == PIX_FMT_RGB32);
for (p = 0; p < planes; p++) {
lp = encoded + p * (height << 1);
for(row = 0; row < height; row++) {
pixptr = c->pic.data[0] + row * c->pic.linesize[0] + planemap[p];
pixptr_end = pixptr + c->pic.linesize[0];
dlen = be2me_16(*(const unsigned short *)(lp+row*2));
while(dlen > 0) {
if(dp + 1 >= buf+buf_size) return -1;
if ((count = *dp++) <= 127) {
count++;
dlen -= count + 1;
if (pixptr + count * px_inc > pixptr_end)
break;
if(dp + count > buf+buf_size) return -1;
while(count--) {
*pixptr = *dp++;
pixptr += px_inc;
}
} else {
count = 257 - count;
if (pixptr + count * px_inc > pixptr_end)
break;
while(count--) {
*pixptr = *dp;
pixptr += px_inc;
}
dp++;
dlen -= 2;
}
}
}
}
if (avctx->palctrl) {
memcpy (c->pic.data[1], avctx->palctrl->palette, AVPALETTE_SIZE);
if (avctx->palctrl->palette_changed) {
c->pic.palette_has_changed = 1;
avctx->palctrl->palette_changed = 0;
} else
c->pic.palette_has_changed = 0;
}
*data_size = sizeof(AVFrame);
*(AVFrame*)data = c->pic;
return buf_size;
}
libavcodec/8bps.c:106: error: Integer Overflow L2
([1, +oo] - [`*buf` + 2, 2+min(127, `*buf`)]):unsigned32.
libavcodec/8bps.c:60:1: <LHS trace>
58. *
59. */
60. static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size)
^
61. {
62. EightBpsContext * const c = avctx->priv_data;
libavcodec/8bps.c:60:1: Parameter `*buf`
58. *
59. */
60. static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size)
^
61. {
62. EightBpsContext * const c = avctx->priv_data;
libavcodec/8bps.c:100:32: Assignment
98. pixptr = c->pic.data[0] + row * c->pic.linesize[0] + planemap[p];
99. pixptr_end = pixptr + c->pic.linesize[0];
100. dlen = be2me_16(*(const unsigned short *)(lp+row*2));
^
101. /* Decode a row of this plane */
102. while(dlen > 0) {
libavcodec/8bps.c:100:25: Assignment
98. pixptr = c->pic.data[0] + row * c->pic.linesize[0] + planemap[p];
99. pixptr_end = pixptr + c->pic.linesize[0];
100. dlen = be2me_16(*(const unsigned short *)(lp+row*2));
^
101. /* Decode a row of this plane */
102. while(dlen > 0) {
libavcodec/8bps.c:60:1: <RHS trace>
58. *
59. */
60. static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size)
^
61. {
62. EightBpsContext * const c = avctx->priv_data;
libavcodec/8bps.c:60:1: Parameter `*buf`
58. *
59. */
60. static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size)
^
61. {
62. EightBpsContext * const c = avctx->priv_data;
libavcodec/8bps.c:104:38: Assignment
102. while(dlen > 0) {
103. if(dp + 1 >= buf+buf_size) return -1;
104. if ((count = *dp++) <= 127) {
^
105. count++;
106. dlen -= count + 1;
libavcodec/8bps.c:105:41: Assignment
103. if(dp + 1 >= buf+buf_size) return -1;
104. if ((count = *dp++) <= 127) {
105. count++;
^
106. dlen -= count + 1;
107. if (pixptr + count * px_inc > pixptr_end)
libavcodec/8bps.c:106:41: Binary operation: ([1, +oo] - [*buf + 2, 2+min(127, *buf)]):unsigned32
104. if ((count = *dp++) <= 127) {
105. count++;
106. dlen -= count + 1;
^
107. if (pixptr + count * px_inc > pixptr_end)
108. break;
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/8bps.c/#L106
|
d2a_code_trace_data_43025
|
static AVCodec *find_codec_or_die(const char *name, enum AVMediaType type, int encoder)
{
const char *codec_string = encoder ? "encoder" : "decoder";
AVCodec *codec;
codec = encoder ?
avcodec_find_encoder_by_name(name) :
avcodec_find_decoder_by_name(name);
if (!codec) {
av_log(NULL, AV_LOG_FATAL, "Unknown %s '%s'\n", codec_string, name);
exit_program(1);
}
if (codec->type != type) {
av_log(NULL, AV_LOG_FATAL, "Invalid %s type '%s'\n", codec_string, name);
exit_program(1);
}
return codec;
}
avconv.c:3083: error: Null Dereference
pointer `codec` last assigned on line 3076 could be null and is dereferenced at line 3083, column 9.
avconv.c:3071:1: start of procedure find_codec_or_die()
3069. }
3070.
3071. static AVCodec *find_codec_or_die(const char *name, enum AVMediaType type, int encoder)
^
3072. {
3073. const char *codec_string = encoder ? "encoder" : "decoder";
avconv.c:3073:32: Condition is true
3071. static AVCodec *find_codec_or_die(const char *name, enum AVMediaType type, int encoder)
3072. {
3073. const char *codec_string = encoder ? "encoder" : "decoder";
^
3074. AVCodec *codec;
3075.
avconv.c:3073:5:
3071. static AVCodec *find_codec_or_die(const char *name, enum AVMediaType type, int encoder)
3072. {
3073. const char *codec_string = encoder ? "encoder" : "decoder";
^
3074. AVCodec *codec;
3075.
avconv.c:3076:13: Condition is true
3074. AVCodec *codec;
3075.
3076. codec = encoder ?
^
3077. avcodec_find_encoder_by_name(name) :
3078. avcodec_find_decoder_by_name(name);
avconv.c:3076:5:
3074. AVCodec *codec;
3075.
3076. codec = encoder ?
^
3077. avcodec_find_encoder_by_name(name) :
3078. avcodec_find_decoder_by_name(name);
avconv.c:3079:10: Taking true branch
3077. avcodec_find_encoder_by_name(name) :
3078. avcodec_find_decoder_by_name(name);
3079. if (!codec) {
^
3080. av_log(NULL, AV_LOG_FATAL, "Unknown %s '%s'\n", codec_string, name);
3081. exit_program(1);
avconv.c:3080:9: Skipping av_log(): empty list of specs
3078. avcodec_find_decoder_by_name(name);
3079. if (!codec) {
3080. av_log(NULL, AV_LOG_FATAL, "Unknown %s '%s'\n", codec_string, name);
^
3081. exit_program(1);
3082. }
avconv.c:3081:9: Skipping exit_program(): empty list of specs
3079. if (!codec) {
3080. av_log(NULL, AV_LOG_FATAL, "Unknown %s '%s'\n", codec_string, name);
3081. exit_program(1);
^
3082. }
3083. if (codec->type != type) {
avconv.c:3083:9:
3081. exit_program(1);
3082. }
3083. if (codec->type != type) {
^
3084. av_log(NULL, AV_LOG_FATAL, "Invalid %s type '%s'\n", codec_string, name);
3085. exit_program(1);
|
https://github.com/libav/libav/blob/e1e369049e3d2f88eed6ed38eb3dd704681c7f1a/avconv.c/#L3083
|
d2a_code_trace_data_43026
|
int BN_hex2bn(BIGNUM **bn, const char *a)
{
BIGNUM *ret = NULL;
BN_ULONG l = 0;
int neg = 0, h, m, i, j, k, c;
int num;
if (a == NULL || *a == '\0')
return 0;
if (*a == '-') {
neg = 1;
a++;
}
for (i = 0; i <= INT_MAX / 4 && ossl_isxdigit(a[i]); i++)
continue;
if (i == 0 || i > INT_MAX / 4)
goto err;
num = i + neg;
if (bn == NULL)
return num;
if (*bn == NULL) {
if ((ret = BN_new()) == NULL)
return 0;
} else {
ret = *bn;
BN_zero(ret);
}
if (bn_expand(ret, i * 4) == NULL)
goto err;
j = i;
m = 0;
h = 0;
while (j > 0) {
m = (BN_BYTES * 2 <= j) ? BN_BYTES * 2 : j;
l = 0;
for (;;) {
c = a[j - m];
k = OPENSSL_hexchar2int(c);
if (k < 0)
k = 0;
l = (l << 4) | k;
if (--m <= 0) {
ret->d[h++] = l;
break;
}
}
j -= BN_BYTES * 2;
}
ret->top = h;
bn_correct_top(ret);
*bn = ret;
bn_check_top(ret);
if (ret->top != 0)
ret->neg = neg;
return num;
err:
if (*bn == NULL)
BN_free(ret);
return 0;
}
test/params_test.c:103: error: BUFFER_OVERRUN_L2
Offset: [-15, 536870911] (⇐ [0, 1] + [-15, 536870910]) Size: 125 by call to `BN_hex2bn`.
Showing all 7 steps of the trace
test/params_test.c:103:10: Call
101. obj->p1 = p1_init;
102. obj->p2 = p2_init;
103. if (!TEST_true(BN_hex2bn(&obj->p3, p3_init)))
^
104. goto fail;
105. if (!TEST_ptr(obj->p4 = OPENSSL_strdup(p4_init)))
crypto/bn/bn_print.c:141:10: <Offset trace>
139. }
140.
141. for (i = 0; i <= INT_MAX / 4 && ossl_isxdigit(a[i]); i++)
^
142. continue;
143.
crypto/bn/bn_print.c:141:10: Assignment
139. }
140.
141. for (i = 0; i <= INT_MAX / 4 && ossl_isxdigit(a[i]); i++)
^
142. continue;
143.
crypto/bn/bn_print.c:164:5: Assignment
162. goto err;
163.
164. j = i; /* least significant 'hex' */
^
165. m = 0;
166. h = 0;
crypto/bn/bn_print.c:126:1: <Length trace>
124. }
125.
126. > int BN_hex2bn(BIGNUM **bn, const char *a)
127. {
128. BIGNUM *ret = NULL;
crypto/bn/bn_print.c:126:1: Parameter `*a`
124. }
125.
126. > int BN_hex2bn(BIGNUM **bn, const char *a)
127. {
128. BIGNUM *ret = NULL;
crypto/bn/bn_print.c:171:17: Array access: Offset: [-15, 536870911] (⇐ [0, 1] + [-15, 536870910]) Size: 125 by call to `BN_hex2bn`
169. l = 0;
170. for (;;) {
171. c = a[j - m];
^
172. k = OPENSSL_hexchar2int(c);
173. if (k < 0)
|
https://github.com/openssl/openssl/blob/fff684168c7923aa85e6b4381d71d933396e32b0/crypto/bn/bn_print.c/#L171
|
d2a_code_trace_data_43027
|
int bn_cmp_words(const BN_ULONG *a, const BN_ULONG *b, int n)
{
int i;
BN_ULONG aa, bb;
if (n == 0)
return 0;
aa = a[n - 1];
bb = b[n - 1];
if (aa != bb)
return ((aa > bb) ? 1 : -1);
for (i = n - 2; i >= 0; i--) {
aa = a[i];
bb = b[i];
if (aa != bb)
return ((aa > bb) ? 1 : -1);
}
return 0;
}
test/bntest.c:412: error: BUFFER_OVERRUN_L3
Offset: [8, +oo] (⇐ [8, +oo] + [0, +oo]) Size: [0, 8388607] by call to `BN_mod_exp_mont_consttime`.
Showing all 23 steps of the trace
test/bntest.c:406:11: Call
404.
405. /* must be odd for montgomery */
406. if (!(TEST_true(BN_bntest_rand(m, 1024, 0, 1))
^
407. /* Zero exponent */
408. && TEST_true(BN_bntest_rand(a, 1024, 0, 0))))
crypto/bn/bn_rand.c:111:1: Parameter `*rnd->d`
109. }
110.
111. > int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom)
112. {
113. return bnrand(TESTING, rnd, bits, top, bottom, NULL);
crypto/bn/bn_rand.c:113:12: Call
111. int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom)
112. {
113. return bnrand(TESTING, rnd, bits, top, bottom, NULL);
^
114. }
115.
crypto/bn/bn_rand.c:23:1: Parameter `*rnd->d`
21. } BNRAND_FLAG;
22.
23. > static int bnrand(BNRAND_FLAG flag, BIGNUM *rnd, int bits, int top, int bottom,
24. BN_CTX *ctx)
25. {
test/bntest.c:412:10: Call
410. BN_zero(p);
411.
412. if (!TEST_true(BN_mod_exp_mont_consttime(d, a, p, m, ctx, NULL)))
^
413. goto err;
414. if (!TEST_BN_eq_one(d))
crypto/bn/bn_exp.c:592:1: Parameter `*a->d`
590. * http://www.daemonology.net/hyperthreading-considered-harmful/)
591. */
592. > int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
593. const BIGNUM *m, BN_CTX *ctx,
594. BN_MONT_CTX *in_mont)
crypto/bn/bn_exp.c:757:10: Call
755.
756. /* prepare a^1 in Montgomery domain */
757. if (!bn_to_mont_fixed_top(&am, a, mont, ctx))
^
758. goto err;
759.
crypto/bn/bn_mont.c:222:1: Parameter `*a->d`
220. }
221.
222. > int bn_to_mont_fixed_top(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont,
223. BN_CTX *ctx)
224. {
crypto/bn/bn_mont.c:225:12: Call
223. BN_CTX *ctx)
224. {
225. return bn_mul_mont_fixed_top(r, a, &(mont->RR), mont, ctx);
^
226. }
227.
crypto/bn/bn_mont.c:37:1: Parameter `*a->d`
35. }
36.
37. > int bn_mul_mont_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
38. BN_MONT_CTX *mont, BN_CTX *ctx)
39. {
crypto/bn/bn_mont.c:70:14: Call
68. goto err;
69. } else {
70. if (!bn_mul_fixed_top(tmp, a, b, ctx))
^
71. goto err;
72. }
crypto/bn/bn_mul.c:507:1: Parameter `*a->d`
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:587:17: Call
585. if (bn_wexpand(rr, k * 4) == NULL)
586. goto err;
587. bn_mul_part_recursive(rr->d, a->d, b->d,
^
588. j, al - j, bl - j, t->d);
589. } else { /* al <= j || bl <= j */
crypto/bn/bn_mul.c:322:1: Parameter `n`
320. */
321. /* tnX may not be negative but less than n */
322. > void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n,
323. int tna, int tnb, BN_ULONG *t)
324. {
crypto/bn/bn_mul.c:335:10: Call
333.
334. /* r=(a[0]-a[1])*(b[1]-b[0]) */
335. c1 = bn_cmp_part_words(a, &(a[n]), tna, n - tna);
^
336. c2 = bn_cmp_part_words(&(b[n]), b, tnb, tnb - n);
337. neg = 0;
crypto/bn/bn_lib.c:743:1: Parameter `cl`
741. */
742.
743. > int bn_cmp_part_words(const BN_ULONG *a, const BN_ULONG *b, int cl, int dl)
744. {
745. int n, i;
crypto/bn/bn_lib.c:760:12: Call
758. }
759. }
760. return bn_cmp_words(a, b, cl);
^
761. }
762.
crypto/bn/bn_lib.c:713:1: <Offset trace>
711. }
712.
713. > int bn_cmp_words(const BN_ULONG *a, const BN_ULONG *b, int n)
714. {
715. int i;
crypto/bn/bn_lib.c:713:1: Parameter `n`
711. }
712.
713. > int bn_cmp_words(const BN_ULONG *a, const BN_ULONG *b, int n)
714. {
715. int i;
crypto/bn/bn_lib.c:725:10: Assignment
723. if (aa != bb)
724. return ((aa > bb) ? 1 : -1);
725. for (i = n - 2; i >= 0; i--) {
^
726. aa = a[i];
727. bb = b[i];
crypto/bn/bn_lib.c:713:1: <Length trace>
711. }
712.
713. > int bn_cmp_words(const BN_ULONG *a, const BN_ULONG *b, int n)
714. {
715. int i;
crypto/bn/bn_lib.c:713:1: Parameter `*b`
711. }
712.
713. > int bn_cmp_words(const BN_ULONG *a, const BN_ULONG *b, int n)
714. {
715. int i;
crypto/bn/bn_lib.c:727:14: Array access: Offset: [8, +oo] (⇐ [8, +oo] + [0, +oo]) Size: [0, 8388607] by call to `BN_mod_exp_mont_consttime`
725. for (i = n - 2; i >= 0; i--) {
726. aa = a[i];
727. bb = b[i];
^
728. if (aa != bb)
729. return ((aa > bb) ? 1 : -1);
|
https://github.com/openssl/openssl/blob/bd01733fdd9a5a0acdc72cf5c6601d37e8ddd801/crypto/bn/bn_lib.c/#L727
|
d2a_code_trace_data_43028
|
static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
{
BN_ULONG *a = NULL;
if (words > (INT_MAX / (4 * BN_BITS2))) {
BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_BIGNUM_TOO_LONG);
return NULL;
}
if (BN_get_flags(b, BN_FLG_STATIC_DATA)) {
BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA);
return NULL;
}
if (BN_get_flags(b, BN_FLG_SECURE))
a = OPENSSL_secure_zalloc(words * sizeof(*a));
else
a = OPENSSL_zalloc(words * sizeof(*a));
if (a == NULL) {
BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE);
return NULL;
}
assert(b->top <= words);
if (b->top > 0)
memcpy(a, b->d, sizeof(*a) * b->top);
return a;
}
crypto/bn/bn_gf2m.c:1034: error: BUFFER_OVERRUN_L3
Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_priv_rand`.
Showing all 21 steps of the trace
crypto/bn/bn_gf2m.c:998:9: Call
996.
997. BN_CTX_start(ctx);
998. a = BN_CTX_get(ctx);
^
999. z = BN_CTX_get(ctx);
1000. w = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:240:5: Call
238. }
239. /* OK, make sure the returned bignum is "zero" */
240. BN_zero(ret);
^
241. /* clear BN_FLG_CONSTTIME if leaked from previous frames */
242. ret->flags &= (~BN_FLG_CONSTTIME);
crypto/bn/bn_lib.c:361:1: Parameter `*a->d`
359. }
360.
361. > int BN_set_word(BIGNUM *a, BN_ULONG w)
362. {
363. bn_check_top(a);
crypto/bn/bn_lib.c:364:9: Call
362. {
363. bn_check_top(a);
364. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
^
365. return 0;
366. a->neg = 0;
crypto/bn/bn_lcl.h:660:1: Parameter `*a->d`
658. const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx);
659.
660. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits)
661. {
662. if (bits > (INT_MAX - BN_BITS2 + 1))
crypto/bn/bn_gf2m.c:1034:18: Call
1032. goto err;
1033. do {
1034. if (!BN_priv_rand(rho, p[0], BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ANY))
^
1035. goto err;
1036. if (!BN_GF2m_mod_arr(rho, rho, p))
crypto/bn/bn_rand.c:121:1: Parameter `*rnd->d`
119. }
120.
121. > int BN_priv_rand(BIGNUM *rnd, int bits, int top, int bottom)
122. {
123. return bnrand(PRIVATE, rnd, bits, top, bottom, NULL);
crypto/bn/bn_rand.c:123:12: Call
121. int BN_priv_rand(BIGNUM *rnd, int bits, int top, int bottom)
122. {
123. return bnrand(PRIVATE, rnd, bits, top, bottom, NULL);
^
124. }
125.
crypto/bn/bn_rand.c:23:1: Parameter `*rnd->d`
21. } BNRAND_FLAG;
22.
23. > static int bnrand(BNRAND_FLAG flag, BIGNUM *rnd, int bits, int top, int bottom,
24. BN_CTX *ctx)
25. {
crypto/bn/bn_rand.c:89:10: Call
87. if (bottom) /* set bottom bit if requested */
88. buf[bytes - 1] |= 1;
89. if (!BN_bin2bn(buf, bytes, rnd))
^
90. goto err;
91. ret = 1;
crypto/bn/bn_lib.c:374:1: Parameter `*ret->d`
372. }
373.
374. > BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret)
375. {
376. unsigned int i, m;
crypto/bn/bn_lib.c:396:9: Call
394. i = ((n - 1) / BN_BYTES) + 1;
395. m = ((n - 1) % (BN_BYTES));
396. if (bn_wexpand(ret, (int)i) == NULL) {
^
397. BN_free(bn);
398. return NULL;
crypto/bn/bn_lib.c:962:1: Parameter `*a->d`
960. }
961.
962. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
963. {
964. return (words <= a->dmax) ? a : bn_expand2(a, words);
crypto/bn/bn_lib.c:964:37: Call
962. BIGNUM *bn_wexpand(BIGNUM *a, int words)
963. {
964. return (words <= a->dmax) ? a : bn_expand2(a, words);
^
965. }
966.
crypto/bn/bn_lib.c:245:1: Parameter `*b->d`
243. */
244.
245. > BIGNUM *bn_expand2(BIGNUM *b, int words)
246. {
247. if (words > b->dmax) {
crypto/bn/bn_lib.c:248:23: Call
246. {
247. if (words > b->dmax) {
248. BN_ULONG *a = bn_expand_internal(b, words);
^
249. if (!a)
250. return NULL;
crypto/bn/bn_lib.c:209:1: <Offset trace>
207. /* This is used by bn_expand2() */
208. /* The caller MUST check that words > b->dmax before calling this */
209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
210. {
211. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:209:1: Parameter `b->top`
207. /* This is used by bn_expand2() */
208. /* The caller MUST check that words > b->dmax before calling this */
209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
210. {
211. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:209:1: <Length trace>
207. /* This is used by bn_expand2() */
208. /* The caller MUST check that words > b->dmax before calling this */
209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
210. {
211. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:209:1: Parameter `*b->d`
207. /* This is used by bn_expand2() */
208. /* The caller MUST check that words > b->dmax before calling this */
209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
210. {
211. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:232:9: Array access: Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_priv_rand`
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_43029
|
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 `pitem_new()` at line 785, column 16 is not reachable after line 789, column 9.
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_43030
|
static ossl_inline void packet_forward(PACKET *pkt, size_t len)
{
pkt->curr += len;
pkt->remaining -= len;
}
test/packettest.c:91: error: INTEGER_OVERFLOW_L2
([0, +oo] - 251):unsigned64 by call to `PACKET_forward`.
Showing all 14 steps of the trace
test/packettest.c:88:10: Call
86. PACKET pkt;
87.
88. if (!TEST_true(PACKET_buf_init(&pkt, smbuf, BUF_LEN))
^
89. || !TEST_true(PACKET_get_net_2(&pkt, &i))
90. || !TEST_uint_eq(i, 0x0204)
ssl/packet_locl.h:72:8: Parameter `pkt->remaining`
70. * is being used.
71. */
72. __owur static ossl_inline int PACKET_buf_init(PACKET *pkt,
^
73. const unsigned char *buf,
74. size_t len)
test/packettest.c:89:17: Call
87.
88. if (!TEST_true(PACKET_buf_init(&pkt, smbuf, BUF_LEN))
89. || !TEST_true(PACKET_get_net_2(&pkt, &i))
^
90. || !TEST_uint_eq(i, 0x0204)
91. || !TEST_true(PACKET_forward(&pkt, BUF_LEN - 4))
ssl/packet_locl.h:153:8: Parameter `pkt->remaining`
151. /* Equivalent of n2s */
152. /* Get 2 bytes in network order from |pkt| and store the value in |*data| */
153. __owur static ossl_inline int PACKET_get_net_2(PACKET *pkt, unsigned int *data)
^
154. {
155. if (!PACKET_peek_net_2(pkt, data))
ssl/packet_locl.h:155:10: Call
153. __owur static ossl_inline int PACKET_get_net_2(PACKET *pkt, unsigned int *data)
154. {
155. if (!PACKET_peek_net_2(pkt, data))
^
156. return 0;
157.
ssl/packet_locl.h:139:8: Parameter `pkt->remaining`
137. * |*data|
138. */
139. __owur static ossl_inline int PACKET_peek_net_2(const PACKET *pkt,
^
140. unsigned int *data)
141. {
test/packettest.c:91:17: Call
89. || !TEST_true(PACKET_get_net_2(&pkt, &i))
90. || !TEST_uint_eq(i, 0x0204)
91. || !TEST_true(PACKET_forward(&pkt, BUF_LEN - 4))
^
92. || !TEST_true(PACKET_get_net_2(&pkt, &i))
93. || !TEST_uint_eq(i, 0xfcfe)
ssl/packet_locl.h:467:8: Parameter `len`
465.
466. /* Move the current reading position forward |len| bytes */
467. __owur static ossl_inline int PACKET_forward(PACKET *pkt, size_t len)
^
468. {
469. if (PACKET_remaining(pkt) < len)
ssl/packet_locl.h:472:5: Call
470. return 0;
471.
472. packet_forward(pkt, len);
^
473.
474. return 1;
ssl/packet_locl.h:33:1: <LHS trace>
31.
32. /* Internal unchecked shorthand; don't use outside this file. */
33. > static ossl_inline void packet_forward(PACKET *pkt, size_t len)
34. {
35. pkt->curr += len;
ssl/packet_locl.h:33:1: Parameter `pkt->remaining`
31.
32. /* Internal unchecked shorthand; don't use outside this file. */
33. > static ossl_inline void packet_forward(PACKET *pkt, size_t len)
34. {
35. pkt->curr += len;
ssl/packet_locl.h:33:1: <RHS trace>
31.
32. /* Internal unchecked shorthand; don't use outside this file. */
33. > static ossl_inline void packet_forward(PACKET *pkt, size_t len)
34. {
35. pkt->curr += len;
ssl/packet_locl.h:33:1: Parameter `len`
31.
32. /* Internal unchecked shorthand; don't use outside this file. */
33. > static ossl_inline void packet_forward(PACKET *pkt, size_t len)
34. {
35. pkt->curr += len;
ssl/packet_locl.h:36:5: Binary operation: ([0, +oo] - 251):unsigned64 by call to `PACKET_forward`
34. {
35. pkt->curr += len;
36. pkt->remaining -= len;
^
37. }
38.
|
https://github.com/openssl/openssl/blob/424aa352458486d67e1e9cd3d3990dc06a60ba4a/ssl/packet_locl.h/#L36
|
d2a_code_trace_data_43031
|
static void decode(Real288_internal *glob, unsigned int input)
{
unsigned int x,y;
float f;
double sum,sumsum;
float *p1,*p2;
float buffer[5];
const float *table;
for (x=36;x--;glob->sb[x+5]=glob->sb[x]);
for (x=5;x--;) {
p1=glob->sb+x;p2=glob->pr1;
for (sum=0,y=36;y--;sum-=(*(++p1))*(*(p2++)));
glob->sb[x]=sum;
}
f=amptable[input&7];
table=codetable+(input>>3)*5;
for (sum=32,x=10;x--;sum-=glob->pr2[x]*glob->lhist[x]);
if (sum<0) sum=0; else if (sum>60) sum=60;
sumsum=exp(sum*0.1151292546497)*f;
for (sum=0,x=5;x--;) { buffer[x]=table[x]*sumsum; sum+=buffer[x]*buffer[x]; }
if ((sum/=5)<1) sum=1;
for (x=10;--x;glob->lhist[x]=glob->lhist[x-1]);
*glob->lhist=glob->history[glob->phase]=10*log10(sum)-32;
for (x=1;x<5;x++) for (y=x;y--;buffer[x]-=glob->pr1[x-y-1]*buffer[y]);
for (x=0;x<5;x++) {
f=glob->sb[4-x]+buffer[x];
if (f>4095) f=4095; else if (f<-4095) f=-4095;
glob->output[glob->phasep+x]=glob->sb[4-x]=f;
}
}
libavcodec/ra288.c:122: error: Buffer Overrun L3
Offset: [-3, +oo] Size: 36.
libavcodec/ra288.c:122:8: <Offset trace>
120. *glob->lhist=glob->history[glob->phase]=10*log10(sum)-32;
121.
122. for (x=1;x<5;x++) for (y=x;y--;buffer[x]-=glob->pr1[x-y-1]*buffer[y]);
^
123.
124. /* output */
libavcodec/ra288.c:122:8: Assignment
120. *glob->lhist=glob->history[glob->phase]=10*log10(sum)-32;
121.
122. for (x=1;x<5;x++) for (y=x;y--;buffer[x]-=glob->pr1[x-y-1]*buffer[y]);
^
123.
124. /* output */
libavcodec/ra288.c:91:1: <Length trace>
89.
90. /* Decode and produce output */
91. static void decode(Real288_internal *glob, unsigned int input)
^
92. {
93. unsigned int x,y;
libavcodec/ra288.c:91:1: Parameter `glob->pr1[*]`
89.
90. /* Decode and produce output */
91. static void decode(Real288_internal *glob, unsigned int input)
^
92. {
93. unsigned int x,y;
libavcodec/ra288.c:122:45: Array access: Offset: [-3, +oo] Size: 36
120. *glob->lhist=glob->history[glob->phase]=10*log10(sum)-32;
121.
122. for (x=1;x<5;x++) for (y=x;y--;buffer[x]-=glob->pr1[x-y-1]*buffer[y]);
^
123.
124. /* output */
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/ra288.c/#L122
|
d2a_code_trace_data_43032
|
static int tls_construct_cke_rsa(SSL *s, WPACKET *pkt, int *al)
{
#ifndef OPENSSL_NO_RSA
unsigned char *encdata = NULL;
EVP_PKEY *pkey = NULL;
EVP_PKEY_CTX *pctx = NULL;
size_t enclen;
unsigned char *pms = NULL;
size_t pmslen = 0;
if (s->session->peer == NULL) {
SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR);
return 0;
}
pkey = X509_get0_pubkey(s->session->peer);
if (EVP_PKEY_get0_RSA(pkey) == NULL) {
SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR);
return 0;
}
pmslen = SSL_MAX_MASTER_KEY_LENGTH;
pms = OPENSSL_malloc(pmslen);
if (pms == NULL) {
SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_MALLOC_FAILURE);
*al = SSL_AD_INTERNAL_ERROR;
return 0;
}
pms[0] = s->client_version >> 8;
pms[1] = s->client_version & 0xff;
if (RAND_bytes(pms + 2, pmslen - 2) <= 0) {
goto err;
}
if (s->version > SSL3_VERSION && !WPACKET_start_sub_packet_u16(pkt)) {
SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR);
goto err;
}
pctx = EVP_PKEY_CTX_new(pkey, NULL);
if (pctx == NULL || EVP_PKEY_encrypt_init(pctx) <= 0
|| EVP_PKEY_encrypt(pctx, NULL, &enclen, pms, pmslen) <= 0) {
SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_EVP_LIB);
goto err;
}
if (!WPACKET_allocate_bytes(pkt, enclen, &encdata)
|| EVP_PKEY_encrypt(pctx, encdata, &enclen, pms, pmslen) <= 0) {
SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, SSL_R_BAD_RSA_ENCRYPT);
goto err;
}
EVP_PKEY_CTX_free(pctx);
pctx = NULL;
# ifdef PKCS1_CHECK
if (s->options & SSL_OP_PKCS1_CHECK_1)
(*p)[1]++;
if (s->options & SSL_OP_PKCS1_CHECK_2)
tmp_buf[0] = 0x70;
# endif
if (s->version > SSL3_VERSION && !WPACKET_close(pkt)) {
SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR);
goto err;
}
s->s3->tmp.pms = pms;
s->s3->tmp.pmslen = pmslen;
return 1;
err:
OPENSSL_clear_free(pms, pmslen);
EVP_PKEY_CTX_free(pctx);
return 0;
#else
SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR);
*al = SSL_AD_INTERNAL_ERROR;
return 0;
#endif
}
ssl/statem/statem_clnt.c:2177: error: NULL_DEREFERENCE
pointer `pkey` last assigned on line 2176 could be null and is dereferenced by call to `EVP_PKEY_get0_RSA()` at line 2177, column 9.
Showing all 30 steps of the trace
ssl/statem/statem_clnt.c:2158:1: start of procedure tls_construct_cke_rsa()
2156. }
2157.
2158. > static int tls_construct_cke_rsa(SSL *s, WPACKET *pkt, int *al)
2159. {
2160. #ifndef OPENSSL_NO_RSA
ssl/statem/statem_clnt.c:2161:5:
2159. {
2160. #ifndef OPENSSL_NO_RSA
2161. > unsigned char *encdata = NULL;
2162. EVP_PKEY *pkey = NULL;
2163. EVP_PKEY_CTX *pctx = NULL;
ssl/statem/statem_clnt.c:2162:5:
2160. #ifndef OPENSSL_NO_RSA
2161. unsigned char *encdata = NULL;
2162. > EVP_PKEY *pkey = NULL;
2163. EVP_PKEY_CTX *pctx = NULL;
2164. size_t enclen;
ssl/statem/statem_clnt.c:2163:5:
2161. unsigned char *encdata = NULL;
2162. EVP_PKEY *pkey = NULL;
2163. > EVP_PKEY_CTX *pctx = NULL;
2164. size_t enclen;
2165. unsigned char *pms = NULL;
ssl/statem/statem_clnt.c:2165:5:
2163. EVP_PKEY_CTX *pctx = NULL;
2164. size_t enclen;
2165. > unsigned char *pms = NULL;
2166. size_t pmslen = 0;
2167.
ssl/statem/statem_clnt.c:2166:5:
2164. size_t enclen;
2165. unsigned char *pms = NULL;
2166. > size_t pmslen = 0;
2167.
2168. if (s->session->peer == NULL) {
ssl/statem/statem_clnt.c:2168:9: Taking false branch
2166. size_t pmslen = 0;
2167.
2168. if (s->session->peer == NULL) {
^
2169. /*
2170. * We should always have a server certificate with SSL_kRSA.
ssl/statem/statem_clnt.c:2176:5:
2174. }
2175.
2176. > pkey = X509_get0_pubkey(s->session->peer);
2177. if (EVP_PKEY_get0_RSA(pkey) == NULL) {
2178. 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:2177:9:
2175.
2176. pkey = X509_get0_pubkey(s->session->peer);
2177. > if (EVP_PKEY_get0_RSA(pkey) == NULL) {
2178. SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR);
2179. 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/869d0a37cfa7cfdbd42026d2b75d14cdc64e81e0/ssl/statem/statem_clnt.c/#L2177
|
d2a_code_trace_data_43033
|
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/dh/dh_key.c:114: error: BUFFER_OVERRUN_L3
Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_priv_rand_range`.
Showing all 24 steps of the trace
crypto/dh/dh_key.c:76:1: Parameter `dh->priv_key->top`
74. }
75.
76. > static int generate_key(DH *dh)
77. {
78. int ok = 0;
crypto/dh/dh_key.c:114:22: Call
112. if (dh->q) {
113. do {
114. if (!BN_priv_rand_range(priv_key, dh->q))
^
115. goto err;
116. }
crypto/bn/bn_rand.c:182:1: Parameter `r->top`
180. }
181.
182. > int BN_priv_rand_range(BIGNUM *r, const BIGNUM *range)
183. {
184. return bnrand_range(PRIVATE, r, range);
crypto/bn/bn_rand.c:184:12: Call
182. int BN_priv_rand_range(BIGNUM *r, const BIGNUM *range)
183. {
184. return bnrand_range(PRIVATE, r, range);
^
185. }
186.
crypto/bn/bn_rand.c:113:1: Parameter `r->top`
111.
112. /* random number r: 0 <= r < range */
113. > static int bnrand_range(BNRAND_FLAG flag, BIGNUM *r, const BIGNUM *range)
114. {
115. int n;
crypto/bn/bn_rand.c:128:9: Call
126.
127. if (n == 1)
128. BN_zero(r);
^
129. else if (!BN_is_bit_set(range, n - 2) && !BN_is_bit_set(range, n - 3)) {
130. /*
crypto/bn/bn_lib.c:357:1: Parameter `a->top`
355. }
356.
357. > int BN_set_word(BIGNUM *a, BN_ULONG w)
358. {
359. bn_check_top(a);
crypto/bn/bn_lib.c:360:9: Call
358. {
359. bn_check_top(a);
360. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
^
361. return 0;
362. a->neg = 0;
crypto/bn/bn_lcl.h:651:1: Parameter `a->top`
649. const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx);
650.
651. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits)
652. {
653. if (bits > (INT_MAX - BN_BITS2 + 1))
crypto/bn/bn_lcl.h:659:12: Call
657. return a;
658.
659. return bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2);
^
660. }
661.
crypto/bn/bn_lib.c:246:1: Parameter `b->top`
244. */
245.
246. > BIGNUM *bn_expand2(BIGNUM *b, int words)
247. {
248. bn_check_top(b);
crypto/bn/bn_lib.c:251:23: Call
249.
250. if (words > b->dmax) {
251. BN_ULONG *a = bn_expand_internal(b, words);
^
252. if (!a)
253. return NULL;
crypto/bn/bn_lib.c:208:1: <Offset trace>
206. /* This is used by bn_expand2() */
207. /* The caller MUST check that words > b->dmax before calling this */
208. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
209. {
210. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:208:1: Parameter `b->top`
206. /* This is used by bn_expand2() */
207. /* The caller MUST check that words > b->dmax before calling this */
208. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
209. {
210. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:208:1: <Length trace>
206. /* This is used by bn_expand2() */
207. /* The caller MUST check that words > b->dmax before calling this */
208. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
209. {
210. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:208:1: Parameter `words`
206. /* This is used by bn_expand2() */
207. /* The caller MUST check that words > b->dmax before calling this */
208. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
209. {
210. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:225:13: Call
223. a = OPENSSL_secure_zalloc(words * sizeof(*a));
224. else
225. a = OPENSSL_zalloc(words * sizeof(*a));
^
226. if (a == NULL) {
227. 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:225:9: Assignment
223. a = OPENSSL_secure_zalloc(words * sizeof(*a));
224. else
225. a = OPENSSL_zalloc(words * sizeof(*a));
^
226. if (a == NULL) {
227. BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE);
crypto/bn/bn_lib.c:233:9: Array access: Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_priv_rand_range`
231. assert(b->top <= words);
232. if (b->top > 0)
233. memcpy(a, b->d, sizeof(*a) * b->top);
^
234.
235. return a;
|
https://github.com/openssl/openssl/blob/49cd47eaababc8c57871b929080fc1357e2ad7b8/crypto/bn/bn_lib.c/#L233
|
d2a_code_trace_data_43034
|
static av_always_inline int epzs_motion_search_internal(MpegEncContext * s, int *mx_ptr, int *my_ptr,
int P[10][2], int src_index, int ref_index, int16_t (*last_mv)[2],
int ref_mv_scale, int flags, int size, int h)
{
MotionEstContext * const c= &s->me;
int best[2]={0, 0};
int d;
int dmin;
int map_generation;
int penalty_factor;
const int ref_mv_stride= s->mb_stride;
const int ref_mv_xy= s->mb_x + s->mb_y*ref_mv_stride;
me_cmp_func cmpf, chroma_cmpf;
LOAD_COMMON
LOAD_COMMON2
if(c->pre_pass){
penalty_factor= c->pre_penalty_factor;
cmpf= s->dsp.me_pre_cmp[size];
chroma_cmpf= s->dsp.me_pre_cmp[size+1];
}else{
penalty_factor= c->penalty_factor;
cmpf= s->dsp.me_cmp[size];
chroma_cmpf= s->dsp.me_cmp[size+1];
}
map_generation= update_map_generation(c);
assert(cmpf);
dmin= cmp(s, 0, 0, 0, 0, size, h, ref_index, src_index, cmpf, chroma_cmpf, flags);
map[0]= map_generation;
score_map[0]= dmin;
if((s->pict_type == FF_B_TYPE && !(c->flags & FLAG_DIRECT)) || s->flags&CODEC_FLAG_MV0)
dmin += (mv_penalty[pred_x] + mv_penalty[pred_y])*penalty_factor;
if (s->first_slice_line) {
CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift)
CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
}else{
if(dmin<((h*h*s->avctx->mv0_threshold)>>8)
&& ( P_LEFT[0] |P_LEFT[1]
|P_TOP[0] |P_TOP[1]
|P_TOPRIGHT[0]|P_TOPRIGHT[1])==0){
*mx_ptr= 0;
*my_ptr= 0;
c->skip=1;
return dmin;
}
CHECK_MV( P_MEDIAN[0] >>shift , P_MEDIAN[1] >>shift)
CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift) , (P_MEDIAN[1]>>shift)-1)
CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift) , (P_MEDIAN[1]>>shift)+1)
CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift)-1, (P_MEDIAN[1]>>shift) )
CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift)+1, (P_MEDIAN[1]>>shift) )
CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
CHECK_MV(P_LEFT[0] >>shift, P_LEFT[1] >>shift)
CHECK_MV(P_TOP[0] >>shift, P_TOP[1] >>shift)
CHECK_MV(P_TOPRIGHT[0]>>shift, P_TOPRIGHT[1]>>shift)
}
if(dmin>h*h*4){
if(c->pre_pass){
CHECK_CLIPPED_MV((last_mv[ref_mv_xy-1][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy-1][1]*ref_mv_scale + (1<<15))>>16)
if(!s->first_slice_line)
CHECK_CLIPPED_MV((last_mv[ref_mv_xy-ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy-ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16)
}else{
CHECK_CLIPPED_MV((last_mv[ref_mv_xy+1][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy+1][1]*ref_mv_scale + (1<<15))>>16)
if(s->mb_y+1<s->end_mb_y)
CHECK_CLIPPED_MV((last_mv[ref_mv_xy+ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy+ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16)
}
}
if(c->avctx->last_predictor_count){
const int count= c->avctx->last_predictor_count;
const int xstart= FFMAX(0, s->mb_x - count);
const int ystart= FFMAX(0, s->mb_y - count);
const int xend= FFMIN(s->mb_width , s->mb_x + count + 1);
const int yend= FFMIN(s->mb_height, s->mb_y + count + 1);
int mb_y;
for(mb_y=ystart; mb_y<yend; mb_y++){
int mb_x;
for(mb_x=xstart; mb_x<xend; mb_x++){
const int xy= mb_x + 1 + (mb_y + 1)*ref_mv_stride;
int mx= (last_mv[xy][0]*ref_mv_scale + (1<<15))>>16;
int my= (last_mv[xy][1]*ref_mv_scale + (1<<15))>>16;
if(mx>xmax || mx<xmin || my>ymax || my<ymin) continue;
CHECK_MV(mx,my)
}
}
}
dmin= diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
*mx_ptr= best[0];
*my_ptr= best[1];
return dmin;
}
libavcodec/motion_est_template.c:1069: error: Uninitialized Value
The value read from ymin was never initialized.
libavcodec/motion_est_template.c:1069:13:
1067. if(dmin>h*h*4){
1068. if(c->pre_pass){
1069. CHECK_CLIPPED_MV((last_mv[ref_mv_xy-1][0]*ref_mv_scale + (1<<15))>>16,
^
1070. (last_mv[ref_mv_xy-1][1]*ref_mv_scale + (1<<15))>>16)
1071. if(!s->first_slice_line)
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1069
|
d2a_code_trace_data_43035
|
static SwsVector *sws_getConvVec(SwsVector *a, SwsVector *b){
int length= a->length + b->length - 1;
double *coeff= av_malloc(length*sizeof(double));
int i, j;
SwsVector *vec= av_malloc(sizeof(SwsVector));
vec->coeff= coeff;
vec->length= length;
for (i=0; i<length; i++) coeff[i]= 0.0;
for (i=0; i<a->length; i++)
{
for (j=0; j<b->length; j++)
{
coeff[i+j]+= a->coeff[i]*b->coeff[j];
}
}
return vec;
}
libswscale/swscale.c:2955: error: Null Dereference
pointer `vec` last assigned on line 2953 could be null and is dereferenced at line 2955, column 5.
libswscale/swscale.c:2949:1: start of procedure sws_getConvVec()
2947. }
2948.
2949. static SwsVector *sws_getConvVec(SwsVector *a, SwsVector *b){
^
2950. int length= a->length + b->length - 1;
2951. double *coeff= av_malloc(length*sizeof(double));
libswscale/swscale.c:2950:5:
2948.
2949. static SwsVector *sws_getConvVec(SwsVector *a, SwsVector *b){
2950. int length= a->length + b->length - 1;
^
2951. double *coeff= av_malloc(length*sizeof(double));
2952. int i, j;
libswscale/swscale.c:2951:5:
2949. static SwsVector *sws_getConvVec(SwsVector *a, SwsVector *b){
2950. int length= a->length + b->length - 1;
2951. double *coeff= av_malloc(length*sizeof(double));
^
2952. int i, j;
2953. SwsVector *vec= av_malloc(sizeof(SwsVector));
libavutil/mem.c:47:1: start of procedure av_malloc()
45. linker will do it automatically. */
46.
47. void *av_malloc(unsigned int size)
^
48. {
49. void *ptr = NULL;
libavutil/mem.c:49:5:
47. void *av_malloc(unsigned int size)
48. {
49. void *ptr = NULL;
^
50. #if CONFIG_MEMALIGN_HACK
51. long diff;
libavutil/mem.c:55:8: Taking false branch
53.
54. /* let's disallow possible ambiguous cases */
55. if(size > (INT_MAX-16) )
^
56. return NULL;
57.
libavutil/mem.c:66:9: Taking false branch
64. ((char*)ptr)[-1]= diff;
65. #elif HAVE_POSIX_MEMALIGN
66. if (posix_memalign(&ptr,16,size))
^
67. ptr = NULL;
68. #elif HAVE_MEMALIGN
libavutil/mem.c:99:5:
97. ptr = malloc(size);
98. #endif
99. return ptr;
^
100. }
101.
libavutil/mem.c:100:1: return from a call to av_malloc
98. #endif
99. return ptr;
100. }
^
101.
102. void *av_realloc(void *ptr, unsigned int size)
libswscale/swscale.c:2953:5:
2951. double *coeff= av_malloc(length*sizeof(double));
2952. int i, j;
2953. SwsVector *vec= av_malloc(sizeof(SwsVector));
^
2954.
2955. vec->coeff= coeff;
libavutil/mem.c:47:1: start of procedure av_malloc()
45. linker will do it automatically. */
46.
47. void *av_malloc(unsigned int size)
^
48. {
49. void *ptr = NULL;
libavutil/mem.c:49:5:
47. void *av_malloc(unsigned int size)
48. {
49. void *ptr = NULL;
^
50. #if CONFIG_MEMALIGN_HACK
51. long diff;
libavutil/mem.c:55:8: Taking false branch
53.
54. /* let's disallow possible ambiguous cases */
55. if(size > (INT_MAX-16) )
^
56. return NULL;
57.
libavutil/mem.c:66:9: Taking true branch
64. ((char*)ptr)[-1]= diff;
65. #elif HAVE_POSIX_MEMALIGN
66. if (posix_memalign(&ptr,16,size))
^
67. ptr = NULL;
68. #elif HAVE_MEMALIGN
libavutil/mem.c:67:9:
65. #elif HAVE_POSIX_MEMALIGN
66. if (posix_memalign(&ptr,16,size))
67. ptr = NULL;
^
68. #elif HAVE_MEMALIGN
69. ptr = memalign(16,size);
libavutil/mem.c:99:5:
97. ptr = malloc(size);
98. #endif
99. return ptr;
^
100. }
101.
libavutil/mem.c:100:1: return from a call to av_malloc
98. #endif
99. return ptr;
100. }
^
101.
102. void *av_realloc(void *ptr, unsigned int size)
libswscale/swscale.c:2955:5:
2953. SwsVector *vec= av_malloc(sizeof(SwsVector));
2954.
2955. vec->coeff= coeff;
^
2956. vec->length= length;
2957.
|
https://github.com/libav/libav/blob/184bc53db4fded8857af09cee2adc7197940deb7/libswscale/swscale.c/#L2955
|
d2a_code_trace_data_43036
|
SSL *SSL_new(SSL_CTX *ctx)
{
SSL *s;
if (ctx == NULL) {
SSLerr(SSL_F_SSL_NEW, SSL_R_NULL_SSL_CTX);
return NULL;
}
if (ctx->method == NULL) {
SSLerr(SSL_F_SSL_NEW, SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION);
return NULL;
}
s = OPENSSL_zalloc(sizeof(*s));
if (s == NULL)
goto err;
s->references = 1;
s->lock = CRYPTO_THREAD_lock_new();
if (s->lock == NULL) {
OPENSSL_free(s);
s = NULL;
goto err;
}
RECORD_LAYER_init(&s->rlayer, s);
s->options = ctx->options;
s->dane.flags = ctx->dane.flags;
s->min_proto_version = ctx->min_proto_version;
s->max_proto_version = ctx->max_proto_version;
s->mode = ctx->mode;
s->max_cert_list = ctx->max_cert_list;
s->max_early_data = ctx->max_early_data;
s->num_tickets = ctx->num_tickets;
s->tls13_ciphersuites = sk_SSL_CIPHER_dup(ctx->tls13_ciphersuites);
if (s->tls13_ciphersuites == NULL)
goto err;
s->cert = ssl_cert_dup(ctx->cert);
if (s->cert == NULL)
goto err;
RECORD_LAYER_set_read_ahead(&s->rlayer, ctx->read_ahead);
s->msg_callback = ctx->msg_callback;
s->msg_callback_arg = ctx->msg_callback_arg;
s->verify_mode = ctx->verify_mode;
s->not_resumable_session_cb = ctx->not_resumable_session_cb;
s->record_padding_cb = ctx->record_padding_cb;
s->record_padding_arg = ctx->record_padding_arg;
s->block_padding = ctx->block_padding;
s->sid_ctx_length = ctx->sid_ctx_length;
if (!ossl_assert(s->sid_ctx_length <= sizeof(s->sid_ctx)))
goto err;
memcpy(&s->sid_ctx, &ctx->sid_ctx, sizeof(s->sid_ctx));
s->verify_callback = ctx->default_verify_callback;
s->generate_session_id = ctx->generate_session_id;
s->param = X509_VERIFY_PARAM_new();
if (s->param == NULL)
goto err;
X509_VERIFY_PARAM_inherit(s->param, ctx->param);
s->quiet_shutdown = ctx->quiet_shutdown;
s->ext.max_fragment_len_mode = ctx->ext.max_fragment_len_mode;
s->max_send_fragment = ctx->max_send_fragment;
s->split_send_fragment = ctx->split_send_fragment;
s->max_pipelines = ctx->max_pipelines;
if (s->max_pipelines > 1)
RECORD_LAYER_set_read_ahead(&s->rlayer, 1);
if (ctx->default_read_buf_len > 0)
SSL_set_default_read_buffer_len(s, ctx->default_read_buf_len);
SSL_CTX_up_ref(ctx);
s->ctx = ctx;
s->ext.debug_cb = 0;
s->ext.debug_arg = NULL;
s->ext.ticket_expected = 0;
s->ext.status_type = ctx->ext.status_type;
s->ext.status_expected = 0;
s->ext.ocsp.ids = NULL;
s->ext.ocsp.exts = NULL;
s->ext.ocsp.resp = NULL;
s->ext.ocsp.resp_len = 0;
SSL_CTX_up_ref(ctx);
s->session_ctx = ctx;
#ifndef OPENSSL_NO_EC
if (ctx->ext.ecpointformats) {
s->ext.ecpointformats =
OPENSSL_memdup(ctx->ext.ecpointformats,
ctx->ext.ecpointformats_len);
if (!s->ext.ecpointformats)
goto err;
s->ext.ecpointformats_len =
ctx->ext.ecpointformats_len;
}
if (ctx->ext.supportedgroups) {
s->ext.supportedgroups =
OPENSSL_memdup(ctx->ext.supportedgroups,
ctx->ext.supportedgroups_len
* sizeof(*ctx->ext.supportedgroups));
if (!s->ext.supportedgroups)
goto err;
s->ext.supportedgroups_len = ctx->ext.supportedgroups_len;
}
#endif
#ifndef OPENSSL_NO_NEXTPROTONEG
s->ext.npn = NULL;
#endif
if (s->ctx->ext.alpn) {
s->ext.alpn = OPENSSL_malloc(s->ctx->ext.alpn_len);
if (s->ext.alpn == NULL)
goto err;
memcpy(s->ext.alpn, s->ctx->ext.alpn, s->ctx->ext.alpn_len);
s->ext.alpn_len = s->ctx->ext.alpn_len;
}
s->verified_chain = NULL;
s->verify_result = X509_V_OK;
s->default_passwd_callback = ctx->default_passwd_callback;
s->default_passwd_callback_userdata = ctx->default_passwd_callback_userdata;
s->method = ctx->method;
s->key_update = SSL_KEY_UPDATE_NONE;
if (!s->method->ssl_new(s))
goto err;
s->server = (ctx->method->ssl_accept == ssl_undefined_function) ? 0 : 1;
if (!SSL_clear(s))
goto err;
if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_SSL, s, &s->ex_data))
goto err;
#ifndef OPENSSL_NO_PSK
s->psk_client_callback = ctx->psk_client_callback;
s->psk_server_callback = ctx->psk_server_callback;
#endif
s->psk_find_session_cb = ctx->psk_find_session_cb;
s->psk_use_session_cb = ctx->psk_use_session_cb;
s->job = NULL;
#ifndef OPENSSL_NO_CT
if (!SSL_set_ct_validation_callback(s, ctx->ct_validation_callback,
ctx->ct_validation_callback_arg))
goto err;
#endif
return s;
err:
SSL_free(s);
SSLerr(SSL_F_SSL_NEW, ERR_R_MALLOC_FAILURE);
return NULL;
}
ssl/ssl_lib.c:694: error: MEMORY_LEAK
memory dynamically allocated by call to `CRYPTO_THREAD_lock_new()` at line 687, column 15 is not reachable after line 694, column 5.
Showing all 48 steps of the trace
ssl/ssl_lib.c:669:1: start of procedure SSL_new()
667. }
668.
669. > SSL *SSL_new(SSL_CTX *ctx)
670. {
671. SSL *s;
ssl/ssl_lib.c:673:9: Taking false branch
671. SSL *s;
672.
673. if (ctx == NULL) {
^
674. SSLerr(SSL_F_SSL_NEW, SSL_R_NULL_SSL_CTX);
675. return NULL;
ssl/ssl_lib.c:677:9: Taking false branch
675. return NULL;
676. }
677. if (ctx->method == NULL) {
^
678. SSLerr(SSL_F_SSL_NEW, SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION);
679. return NULL;
ssl/ssl_lib.c:682:5:
680. }
681.
682. > s = OPENSSL_zalloc(sizeof(*s));
683. if (s == NULL)
684. goto err;
crypto/mem.c:228:1: start of procedure CRYPTO_zalloc()
226. }
227.
228. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
229. {
230. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:230:5:
228. void *CRYPTO_zalloc(size_t num, const char *file, int line)
229. {
230. > void *ret = CRYPTO_malloc(num, file, line);
231.
232. FAILTEST();
crypto/mem.c:192:1: start of procedure CRYPTO_malloc()
190. #endif
191.
192. > void *CRYPTO_malloc(size_t num, const char *file, int line)
193. {
194. void *ret = NULL;
crypto/mem.c:194:5:
192. void *CRYPTO_malloc(size_t num, const char *file, int line)
193. {
194. > void *ret = NULL;
195.
196. INCREMENT(malloc_count);
crypto/mem.c:197:9: Taking false branch
195.
196. INCREMENT(malloc_count);
197. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
^
198. return malloc_impl(num, file, line);
199.
crypto/mem.c:200:9: Taking false branch
198. return malloc_impl(num, file, line);
199.
200. if (num == 0)
^
201. return NULL;
202.
crypto/mem.c:204:9: Taking true branch
202.
203. FAILTEST();
204. if (allow_customize) {
^
205. /*
206. * Disallow customization after the first allocation. We only set this
crypto/mem.c:210:9:
208. * allocation.
209. */
210. > allow_customize = 0;
211. }
212. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
crypto/mem.c:221:5:
219. }
220. #else
221. > (void)(file); (void)(line);
222. ret = malloc(num);
223. #endif
crypto/mem.c:221:19:
219. }
220. #else
221. > (void)(file); (void)(line);
222. ret = malloc(num);
223. #endif
crypto/mem.c:222:5:
220. #else
221. (void)(file); (void)(line);
222. > ret = malloc(num);
223. #endif
224.
crypto/mem.c:225:5:
223. #endif
224.
225. > return ret;
226. }
227.
crypto/mem.c:226:1: return from a call to CRYPTO_malloc
224.
225. return ret;
226. > }
227.
228. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:233:9: Taking true branch
231.
232. FAILTEST();
233. if (ret != NULL)
^
234. memset(ret, 0, num);
235. return ret;
crypto/mem.c:234:9:
232. FAILTEST();
233. if (ret != NULL)
234. > memset(ret, 0, num);
235. return ret;
236. }
crypto/mem.c:235:5:
233. if (ret != NULL)
234. memset(ret, 0, num);
235. > return ret;
236. }
237.
crypto/mem.c:236:1: return from a call to CRYPTO_zalloc
234. memset(ret, 0, num);
235. return ret;
236. > }
237.
238. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
ssl/ssl_lib.c:683:9: Taking false branch
681.
682. s = OPENSSL_zalloc(sizeof(*s));
683. if (s == NULL)
^
684. goto err;
685.
ssl/ssl_lib.c:686:5:
684. goto err;
685.
686. > s->references = 1;
687. s->lock = CRYPTO_THREAD_lock_new();
688. if (s->lock == NULL) {
ssl/ssl_lib.c:687:5:
685.
686. s->references = 1;
687. > s->lock = CRYPTO_THREAD_lock_new();
688. if (s->lock == NULL) {
689. OPENSSL_free(s);
crypto/threads_pthread.c:19:1: start of procedure CRYPTO_THREAD_lock_new()
17. # endif
18.
19. > CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void)
20. {
21. # ifdef USE_RWLOCK
crypto/threads_pthread.c:24:9:
22. CRYPTO_RWLOCK *lock;
23.
24. > if ((lock = OPENSSL_zalloc(sizeof(pthread_rwlock_t))) == NULL) {
25. /* Don't set error, to avoid recursion blowup. */
26. return NULL;
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 false branch
202.
203. FAILTEST();
204. if (allow_customize) {
^
205. /*
206. * Disallow customization after the first allocation. We only set this
crypto/mem.c:221:5:
219. }
220. #else
221. > (void)(file); (void)(line);
222. ret = malloc(num);
223. #endif
crypto/mem.c:221:19:
219. }
220. #else
221. > (void)(file); (void)(line);
222. ret = malloc(num);
223. #endif
crypto/mem.c:222:5:
220. #else
221. (void)(file); (void)(line);
222. > ret = malloc(num);
223. #endif
224.
crypto/mem.c:225:5:
223. #endif
224.
225. > return ret;
226. }
227.
crypto/mem.c:226:1: return from a call to CRYPTO_malloc
224.
225. return ret;
226. > }
227.
228. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:233:9: Taking true branch
231.
232. FAILTEST();
233. if (ret != NULL)
^
234. memset(ret, 0, num);
235. return ret;
crypto/mem.c:234:9:
232. FAILTEST();
233. if (ret != NULL)
234. > memset(ret, 0, num);
235. return ret;
236. }
crypto/mem.c:235:5:
233. if (ret != NULL)
234. memset(ret, 0, num);
235. > return ret;
236. }
237.
crypto/mem.c:236:1: return from a call to CRYPTO_zalloc
234. memset(ret, 0, num);
235. return ret;
236. > }
237.
238. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/threads_pthread.c:24:9: Taking false branch
22. CRYPTO_RWLOCK *lock;
23.
24. if ((lock = OPENSSL_zalloc(sizeof(pthread_rwlock_t))) == NULL) {
^
25. /* Don't set error, to avoid recursion blowup. */
26. return NULL;
crypto/threads_pthread.c:29:9: Taking false branch
27. }
28.
29. if (pthread_rwlock_init(lock, NULL) != 0) {
^
30. OPENSSL_free(lock);
31. return NULL;
crypto/threads_pthread.c:54:5:
52. # endif
53.
54. > return lock;
55. }
56.
crypto/threads_pthread.c:55:1: return from a call to CRYPTO_THREAD_lock_new
53.
54. return lock;
55. > }
56.
57. int CRYPTO_THREAD_read_lock(CRYPTO_RWLOCK *lock)
ssl/ssl_lib.c:688:9: Taking false branch
686. s->references = 1;
687. s->lock = CRYPTO_THREAD_lock_new();
688. if (s->lock == NULL) {
^
689. OPENSSL_free(s);
690. s = NULL;
ssl/ssl_lib.c:694:5: Skipping RECORD_LAYER_init(): empty list of specs
692. }
693.
694. RECORD_LAYER_init(&s->rlayer, s);
^
695.
696. s->options = ctx->options;
|
https://github.com/openssl/openssl/blob/c22365b399f62af4a81e9202500cd2cbd9c23a9d/ssl/ssl_lib.c/#L694
|
d2a_code_trace_data_43037
|
static ossl_inline unsigned int constant_time_is_zero(unsigned int a)
{
return constant_time_msb(~a & (a - 1));
}
crypto/rsa/rsa_ssl.c:96: error: INTEGER_OVERFLOW_L2
([0, +oo] - 1):unsigned32 by call to `constant_time_is_zero`.
Showing all 6 steps of the trace
crypto/rsa/rsa_ssl.c:61:1: Parameter `*from`
59. * preserves error code reporting for backward compatibility.
60. */
61. > int RSA_padding_check_SSLv23(unsigned char *to, int tlen,
62. const unsigned char *from, int flen, int num)
63. {
crypto/rsa/rsa_ssl.c:93:9: Assignment
91. flen -= 1 & mask;
92. from -= 1 & mask;
93. *--em = *from & mask;
^
94. }
95.
crypto/rsa/rsa_ssl.c:96:12: Call
94. }
95.
96. good = constant_time_is_zero(em[0]);
^
97. good &= constant_time_eq(em[1], 2);
98. err = constant_time_select_int(good, 0, RSA_R_BLOCK_TYPE_IS_NOT_02);
include/internal/constant_time_locl.h:164:1: <LHS trace>
162. }
163.
164. > static ossl_inline unsigned int constant_time_is_zero(unsigned int a)
165. {
166. return constant_time_msb(~a & (a - 1));
include/internal/constant_time_locl.h:164:1: Parameter `a`
162. }
163.
164. > static ossl_inline unsigned int constant_time_is_zero(unsigned int a)
165. {
166. return constant_time_msb(~a & (a - 1));
include/internal/constant_time_locl.h:166:12: Binary operation: ([0, +oo] - 1):unsigned32 by call to `constant_time_is_zero`
164. static ossl_inline unsigned int constant_time_is_zero(unsigned int a)
165. {
166. return constant_time_msb(~a & (a - 1));
^
167. }
168.
|
https://github.com/openssl/openssl/blob/4c2883a9bf59c5ee31e8e2e101b3894a16c06950/include/internal/constant_time_locl.h/#L166
|
d2a_code_trace_data_43038
|
static int check_cert(X509_STORE_CTX *ctx)
{
X509_CRL *crl = NULL, *dcrl = NULL;
X509 *x;
int ok, cnum;
unsigned int last_reasons;
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:880: error: NULL_DEREFERENCE
pointer `x` last assigned on line 868 could be null and is dereferenced by call to `get_crl_delta()` at line 880, column 9.
Showing all 26 steps of the trace
crypto/x509/x509_vfy.c:861:1: start of procedure check_cert()
859. }
860.
861. > static int check_cert(X509_STORE_CTX *ctx)
862. {
863. X509_CRL *crl = NULL, *dcrl = NULL;
crypto/x509/x509_vfy.c:863:2:
861. static int check_cert(X509_STORE_CTX *ctx)
862. {
863. > X509_CRL *crl = NULL, *dcrl = NULL;
864. X509 *x;
865. int ok, cnum;
crypto/x509/x509_vfy.c:867:2:
865. int ok, cnum;
866. unsigned int last_reasons;
867. > cnum = ctx->error_depth;
868. x = sk_X509_value(ctx->chain, cnum);
869. ctx->current_cert = x;
crypto/x509/x509_vfy.c:868:6: Condition is true
866. unsigned int last_reasons;
867. cnum = ctx->error_depth;
868. x = sk_X509_value(ctx->chain, cnum);
^
869. ctx->current_cert = x;
870. ctx->current_issuer = NULL;
crypto/x509/x509_vfy.c:868:2:
866. unsigned int last_reasons;
867. cnum = ctx->error_depth;
868. > x = sk_X509_value(ctx->chain, cnum);
869. ctx->current_cert = x;
870. ctx->current_issuer = NULL;
crypto/stack/stack.c:337:1: start of procedure sk_value()
335. }
336.
337. > void *sk_value(const _STACK *st, int i)
338. {
339. if(!st || (i < 0) || (i >= st->num)) return NULL;
crypto/stack/stack.c:339:6: Taking false branch
337. void *sk_value(const _STACK *st, int i)
338. {
339. if(!st || (i < 0) || (i >= st->num)) return NULL;
^
340. return st->data[i];
341. }
crypto/stack/stack.c:339:13: Taking false branch
337. void *sk_value(const _STACK *st, int i)
338. {
339. if(!st || (i < 0) || (i >= st->num)) return NULL;
^
340. return st->data[i];
341. }
crypto/stack/stack.c:339:24: Taking true branch
337. void *sk_value(const _STACK *st, int i)
338. {
339. if(!st || (i < 0) || (i >= st->num)) return NULL;
^
340. return st->data[i];
341. }
crypto/stack/stack.c:339:39:
337. void *sk_value(const _STACK *st, int i)
338. {
339. > if(!st || (i < 0) || (i >= st->num)) return NULL;
340. return st->data[i];
341. }
crypto/stack/stack.c:341:1: return from a call to sk_value
339. if(!st || (i < 0) || (i >= st->num)) return NULL;
340. return st->data[i];
341. > }
342.
343. void *sk_set(_STACK *st, int i, void *value)
crypto/x509/x509_vfy.c:869:2:
867. cnum = ctx->error_depth;
868. x = sk_X509_value(ctx->chain, cnum);
869. > ctx->current_cert = x;
870. ctx->current_issuer = NULL;
871. ctx->current_crl_score = 0;
crypto/x509/x509_vfy.c:870:2:
868. x = sk_X509_value(ctx->chain, cnum);
869. ctx->current_cert = x;
870. > ctx->current_issuer = NULL;
871. ctx->current_crl_score = 0;
872. ctx->current_reasons = 0;
crypto/x509/x509_vfy.c:871:2:
869. ctx->current_cert = x;
870. ctx->current_issuer = NULL;
871. > ctx->current_crl_score = 0;
872. ctx->current_reasons = 0;
873. while (ctx->current_reasons != CRLDP_ALL_REASONS)
crypto/x509/x509_vfy.c:872:2:
870. ctx->current_issuer = NULL;
871. ctx->current_crl_score = 0;
872. > ctx->current_reasons = 0;
873. while (ctx->current_reasons != CRLDP_ALL_REASONS)
874. {
crypto/x509/x509_vfy.c:873:9: Loop condition is true. Entering loop body
871. ctx->current_crl_score = 0;
872. ctx->current_reasons = 0;
873. while (ctx->current_reasons != CRLDP_ALL_REASONS)
^
874. {
875. last_reasons = ctx->current_reasons;
crypto/x509/x509_vfy.c:875:3:
873. while (ctx->current_reasons != CRLDP_ALL_REASONS)
874. {
875. > last_reasons = ctx->current_reasons;
876. /* Try to retrieve relevant CRL */
877. if (ctx->get_crl)
crypto/x509/x509_vfy.c:877:7: Taking false branch
875. last_reasons = ctx->current_reasons;
876. /* Try to retrieve relevant CRL */
877. if (ctx->get_crl)
^
878. ok = ctx->get_crl(ctx, &crl, x);
879. else
crypto/x509/x509_vfy.c:880:4:
878. ok = ctx->get_crl(ctx, &crl, x);
879. else
880. > ok = get_crl_delta(ctx, &crl, &dcrl, x);
881. /* If error looking up CRL, nothing we can do except
882. * notify callback
crypto/x509/x509_vfy.c:1472:1: start of procedure get_crl_delta()
1470. */
1471.
1472. > static int get_crl_delta(X509_STORE_CTX *ctx,
1473. X509_CRL **pcrl, X509_CRL **pdcrl, X509 *x)
1474. {
crypto/x509/x509_vfy.c:1476:2:
1474. {
1475. int ok;
1476. > X509 *issuer = NULL;
1477. int crl_score = 0;
1478. unsigned int reasons;
crypto/x509/x509_vfy.c:1477:2:
1475. int ok;
1476. X509 *issuer = NULL;
1477. > int crl_score = 0;
1478. unsigned int reasons;
1479. X509_CRL *crl = NULL, *dcrl = NULL;
crypto/x509/x509_vfy.c:1479:2:
1477. int crl_score = 0;
1478. unsigned int reasons;
1479. > X509_CRL *crl = NULL, *dcrl = NULL;
1480. STACK_OF(X509_CRL) *skcrl;
1481. X509_NAME *nm = X509_get_issuer_name(x);
crypto/x509/x509_vfy.c:1481:2:
1479. X509_CRL *crl = NULL, *dcrl = NULL;
1480. STACK_OF(X509_CRL) *skcrl;
1481. > X509_NAME *nm = X509_get_issuer_name(x);
1482. reasons = ctx->current_reasons;
1483. ok = get_crl_sk(ctx, &crl, &dcrl,
crypto/x509/x509_cmp.c:130:1: start of procedure X509_get_issuer_name()
128. #endif
129.
130. > X509_NAME *X509_get_issuer_name(X509 *a)
131. {
132. return(a->cert_info->issuer);
crypto/x509/x509_cmp.c:132:2:
130. X509_NAME *X509_get_issuer_name(X509 *a)
131. {
132. > return(a->cert_info->issuer);
133. }
134.
|
https://github.com/openssl/openssl/blob/750487899ad2b794078ed998b513a4a14f60f2cc/crypto/x509/x509_vfy.c/#L880
|
d2a_code_trace_data_43039
|
static void 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);
av_exit(1);
}
*p++ = '\0';
idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1);
streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX);
}
ffmpeg.c:3651: error: Null Dereference
pointer `p` last assigned on line 3651 could be null and is dereferenced at line 3651, column 5.
ffmpeg.c:3636:1: start of procedure opt_streamid()
3634.
3635. /* arg format is "output-stream-index:streamid-value". */
3636. static void opt_streamid(const char *opt, const char *arg)
^
3637. {
3638. int idx;
ffmpeg.c:3642:5:
3640. char idx_str[16];
3641.
3642. strncpy(idx_str, arg, sizeof(idx_str));
^
3643. idx_str[sizeof(idx_str)-1] = '\0';
3644. p = strchr(idx_str, ':');
ffmpeg.c:3643:5:
3641.
3642. strncpy(idx_str, arg, sizeof(idx_str));
3643. idx_str[sizeof(idx_str)-1] = '\0';
^
3644. p = strchr(idx_str, ':');
3645. if (!p) {
ffmpeg.c:3644:5:
3642. strncpy(idx_str, arg, sizeof(idx_str));
3643. idx_str[sizeof(idx_str)-1] = '\0';
3644. p = strchr(idx_str, ':');
^
3645. if (!p) {
3646. fprintf(stderr,
ffmpeg.c:3645:10: Taking true branch
3643. idx_str[sizeof(idx_str)-1] = '\0';
3644. p = strchr(idx_str, ':');
3645. if (!p) {
^
3646. fprintf(stderr,
3647. "Invalid value '%s' for option '%s', required syntax is 'index:value'\n",
ffmpeg.c:3646:9:
3644. p = strchr(idx_str, ':');
3645. if (!p) {
3646. fprintf(stderr,
^
3647. "Invalid value '%s' for option '%s', required syntax is 'index:value'\n",
3648. arg, opt);
ffmpeg.c:3649:9: Skipping av_exit(): empty list of specs
3647. "Invalid value '%s' for option '%s', required syntax is 'index:value'\n",
3648. arg, opt);
3649. av_exit(1);
^
3650. }
3651. *p++ = '\0';
ffmpeg.c:3651:5:
3649. av_exit(1);
3650. }
3651. *p++ = '\0';
^
3652. idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1);
3653. streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX);
|
https://github.com/libav/libav/blob/66b84e4ab2fc96222dab32173d84f4a403129deb/ffmpeg.c/#L3651
|
d2a_code_trace_data_43040
|
static int internal_verify(X509_STORE_CTX *ctx)
{
int ok=0,n;
X509 *xs,*xi;
EVP_PKEY *pkey=NULL;
int (*cb)(int xok,X509_STORE_CTX *xctx);
cb=ctx->verify_cb;
n=sk_X509_num(ctx->chain);
ctx->error_depth=n-1;
n--;
xi=sk_X509_value(ctx->chain,n);
if (ctx->check_issued(ctx, xi, xi))
xs=xi;
else
{
if (ctx->param->flags & X509_V_FLAG_PARTIAL_CHAIN)
{
xs = xi;
goto check_cert;
}
if (n <= 0)
{
ctx->error=X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE;
ctx->current_cert=xi;
ok=cb(0,ctx);
goto end;
}
else
{
n--;
ctx->error_depth=n;
xs=sk_X509_value(ctx->chain,n);
}
}
while (n >= 0)
{
ctx->error_depth=n;
if (!xs->valid && (xs != xi || (ctx->param->flags & X509_V_FLAG_CHECK_SS_SIGNATURE)))
{
if ((pkey=X509_get_pubkey(xi)) == NULL)
{
ctx->error=X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY;
ctx->current_cert=xi;
ok=(*cb)(0,ctx);
if (!ok) goto end;
}
else if (X509_verify(xs,pkey) <= 0)
{
ctx->error=X509_V_ERR_CERT_SIGNATURE_FAILURE;
ctx->current_cert=xs;
ok=(*cb)(0,ctx);
if (!ok)
{
EVP_PKEY_free(pkey);
goto end;
}
}
EVP_PKEY_free(pkey);
pkey=NULL;
}
xs->valid = 1;
check_cert:
ok = x509_check_cert_time(ctx, xs, 0);
if (!ok)
goto end;
ctx->current_issuer=xi;
ctx->current_cert=xs;
ok=(*cb)(1,ctx);
if (!ok) goto end;
n--;
if (n >= 0)
{
xi=xs;
xs=sk_X509_value(ctx->chain,n);
}
}
ok=1;
end:
return ok;
}
crypto/x509/x509_vfy.c:1819: error: NULL_DEREFERENCE
pointer `xs` last assigned on line 1806 could be null and is dereferenced at line 1819, column 8.
Showing all 36 steps of the trace
crypto/x509/x509_vfy.c:1772:1: start of procedure internal_verify()
1770. }
1771.
1772. > static int internal_verify(X509_STORE_CTX *ctx)
1773. {
1774. int ok=0,n;
crypto/x509/x509_vfy.c:1774:2:
1772. static int internal_verify(X509_STORE_CTX *ctx)
1773. {
1774. > int ok=0,n;
1775. X509 *xs,*xi;
1776. EVP_PKEY *pkey=NULL;
crypto/x509/x509_vfy.c:1776:2:
1774. int ok=0,n;
1775. X509 *xs,*xi;
1776. > EVP_PKEY *pkey=NULL;
1777. int (*cb)(int xok,X509_STORE_CTX *xctx);
1778.
crypto/x509/x509_vfy.c:1779:2:
1777. int (*cb)(int xok,X509_STORE_CTX *xctx);
1778.
1779. > cb=ctx->verify_cb;
1780.
1781. n=sk_X509_num(ctx->chain);
crypto/x509/x509_vfy.c:1781:4: Condition is true
1779. cb=ctx->verify_cb;
1780.
1781. n=sk_X509_num(ctx->chain);
^
1782. ctx->error_depth=n-1;
1783. n--;
crypto/x509/x509_vfy.c:1781:2:
1779. cb=ctx->verify_cb;
1780.
1781. > n=sk_X509_num(ctx->chain);
1782. ctx->error_depth=n-1;
1783. n--;
crypto/stack/stack.c:331:1: start of procedure sk_num()
329. }
330.
331. > int sk_num(const _STACK *st)
332. {
333. if(st == NULL) return -1;
crypto/stack/stack.c:333:5: Taking false branch
331. int sk_num(const _STACK *st)
332. {
333. if(st == NULL) return -1;
^
334. return st->num;
335. }
crypto/stack/stack.c:334:2:
332. {
333. if(st == NULL) return -1;
334. > return st->num;
335. }
336.
crypto/stack/stack.c:335:1: return from a call to sk_num
333. if(st == NULL) return -1;
334. return st->num;
335. > }
336.
337. void *sk_value(const _STACK *st, int i)
crypto/x509/x509_vfy.c:1782:2:
1780.
1781. n=sk_X509_num(ctx->chain);
1782. > ctx->error_depth=n-1;
1783. n--;
1784. xi=sk_X509_value(ctx->chain,n);
crypto/x509/x509_vfy.c:1783:2:
1781. n=sk_X509_num(ctx->chain);
1782. ctx->error_depth=n-1;
1783. > n--;
1784. xi=sk_X509_value(ctx->chain,n);
1785.
crypto/x509/x509_vfy.c:1784:5: Condition is true
1782. ctx->error_depth=n-1;
1783. n--;
1784. xi=sk_X509_value(ctx->chain,n);
^
1785.
1786. if (ctx->check_issued(ctx, xi, xi))
crypto/x509/x509_vfy.c:1784:2:
1782. ctx->error_depth=n-1;
1783. n--;
1784. > xi=sk_X509_value(ctx->chain,n);
1785.
1786. if (ctx->check_issued(ctx, xi, xi))
crypto/stack/stack.c:337:1: start of procedure sk_value()
335. }
336.
337. > void *sk_value(const _STACK *st, int i)
338. {
339. if(!st || (i < 0) || (i >= st->num)) return NULL;
crypto/stack/stack.c:339:6: Taking false branch
337. void *sk_value(const _STACK *st, int i)
338. {
339. if(!st || (i < 0) || (i >= st->num)) return NULL;
^
340. return st->data[i];
341. }
crypto/stack/stack.c:339:13: Taking false branch
337. void *sk_value(const _STACK *st, int i)
338. {
339. if(!st || (i < 0) || (i >= st->num)) return NULL;
^
340. return st->data[i];
341. }
crypto/stack/stack.c:339:24: Taking false branch
337. void *sk_value(const _STACK *st, int i)
338. {
339. if(!st || (i < 0) || (i >= st->num)) return NULL;
^
340. return st->data[i];
341. }
crypto/stack/stack.c:340:2:
338. {
339. if(!st || (i < 0) || (i >= st->num)) return NULL;
340. > return st->data[i];
341. }
342.
crypto/stack/stack.c:341:1: return from a call to sk_value
339. if(!st || (i < 0) || (i >= st->num)) return NULL;
340. return st->data[i];
341. > }
342.
343. void *sk_set(_STACK *st, int i, void *value)
crypto/x509/x509_vfy.c:1786:6: Taking false branch
1784. xi=sk_X509_value(ctx->chain,n);
1785.
1786. if (ctx->check_issued(ctx, xi, xi))
^
1787. xs=xi;
1788. else
crypto/x509/x509_vfy.c:1790:7: Taking false branch
1788. else
1789. {
1790. if (ctx->param->flags & X509_V_FLAG_PARTIAL_CHAIN)
^
1791. {
1792. xs = xi;
crypto/x509/x509_vfy.c:1795:7: Taking false branch
1793. goto check_cert;
1794. }
1795. if (n <= 0)
^
1796. {
1797. ctx->error=X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE;
crypto/x509/x509_vfy.c:1804:4:
1802. else
1803. {
1804. > n--;
1805. ctx->error_depth=n;
1806. xs=sk_X509_value(ctx->chain,n);
crypto/x509/x509_vfy.c:1805:4:
1803. {
1804. n--;
1805. > ctx->error_depth=n;
1806. xs=sk_X509_value(ctx->chain,n);
1807. }
crypto/x509/x509_vfy.c:1806:7: Condition is true
1804. n--;
1805. ctx->error_depth=n;
1806. xs=sk_X509_value(ctx->chain,n);
^
1807. }
1808. }
crypto/x509/x509_vfy.c:1806:4:
1804. n--;
1805. ctx->error_depth=n;
1806. > xs=sk_X509_value(ctx->chain,n);
1807. }
1808. }
crypto/stack/stack.c:337:1: start of procedure sk_value()
335. }
336.
337. > void *sk_value(const _STACK *st, int i)
338. {
339. if(!st || (i < 0) || (i >= st->num)) return NULL;
crypto/stack/stack.c:339:6: Taking false branch
337. void *sk_value(const _STACK *st, int i)
338. {
339. if(!st || (i < 0) || (i >= st->num)) return NULL;
^
340. return st->data[i];
341. }
crypto/stack/stack.c:339:13: Taking false branch
337. void *sk_value(const _STACK *st, int i)
338. {
339. if(!st || (i < 0) || (i >= st->num)) return NULL;
^
340. return st->data[i];
341. }
crypto/stack/stack.c:339:24: Taking true branch
337. void *sk_value(const _STACK *st, int i)
338. {
339. if(!st || (i < 0) || (i >= st->num)) return NULL;
^
340. return st->data[i];
341. }
crypto/stack/stack.c:339:39:
337. void *sk_value(const _STACK *st, int i)
338. {
339. > if(!st || (i < 0) || (i >= st->num)) return NULL;
340. return st->data[i];
341. }
crypto/stack/stack.c:341:1: return from a call to sk_value
339. if(!st || (i < 0) || (i >= st->num)) return NULL;
340. return st->data[i];
341. > }
342.
343. void *sk_set(_STACK *st, int i, void *value)
crypto/x509/x509_vfy.c:1811:9: Loop condition is true. Entering loop body
1809.
1810. /* ctx->error=0; not needed */
1811. while (n >= 0)
^
1812. {
1813. ctx->error_depth=n;
crypto/x509/x509_vfy.c:1813:3:
1811. while (n >= 0)
1812. {
1813. > ctx->error_depth=n;
1814.
1815. /* Skip signature check for self signed certificates unless
crypto/x509/x509_vfy.c:1819:8: Taking false branch
1817. * just wastes time.
1818. */
1819. if (!xs->valid && (xs != xi || (ctx->param->flags & X509_V_FLAG_CHECK_SS_SIGNATURE)))
^
1820. {
1821. if ((pkey=X509_get_pubkey(xi)) == NULL)
|
https://github.com/openssl/openssl/blob/750487899ad2b794078ed998b513a4a14f60f2cc/crypto/x509/x509_vfy.c/#L1819
|
d2a_code_trace_data_43041
|
static void do_video_stats(AVFormatContext *os, OutputStream *ost,
int frame_size)
{
AVCodecContext *enc;
int frame_number;
double ti1, bitrate, avg_bitrate;
if (!vstats_file) {
vstats_file = fopen(vstats_filename, "w");
if (!vstats_file) {
perror("fopen");
exit_program(1);
}
}
enc = ost->st->codec;
if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
frame_number = ost->frame_number;
fprintf(vstats_file, "frame= %5d q= %2.1f ", frame_number, enc->coded_frame->quality/(float)FF_QP2LAMBDA);
if (enc->flags&CODEC_FLAG_PSNR)
fprintf(vstats_file, "PSNR= %6.2f ", psnr(enc->coded_frame->error[0]/(enc->width*enc->height*255.0*255.0)));
fprintf(vstats_file,"f_size= %6d ", frame_size);
ti1 = ost->sync_opts * av_q2d(enc->time_base);
if (ti1 < 0.01)
ti1 = 0.01;
bitrate = (frame_size * 8) / av_q2d(enc->time_base) / 1000.0;
avg_bitrate = (double)(video_size * 8) / ti1 / 1000.0;
fprintf(vstats_file, "s_size= %8.0fkB time= %0.3f br= %7.1fkbits/s avg_br= %7.1fkbits/s ",
(double)video_size / 1024, ti1, bitrate, avg_bitrate);
fprintf(vstats_file, "type= %c\n", av_get_picture_type_char(enc->coded_frame->pict_type));
}
}
avconv.c:1299: error: Null Dereference
pointer `vstats_file` last assigned on line 1289 could be null and is dereferenced by call to `fprintf()` at line 1299, column 9.
avconv.c:1280:1: start of procedure do_video_stats()
1278. }
1279.
1280. static void do_video_stats(AVFormatContext *os, OutputStream *ost,
^
1281. int frame_size)
1282. {
avconv.c:1288:10: Taking true branch
1286.
1287. /* this is executed just the first time do_video_stats is called */
1288. if (!vstats_file) {
^
1289. vstats_file = fopen(vstats_filename, "w");
1290. if (!vstats_file) {
avconv.c:1289:9:
1287. /* this is executed just the first time do_video_stats is called */
1288. if (!vstats_file) {
1289. vstats_file = fopen(vstats_filename, "w");
^
1290. if (!vstats_file) {
1291. perror("fopen");
avconv.c:1290:14: Taking true branch
1288. if (!vstats_file) {
1289. vstats_file = fopen(vstats_filename, "w");
1290. if (!vstats_file) {
^
1291. perror("fopen");
1292. exit_program(1);
avconv.c:1291:13:
1289. vstats_file = fopen(vstats_filename, "w");
1290. if (!vstats_file) {
1291. perror("fopen");
^
1292. exit_program(1);
1293. }
avconv.c:1292:13: Skipping exit_program(): empty list of specs
1290. if (!vstats_file) {
1291. perror("fopen");
1292. exit_program(1);
^
1293. }
1294. }
avconv.c:1296:5:
1294. }
1295.
1296. enc = ost->st->codec;
^
1297. if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
1298. frame_number = ost->frame_number;
avconv.c:1297:9: Taking true branch
1295.
1296. enc = ost->st->codec;
1297. if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
^
1298. frame_number = ost->frame_number;
1299. fprintf(vstats_file, "frame= %5d q= %2.1f ", frame_number, enc->coded_frame->quality/(float)FF_QP2LAMBDA);
avconv.c:1298:9:
1296. enc = ost->st->codec;
1297. if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
1298. frame_number = ost->frame_number;
^
1299. fprintf(vstats_file, "frame= %5d q= %2.1f ", frame_number, enc->coded_frame->quality/(float)FF_QP2LAMBDA);
1300. if (enc->flags&CODEC_FLAG_PSNR)
avconv.c:1299:9:
1297. if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
1298. frame_number = ost->frame_number;
1299. fprintf(vstats_file, "frame= %5d q= %2.1f ", frame_number, enc->coded_frame->quality/(float)FF_QP2LAMBDA);
^
1300. if (enc->flags&CODEC_FLAG_PSNR)
1301. fprintf(vstats_file, "PSNR= %6.2f ", psnr(enc->coded_frame->error[0]/(enc->width*enc->height*255.0*255.0)));
|
https://github.com/libav/libav/blob/e1edfbcb240cace69d92701e6910c2b03555b7d7/avconv.c/#L1299
|
d2a_code_trace_data_43042
|
void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
{
int i, j, max;
const BN_ULONG *ap;
BN_ULONG *rp;
max = n * 2;
ap = a;
rp = r;
rp[0] = rp[max - 1] = 0;
rp++;
j = n;
if (--j > 0) {
ap++;
rp[j] = bn_mul_words(rp, ap, j, ap[-1]);
rp += 2;
}
for (i = n - 2; i > 0; i--) {
j--;
ap++;
rp[j] = bn_mul_add_words(rp, ap, j, ap[-1]);
rp += 2;
}
bn_add_words(r, r, r, max);
bn_sqr_words(tmp, a, n);
bn_add_words(r, r, tmp, max);
}
crypto/bn/bn_prime.c:103: error: BUFFER_OVERRUN_L3
Offset: [16, +oo] (⇐ 1 + [15, +oo]) Size: [0, 8388607] by call to `BN_is_prime_fasttest_ex`.
Showing all 49 steps of the trace
crypto/bn/bn_prime.c:90:18: Call
88. } else {
89. if (safe) {
90. if (!probable_prime_dh_safe(ret, bits, add, rem, ctx))
^
91. goto err;
92. } else {
crypto/bn/bn_prime.c:404:1: Parameter `p->top`
402. }
403.
404. > static int probable_prime_dh_safe(BIGNUM *p, int bits, const BIGNUM *padd,
405. const BIGNUM *rem, BN_CTX *ctx)
406. {
crypto/bn/bn_prime.c:103:13: Call
101.
102. if (!safe) {
103. i = BN_is_prime_fasttest_ex(ret, checks, ctx, 0, cb);
^
104. if (i == -1)
105. goto err;
crypto/bn/bn_prime.c:151:1: Parameter `a->top`
149. }
150.
151. > int BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed,
152. int do_trial_division, BN_GENCB *cb)
153. {
crypto/bn/bn_prime.c:161:9: Call
159.
160. /* Take care of the really small primes 2 & 3 */
161. if (BN_is_word(a, 2) || BN_is_word(a, 3))
^
162. return 1;
163.
crypto/bn/bn_lib.c:855:1: Parameter `a->top`
853. }
854.
855. > int BN_is_word(const BIGNUM *a, const BN_ULONG w)
856. {
857. return BN_abs_is_word(a, w) && (!w || !a->neg);
crypto/bn/bn_lib.c:857:12: Call
855. int BN_is_word(const BIGNUM *a, const BN_ULONG w)
856. {
857. return BN_abs_is_word(a, w) && (!w || !a->neg);
^
858. }
859.
crypto/bn/bn_lib.c:840:1: Parameter `a->top`
838. }
839.
840. > int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w)
841. {
842. return ((a->top == 1) && (a->d[0] == w)) || ((w == 0) && (a->top == 0));
crypto/bn/bn_prime.c:161:29: Call
159.
160. /* Take care of the really small primes 2 & 3 */
161. if (BN_is_word(a, 2) || BN_is_word(a, 3))
^
162. return 1;
163.
crypto/bn/bn_lib.c:855:1: Parameter `a->top`
853. }
854.
855. > int BN_is_word(const BIGNUM *a, const BN_ULONG w)
856. {
857. return BN_abs_is_word(a, w) && (!w || !a->neg);
crypto/bn/bn_lib.c:857:12: Call
855. int BN_is_word(const BIGNUM *a, const BN_ULONG w)
856. {
857. return BN_abs_is_word(a, w) && (!w || !a->neg);
^
858. }
859.
crypto/bn/bn_lib.c:840:1: Parameter `a->top`
838. }
839.
840. > int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w)
841. {
842. return ((a->top == 1) && (a->d[0] == w)) || ((w == 0) && (a->top == 0));
crypto/bn/bn_prime.c:165:10: Call
163.
164. /* Check odd and bigger than 1 */
165. if (!BN_is_odd(a) || BN_cmp(a, BN_value_one()) <= 0)
^
166. return 0;
167.
crypto/bn/bn_lib.c:860:1: Parameter `a->top`
858. }
859.
860. > int BN_is_odd(const BIGNUM *a)
861. {
862. return (a->top > 0) && (a->d[0] & 1);
crypto/bn/bn_prime.c:165:26: Call
163.
164. /* Check odd and bigger than 1 */
165. if (!BN_is_odd(a) || BN_cmp(a, BN_value_one()) <= 0)
^
166. return 0;
167.
crypto/bn/bn_lib.c:542:1: Parameter `a->top`
540. }
541.
542. > int BN_cmp(const BIGNUM *a, const BIGNUM *b)
543. {
544. int i;
crypto/bn/bn_prime.c:198:10: Call
196.
197. /* compute A1 := a - 1 */
198. if (!BN_copy(A1, a) || !BN_sub_word(A1, 1))
^
199. goto err;
200. /* compute A3 := a - 3 */
crypto/bn/bn_lib.c:285:1: Parameter `b->top`
283. }
284.
285. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
286. {
287. bn_check_top(b);
crypto/bn/bn_prime.c:201:10: Call
199. goto err;
200. /* compute A3 := a - 3 */
201. if (!BN_copy(A3, a) || !BN_sub_word(A3, 3))
^
202. goto err;
203.
crypto/bn/bn_lib.c:285:1: Parameter `b->top`
283. }
284.
285. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
286. {
287. bn_check_top(b);
crypto/bn/bn_prime.c:215:10: Call
213. if (mont == NULL)
214. goto err;
215. if (!BN_MONT_CTX_set(mont, a, ctx))
^
216. goto err;
217.
crypto/bn/bn_mont.c:238:9: Call
236. BIGNUM *Ri, *R;
237.
238. if (BN_is_zero(mod))
^
239. return 0;
240.
crypto/bn/bn_lib.c:845:1: Parameter `a->top`
843. }
844.
845. > int BN_is_zero(const BIGNUM *a)
846. {
847. return a->top == 0;
crypto/bn/bn_prime.c:223:13: Call
221. goto err;
222.
223. j = witness(check, a, A1, A1_odd, k, ctx, mont);
^
224. if (j == -1)
225. goto err;
crypto/bn/bn_prime.c:245:1: Parameter `a->top`
243. }
244.
245. > static int witness(BIGNUM *w, const BIGNUM *a, const BIGNUM *a1,
246. const BIGNUM *a1_odd, int k, BN_CTX *ctx,
247. BN_MONT_CTX *mont)
crypto/bn/bn_prime.c:249:10: Call
247. BN_MONT_CTX *mont)
248. {
249. if (!BN_mod_exp_mont(w, w, a1_odd, a, ctx, mont)) /* w := w^a1_odd mod a */
^
250. return -1;
251. if (BN_is_one(w))
crypto/bn/bn_exp.c:296:1: Parameter `m->top`
294. }
295.
296. > int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
297. const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
298. {
crypto/bn/bn_exp.c:310:16: Call
308. || BN_get_flags(a, BN_FLG_CONSTTIME) != 0
309. || BN_get_flags(m, BN_FLG_CONSTTIME) != 0) {
310. return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont);
^
311. }
312.
crypto/bn/bn_exp.c:745:14: Assignment
743. /* 2^(top*BN_BITS2) - m */
744. tmp.d[0] = (0 - m->d[0]) & BN_MASK2;
745. for (i = 1; i < top; i++)
^
746. tmp.d[i] = (~m->d[i]) & BN_MASK2;
747. tmp.top = top;
crypto/bn/bn_exp.c:1062:14: Call
1060. bits -= window0;
1061. wvalue = bn_get_bits(p, bits) & wmask;
1062. if (!MOD_EXP_CTIME_COPY_FROM_PREBUF(&tmp, top, powerbuf, wvalue,
^
1063. window))
1064. goto err;
crypto/bn/bn_exp.c:520:1: Parameter `top`
518. }
519.
520. > static int MOD_EXP_CTIME_COPY_FROM_PREBUF(BIGNUM *b, int top,
521. unsigned char *buf, int idx,
522. int window)
crypto/bn/bn_exp.c:577:5: Assignment
575. }
576.
577. b->top = top;
^
578. bn_correct_top(b);
579. return 1;
crypto/bn/bn_exp.c:578:5: Call
576.
577. b->top = top;
578. bn_correct_top(b);
^
579. return 1;
580. }
crypto/bn/bn_lib.c:946:1: Parameter `a->top`
944. }
945.
946. > void bn_correct_top(BIGNUM *a)
947. {
948. BN_ULONG *ftl;
crypto/bn/bn_exp.c:1075:22: Call
1073. /* Square the result window-size times */
1074. for (i = 0; i < window; i++)
1075. if (!BN_mod_mul_montgomery(&tmp, &tmp, &tmp, mont, ctx))
^
1076. goto err;
1077.
crypto/bn/bn_mont.c:26:1: Parameter `a->top`
24. #endif
25.
26. > int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
27. BN_MONT_CTX *mont, BN_CTX *ctx)
28. {
crypto/bn/bn_mont.c:53:14: Call
51. bn_check_top(tmp);
52. if (a == b) {
53. if (!BN_sqr(tmp, a, ctx))
^
54. goto err;
55. } else {
crypto/bn/bn_sqr.c:17:1: Parameter `a->top`
15. * I've just gone over this and it is now %20 faster on x86 - eay - 27 Jun 96
16. */
17. > int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx)
18. {
19. int max, al;
crypto/bn/bn_sqr.c:25:5: Assignment
23. bn_check_top(a);
24.
25. al = a->top;
^
26. if (al <= 0) {
27. r->top = 0;
crypto/bn/bn_sqr.c:74:17: Call
72. if (bn_wexpand(tmp, max) == NULL)
73. goto err;
74. bn_sqr_normal(rr->d, a->d, al, tmp->d);
^
75. }
76. }
crypto/bn/bn_sqr.c:105:1: <Offset trace>
103.
104. /* tmp must have 2*n words */
105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
106. {
107. int i, j, max;
crypto/bn/bn_sqr.c:105:1: Parameter `n`
103.
104. /* tmp must have 2*n words */
105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
106. {
107. int i, j, max;
crypto/bn/bn_sqr.c:116:5: Assignment
114. rp[0] = rp[max - 1] = 0;
115. rp++;
116. j = n;
^
117.
118. if (--j > 0) {
crypto/bn/bn_sqr.c:118:9: Assignment
116. j = n;
117.
118. if (--j > 0) {
^
119. ap++;
120. rp[j] = bn_mul_words(rp, ap, j, ap[-1]);
crypto/bn/bn_sqr.c:105:1: <Length trace>
103.
104. /* tmp must have 2*n words */
105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
106. {
107. int i, j, max;
crypto/bn/bn_sqr.c:105:1: Parameter `*r`
103.
104. /* tmp must have 2*n words */
105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
106. {
107. int i, j, max;
crypto/bn/bn_sqr.c:113:5: Assignment
111. max = n * 2;
112. ap = a;
113. rp = r;
^
114. rp[0] = rp[max - 1] = 0;
115. rp++;
crypto/bn/bn_sqr.c:115:5: Assignment
113. rp = r;
114. rp[0] = rp[max - 1] = 0;
115. rp++;
^
116. j = n;
117.
crypto/bn/bn_sqr.c:120:9: Array access: Offset: [16, +oo] (⇐ 1 + [15, +oo]) Size: [0, 8388607] by call to `BN_is_prime_fasttest_ex`
118. if (--j > 0) {
119. ap++;
120. rp[j] = bn_mul_words(rp, ap, j, ap[-1]);
^
121. rp += 2;
122. }
|
https://github.com/openssl/openssl/blob/b48d4397b8ee4256f0b0a115eb99f27ae89995e0/crypto/bn/bn_sqr.c/#L120
|
d2a_code_trace_data_43043
|
SSL_TEST_CTX *SSL_TEST_CTX_create(const CONF *conf, const char *test_section)
{
STACK_OF(CONF_VALUE) *sk_conf = NULL;
SSL_TEST_CTX *ctx = NULL;
int i;
size_t j;
if (!TEST_ptr(sk_conf = NCONF_get_section(conf, test_section))
|| !TEST_ptr(ctx = SSL_TEST_CTX_new()))
goto err;
for (i = 0; i < sk_CONF_VALUE_num(sk_conf); i++) {
int found = 0;
const CONF_VALUE *option = sk_CONF_VALUE_value(sk_conf, i);
if (strcmp(option->name, "client") == 0) {
if (!parse_client_options(&ctx->extra.client, conf, option->value))
goto err;
} else if (strcmp(option->name, "server") == 0) {
if (!parse_server_options(&ctx->extra.server, conf, option->value))
goto err;
} else if (strcmp(option->name, "server2") == 0) {
if (!parse_server_options(&ctx->extra.server2, conf, option->value))
goto err;
} else if (strcmp(option->name, "resume-client") == 0) {
if (!parse_client_options(&ctx->resume_extra.client, conf,
option->value))
goto err;
} else if (strcmp(option->name, "resume-server") == 0) {
if (!parse_server_options(&ctx->resume_extra.server, conf,
option->value))
goto err;
} else if (strcmp(option->name, "resume-server2") == 0) {
if (!parse_server_options(&ctx->resume_extra.server2, conf,
option->value))
goto err;
} else {
for (j = 0; j < OSSL_NELEM(ssl_test_ctx_options); j++) {
if (strcmp(option->name, ssl_test_ctx_options[j].name) == 0) {
if (!ssl_test_ctx_options[j].parse(ctx, option->value)) {
TEST_info("Bad value %s for option %s",
option->value, option->name);
goto err;
}
found = 1;
break;
}
}
if (!found) {
TEST_info("Unknown test option: %s", option->name);
goto err;
}
}
}
goto done;
err:
SSL_TEST_CTX_free(ctx);
ctx = NULL;
done:
return ctx;
}
test/ssl_test_ctx.c:876: error: NULL_DEREFERENCE
pointer `ctx` last assigned on line 820 could be null and is dereferenced by call to `SSL_TEST_CTX_free()` at line 876, column 5.
Showing all 39 steps of the trace
test/ssl_test_ctx.c:817:1: start of procedure SSL_TEST_CTX_create()
815. }
816.
817. > SSL_TEST_CTX *SSL_TEST_CTX_create(const CONF *conf, const char *test_section)
818. {
819. STACK_OF(CONF_VALUE) *sk_conf = NULL;
test/ssl_test_ctx.c:819:5:
817. SSL_TEST_CTX *SSL_TEST_CTX_create(const CONF *conf, const char *test_section)
818. {
819. > STACK_OF(CONF_VALUE) *sk_conf = NULL;
820. SSL_TEST_CTX *ctx = NULL;
821. int i;
test/ssl_test_ctx.c:820:5:
818. {
819. STACK_OF(CONF_VALUE) *sk_conf = NULL;
820. > SSL_TEST_CTX *ctx = NULL;
821. int i;
822. size_t j;
test/ssl_test_ctx.c:824:10:
822. size_t j;
823.
824. > if (!TEST_ptr(sk_conf = NCONF_get_section(conf, test_section))
825. || !TEST_ptr(ctx = SSL_TEST_CTX_new()))
826. goto err;
crypto/conf/conf_lib.c:244:1: start of procedure NCONF_get_section()
242. }
243.
244. > STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf, const char *section)
245. {
246. if (conf == NULL) {
crypto/conf/conf_lib.c:246:9: Taking false branch
244. STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf, const char *section)
245. {
246. if (conf == NULL) {
^
247. CONFerr(CONF_F_NCONF_GET_SECTION, CONF_R_NO_CONF);
248. return NULL;
crypto/conf/conf_lib.c:251:9: Taking false branch
249. }
250.
251. if (section == NULL) {
^
252. CONFerr(CONF_F_NCONF_GET_SECTION, CONF_R_NO_SECTION);
253. return NULL;
crypto/conf/conf_lib.c:256:5:
254. }
255.
256. > return _CONF_get_section_values(conf, section);
257. }
258.
crypto/conf/conf_api.c:35:1: start of procedure _CONF_get_section_values()
33.
34. /* Up until OpenSSL 0.9.5a, this was CONF_get_section */
35. > STACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf,
36. const char *section)
37. {
crypto/conf/conf_api.c:40:5:
38. CONF_VALUE *v;
39.
40. > v = _CONF_get_section(conf, section);
41. if (v != NULL)
42. return ((STACK_OF(CONF_VALUE) *)v->value);
crypto/conf/conf_api.c:22:1: start of procedure _CONF_get_section()
20.
21. /* Up until OpenSSL 0.9.5a, this was get_section */
22. > CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section)
23. {
24. CONF_VALUE *v, vv;
crypto/conf/conf_api.c:26:10: Taking false branch
24. CONF_VALUE *v, vv;
25.
26. if ((conf == NULL) || (section == NULL))
^
27. return NULL;
28. vv.name = NULL;
crypto/conf/conf_api.c:26:28: Taking false branch
24. CONF_VALUE *v, vv;
25.
26. if ((conf == NULL) || (section == NULL))
^
27. return NULL;
28. vv.name = NULL;
crypto/conf/conf_api.c:28:5:
26. if ((conf == NULL) || (section == NULL))
27. return NULL;
28. > vv.name = NULL;
29. vv.section = (char *)section;
30. v = lh_CONF_VALUE_retrieve(conf->data, &vv);
crypto/conf/conf_api.c:29:5:
27. return NULL;
28. vv.name = NULL;
29. > vv.section = (char *)section;
30. v = lh_CONF_VALUE_retrieve(conf->data, &vv);
31. return v;
crypto/conf/conf_api.c:30:5:
28. vv.name = NULL;
29. vv.section = (char *)section;
30. > v = lh_CONF_VALUE_retrieve(conf->data, &vv);
31. return v;
32. }
include/openssl/conf.h:31:1: start of procedure lh_CONF_VALUE_retrieve()
29.
30. DEFINE_STACK_OF(CONF_VALUE)
31. > DEFINE_LHASH_OF(CONF_VALUE);
32.
33. struct conf_st;
crypto/lhash/lhash.c:147:1: start of procedure OPENSSL_LH_retrieve()
145. }
146.
147. > void *OPENSSL_LH_retrieve(OPENSSL_LHASH *lh, const void *data)
148. {
149. unsigned long hash;
crypto/lhash/lhash.c:153:5:
151. void *ret;
152.
153. > lh->error = 0;
154. rn = getrn(lh, data, &hash);
155.
crypto/lhash/lhash.c:154:5: Skipping getrn(): empty list of specs
152.
153. lh->error = 0;
154. rn = getrn(lh, data, &hash);
^
155.
156. if (*rn == NULL) {
crypto/lhash/lhash.c:156:9: Taking true branch
154. rn = getrn(lh, data, &hash);
155.
156. if (*rn == NULL) {
^
157. lh->num_retrieve_miss++;
158. return NULL;
crypto/lhash/lhash.c:157:9:
155.
156. if (*rn == NULL) {
157. > lh->num_retrieve_miss++;
158. return NULL;
159. } else {
crypto/lhash/lhash.c:158:9:
156. if (*rn == NULL) {
157. lh->num_retrieve_miss++;
158. > return NULL;
159. } else {
160. ret = (*rn)->data;
crypto/lhash/lhash.c:164:1: return from a call to OPENSSL_LH_retrieve
162. }
163. return ret;
164. > }
165.
166. static void doall_util_fn(OPENSSL_LHASH *lh, int use_arg,
include/openssl/conf.h:31:1: return from a call to lh_CONF_VALUE_retrieve
29.
30. DEFINE_STACK_OF(CONF_VALUE)
31. > DEFINE_LHASH_OF(CONF_VALUE);
32.
33. struct conf_st;
crypto/conf/conf_api.c:31:5:
29. vv.section = (char *)section;
30. v = lh_CONF_VALUE_retrieve(conf->data, &vv);
31. > return v;
32. }
33.
crypto/conf/conf_api.c:32:1: return from a call to _CONF_get_section
30. v = lh_CONF_VALUE_retrieve(conf->data, &vv);
31. return v;
32. > }
33.
34. /* Up until OpenSSL 0.9.5a, this was CONF_get_section */
crypto/conf/conf_api.c:41:9: Taking false branch
39.
40. v = _CONF_get_section(conf, section);
41. if (v != NULL)
^
42. return ((STACK_OF(CONF_VALUE) *)v->value);
43. else
crypto/conf/conf_api.c:44:9:
42. return ((STACK_OF(CONF_VALUE) *)v->value);
43. else
44. > return NULL;
45. }
46.
crypto/conf/conf_api.c:45:1: return from a call to _CONF_get_section_values
43. else
44. return NULL;
45. > }
46.
47. int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value)
crypto/conf/conf_lib.c:257:1: return from a call to NCONF_get_section
255.
256. return _CONF_get_section_values(conf, section);
257. > }
258.
259. char *NCONF_get_string(const CONF *conf, const char *group, const char *name)
test/testutil/tests.c:228:1: start of procedure test_ptr()
226. }
227.
228. > int test_ptr(const char *file, int line, const char *s, const void *p)
229. {
230. if (p != NULL)
test/testutil/tests.c:230:9: Taking false branch
228. int test_ptr(const char *file, int line, const char *s, const void *p)
229. {
230. if (p != NULL)
^
231. return 1;
232. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
test/testutil/tests.c:232:5: Skipping test_fail_message(): empty list of specs
230. if (p != NULL)
231. return 1;
232. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
^
233. return 0;
234. }
test/testutil/tests.c:233:5:
231. return 1;
232. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
233. > return 0;
234. }
235.
test/testutil/tests.c:234:1: return from a call to test_ptr
232. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
233. return 0;
234. > }
235.
236. int test_true(const char *file, int line, const char *s, int b)
test/ssl_test_ctx.c:824:10: Taking true branch
822. size_t j;
823.
824. if (!TEST_ptr(sk_conf = NCONF_get_section(conf, test_section))
^
825. || !TEST_ptr(ctx = SSL_TEST_CTX_new()))
826. goto err;
test/ssl_test_ctx.c:875:2:
873. goto done;
874.
875. > err:
876. SSL_TEST_CTX_free(ctx);
877. ctx = NULL;
test/ssl_test_ctx.c:876:5:
874.
875. err:
876. > SSL_TEST_CTX_free(ctx);
877. ctx = NULL;
878. done:
|
https://github.com/openssl/openssl/blob/e43e6b1951de931ca500c6964496e76651332f5e/test/ssl_test_ctx.c/#L876
|
d2a_code_trace_data_43044
|
static void put_audio_specific_config(AVCodecContext *avctx)
{
PutBitContext pb;
AACEncContext *s = avctx->priv_data;
init_put_bits(&pb, avctx->extradata, avctx->extradata_size*8);
put_bits(&pb, 5, 2);
put_bits(&pb, 4, s->samplerate_index);
put_bits(&pb, 4, s->channels);
put_bits(&pb, 1, 0);
put_bits(&pb, 1, 0);
put_bits(&pb, 1, 0);
put_bits(&pb, 11, 0x2b7);
put_bits(&pb, 5, AOT_SBR);
put_bits(&pb, 1, 0);
flush_put_bits(&pb);
}
libavcodec/aacenc.c:180: error: Null Dereference
pointer `&pb->buf_ptr` last assigned on line 169 could be null and is dereferenced by call to `put_bits()` at line 180, column 5.
libavcodec/aacenc.c:164:1: start of procedure put_audio_specific_config()
162. * @see 1.6.2.1 "Syntax - AudioSpecificConfig"
163. */
164. static void put_audio_specific_config(AVCodecContext *avctx)
^
165. {
166. PutBitContext pb;
libavcodec/aacenc.c:167:5:
165. {
166. PutBitContext pb;
167. AACEncContext *s = avctx->priv_data;
^
168.
169. init_put_bits(&pb, avctx->extradata, avctx->extradata_size*8);
libavcodec/aacenc.c:169:5:
167. AACEncContext *s = avctx->priv_data;
168.
169. init_put_bits(&pb, avctx->extradata, avctx->extradata_size*8);
^
170. put_bits(&pb, 5, 2); //object type - AAC-LC
171. put_bits(&pb, 4, s->samplerate_index); //sample rate index
libavcodec/put_bits.h:52:1: start of procedure init_put_bits()
50. * @param buffer_size the size in bytes of buffer
51. */
52. static inline void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
^
53. {
54. if(buffer_size < 0) {
libavcodec/put_bits.h:54:8: Taking true branch
52. static inline void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
53. {
54. if(buffer_size < 0) {
^
55. buffer_size = 0;
56. buffer = NULL;
libavcodec/put_bits.h:55:9:
53. {
54. if(buffer_size < 0) {
55. buffer_size = 0;
^
56. buffer = NULL;
57. }
libavcodec/put_bits.h:56:9:
54. if(buffer_size < 0) {
55. buffer_size = 0;
56. buffer = NULL;
^
57. }
58.
libavcodec/put_bits.h:59:5:
57. }
58.
59. s->size_in_bits= 8*buffer_size;
^
60. s->buf = buffer;
61. s->buf_end = s->buf + buffer_size;
libavcodec/put_bits.h:60:5:
58.
59. s->size_in_bits= 8*buffer_size;
60. s->buf = buffer;
^
61. s->buf_end = s->buf + buffer_size;
62. s->buf_ptr = s->buf;
libavcodec/put_bits.h:61:5:
59. s->size_in_bits= 8*buffer_size;
60. s->buf = buffer;
61. s->buf_end = s->buf + buffer_size;
^
62. s->buf_ptr = s->buf;
63. s->bit_left=32;
libavcodec/put_bits.h:62:5:
60. s->buf = buffer;
61. s->buf_end = s->buf + buffer_size;
62. s->buf_ptr = s->buf;
^
63. s->bit_left=32;
64. s->bit_buf=0;
libavcodec/put_bits.h:63:5:
61. s->buf_end = s->buf + buffer_size;
62. s->buf_ptr = s->buf;
63. s->bit_left=32;
^
64. s->bit_buf=0;
65. }
libavcodec/put_bits.h:64:5:
62. s->buf_ptr = s->buf;
63. s->bit_left=32;
64. s->bit_buf=0;
^
65. }
66.
libavcodec/put_bits.h:65:1: return from a call to init_put_bits
63. s->bit_left=32;
64. s->bit_buf=0;
65. }
^
66.
67. /**
libavcodec/aacenc.c:170:5:
168.
169. init_put_bits(&pb, avctx->extradata, avctx->extradata_size*8);
170. put_bits(&pb, 5, 2); //object type - AAC-LC
^
171. put_bits(&pb, 4, s->samplerate_index); //sample rate index
172. put_bits(&pb, 4, s->channels);
libavcodec/put_bits.h:128:1: start of procedure put_bits()
126. * Use put_bits32 to write 32 bits.
127. */
128. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
^
129. {
130. unsigned int bit_buf;
libavcodec/put_bits.h:134:5:
132.
133. // printf("put_bits=%d %x\n", n, value);
134. assert(n <= 31 && value < (1U << n));
^
135.
136. bit_buf = s->bit_buf;
libavcodec/put_bits.h:136:5:
134. assert(n <= 31 && value < (1U << n));
135.
136. bit_buf = s->bit_buf;
^
137. bit_left = s->bit_left;
138.
libavcodec/put_bits.h:137:5:
135.
136. bit_buf = s->bit_buf;
137. bit_left = s->bit_left;
^
138.
139. // printf("n=%d value=%x cnt=%d buf=%x\n", n, value, bit_cnt, bit_buf);
libavcodec/put_bits.h:151:9: Taking true branch
149. bit_left-=n;
150. #else
151. if (n < bit_left) {
^
152. bit_buf = (bit_buf<<n) | value;
153. bit_left-=n;
libavcodec/put_bits.h:152:9:
150. #else
151. if (n < bit_left) {
152. bit_buf = (bit_buf<<n) | value;
^
153. bit_left-=n;
154. } else {
libavcodec/put_bits.h:153:9:
151. if (n < bit_left) {
152. bit_buf = (bit_buf<<n) | value;
153. bit_left-=n;
^
154. } else {
155. bit_buf<<=bit_left;
libavcodec/put_bits.h:165:5:
163. #endif
164.
165. s->bit_buf = bit_buf;
^
166. s->bit_left = bit_left;
167. }
libavcodec/put_bits.h:166:5:
164.
165. s->bit_buf = bit_buf;
166. s->bit_left = bit_left;
^
167. }
168.
libavcodec/put_bits.h:167:1: return from a call to put_bits
165. s->bit_buf = bit_buf;
166. s->bit_left = bit_left;
167. }
^
168.
169. static inline void put_sbits(PutBitContext *pb, int n, int32_t value)
libavcodec/aacenc.c:171:5:
169. init_put_bits(&pb, avctx->extradata, avctx->extradata_size*8);
170. put_bits(&pb, 5, 2); //object type - AAC-LC
171. put_bits(&pb, 4, s->samplerate_index); //sample rate index
^
172. put_bits(&pb, 4, s->channels);
173. //GASpecificConfig
libavcodec/put_bits.h:128:1: start of procedure put_bits()
126. * Use put_bits32 to write 32 bits.
127. */
128. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
^
129. {
130. unsigned int bit_buf;
libavcodec/put_bits.h:134:5:
132.
133. // printf("put_bits=%d %x\n", n, value);
134. assert(n <= 31 && value < (1U << n));
^
135.
136. bit_buf = s->bit_buf;
libavcodec/put_bits.h:136:5:
134. assert(n <= 31 && value < (1U << n));
135.
136. bit_buf = s->bit_buf;
^
137. bit_left = s->bit_left;
138.
libavcodec/put_bits.h:137:5:
135.
136. bit_buf = s->bit_buf;
137. bit_left = s->bit_left;
^
138.
139. // printf("n=%d value=%x cnt=%d buf=%x\n", n, value, bit_cnt, bit_buf);
libavcodec/put_bits.h:151:9: Taking true branch
149. bit_left-=n;
150. #else
151. if (n < bit_left) {
^
152. bit_buf = (bit_buf<<n) | value;
153. bit_left-=n;
libavcodec/put_bits.h:152:9:
150. #else
151. if (n < bit_left) {
152. bit_buf = (bit_buf<<n) | value;
^
153. bit_left-=n;
154. } else {
libavcodec/put_bits.h:153:9:
151. if (n < bit_left) {
152. bit_buf = (bit_buf<<n) | value;
153. bit_left-=n;
^
154. } else {
155. bit_buf<<=bit_left;
libavcodec/put_bits.h:165:5:
163. #endif
164.
165. s->bit_buf = bit_buf;
^
166. s->bit_left = bit_left;
167. }
libavcodec/put_bits.h:166:5:
164.
165. s->bit_buf = bit_buf;
166. s->bit_left = bit_left;
^
167. }
168.
libavcodec/put_bits.h:167:1: return from a call to put_bits
165. s->bit_buf = bit_buf;
166. s->bit_left = bit_left;
167. }
^
168.
169. static inline void put_sbits(PutBitContext *pb, int n, int32_t value)
libavcodec/aacenc.c:172:5:
170. put_bits(&pb, 5, 2); //object type - AAC-LC
171. put_bits(&pb, 4, s->samplerate_index); //sample rate index
172. put_bits(&pb, 4, s->channels);
^
173. //GASpecificConfig
174. put_bits(&pb, 1, 0); //frame length - 1024 samples
libavcodec/put_bits.h:128:1: start of procedure put_bits()
126. * Use put_bits32 to write 32 bits.
127. */
128. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
^
129. {
130. unsigned int bit_buf;
libavcodec/put_bits.h:134:5:
132.
133. // printf("put_bits=%d %x\n", n, value);
134. assert(n <= 31 && value < (1U << n));
^
135.
136. bit_buf = s->bit_buf;
libavcodec/put_bits.h:136:5:
134. assert(n <= 31 && value < (1U << n));
135.
136. bit_buf = s->bit_buf;
^
137. bit_left = s->bit_left;
138.
libavcodec/put_bits.h:137:5:
135.
136. bit_buf = s->bit_buf;
137. bit_left = s->bit_left;
^
138.
139. // printf("n=%d value=%x cnt=%d buf=%x\n", n, value, bit_cnt, bit_buf);
libavcodec/put_bits.h:151:9: Taking true branch
149. bit_left-=n;
150. #else
151. if (n < bit_left) {
^
152. bit_buf = (bit_buf<<n) | value;
153. bit_left-=n;
libavcodec/put_bits.h:152:9:
150. #else
151. if (n < bit_left) {
152. bit_buf = (bit_buf<<n) | value;
^
153. bit_left-=n;
154. } else {
libavcodec/put_bits.h:153:9:
151. if (n < bit_left) {
152. bit_buf = (bit_buf<<n) | value;
153. bit_left-=n;
^
154. } else {
155. bit_buf<<=bit_left;
libavcodec/put_bits.h:165:5:
163. #endif
164.
165. s->bit_buf = bit_buf;
^
166. s->bit_left = bit_left;
167. }
libavcodec/put_bits.h:166:5:
164.
165. s->bit_buf = bit_buf;
166. s->bit_left = bit_left;
^
167. }
168.
libavcodec/put_bits.h:167:1: return from a call to put_bits
165. s->bit_buf = bit_buf;
166. s->bit_left = bit_left;
167. }
^
168.
169. static inline void put_sbits(PutBitContext *pb, int n, int32_t value)
libavcodec/aacenc.c:174:5:
172. put_bits(&pb, 4, s->channels);
173. //GASpecificConfig
174. put_bits(&pb, 1, 0); //frame length - 1024 samples
^
175. put_bits(&pb, 1, 0); //does not depend on core coder
176. put_bits(&pb, 1, 0); //is not extension
libavcodec/put_bits.h:128:1: start of procedure put_bits()
126. * Use put_bits32 to write 32 bits.
127. */
128. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
^
129. {
130. unsigned int bit_buf;
libavcodec/put_bits.h:134:5:
132.
133. // printf("put_bits=%d %x\n", n, value);
134. assert(n <= 31 && value < (1U << n));
^
135.
136. bit_buf = s->bit_buf;
libavcodec/put_bits.h:136:5:
134. assert(n <= 31 && value < (1U << n));
135.
136. bit_buf = s->bit_buf;
^
137. bit_left = s->bit_left;
138.
libavcodec/put_bits.h:137:5:
135.
136. bit_buf = s->bit_buf;
137. bit_left = s->bit_left;
^
138.
139. // printf("n=%d value=%x cnt=%d buf=%x\n", n, value, bit_cnt, bit_buf);
libavcodec/put_bits.h:151:9: Taking true branch
149. bit_left-=n;
150. #else
151. if (n < bit_left) {
^
152. bit_buf = (bit_buf<<n) | value;
153. bit_left-=n;
libavcodec/put_bits.h:152:9:
150. #else
151. if (n < bit_left) {
152. bit_buf = (bit_buf<<n) | value;
^
153. bit_left-=n;
154. } else {
libavcodec/put_bits.h:153:9:
151. if (n < bit_left) {
152. bit_buf = (bit_buf<<n) | value;
153. bit_left-=n;
^
154. } else {
155. bit_buf<<=bit_left;
libavcodec/put_bits.h:165:5:
163. #endif
164.
165. s->bit_buf = bit_buf;
^
166. s->bit_left = bit_left;
167. }
libavcodec/put_bits.h:166:5:
164.
165. s->bit_buf = bit_buf;
166. s->bit_left = bit_left;
^
167. }
168.
libavcodec/put_bits.h:167:1: return from a call to put_bits
165. s->bit_buf = bit_buf;
166. s->bit_left = bit_left;
167. }
^
168.
169. static inline void put_sbits(PutBitContext *pb, int n, int32_t value)
libavcodec/aacenc.c:175:5:
173. //GASpecificConfig
174. put_bits(&pb, 1, 0); //frame length - 1024 samples
175. put_bits(&pb, 1, 0); //does not depend on core coder
^
176. put_bits(&pb, 1, 0); //is not extension
177.
libavcodec/put_bits.h:128:1: start of procedure put_bits()
126. * Use put_bits32 to write 32 bits.
127. */
128. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
^
129. {
130. unsigned int bit_buf;
libavcodec/put_bits.h:134:5:
132.
133. // printf("put_bits=%d %x\n", n, value);
134. assert(n <= 31 && value < (1U << n));
^
135.
136. bit_buf = s->bit_buf;
libavcodec/put_bits.h:136:5:
134. assert(n <= 31 && value < (1U << n));
135.
136. bit_buf = s->bit_buf;
^
137. bit_left = s->bit_left;
138.
libavcodec/put_bits.h:137:5:
135.
136. bit_buf = s->bit_buf;
137. bit_left = s->bit_left;
^
138.
139. // printf("n=%d value=%x cnt=%d buf=%x\n", n, value, bit_cnt, bit_buf);
libavcodec/put_bits.h:151:9: Taking true branch
149. bit_left-=n;
150. #else
151. if (n < bit_left) {
^
152. bit_buf = (bit_buf<<n) | value;
153. bit_left-=n;
libavcodec/put_bits.h:152:9:
150. #else
151. if (n < bit_left) {
152. bit_buf = (bit_buf<<n) | value;
^
153. bit_left-=n;
154. } else {
libavcodec/put_bits.h:153:9:
151. if (n < bit_left) {
152. bit_buf = (bit_buf<<n) | value;
153. bit_left-=n;
^
154. } else {
155. bit_buf<<=bit_left;
libavcodec/put_bits.h:165:5:
163. #endif
164.
165. s->bit_buf = bit_buf;
^
166. s->bit_left = bit_left;
167. }
libavcodec/put_bits.h:166:5:
164.
165. s->bit_buf = bit_buf;
166. s->bit_left = bit_left;
^
167. }
168.
libavcodec/put_bits.h:167:1: return from a call to put_bits
165. s->bit_buf = bit_buf;
166. s->bit_left = bit_left;
167. }
^
168.
169. static inline void put_sbits(PutBitContext *pb, int n, int32_t value)
libavcodec/aacenc.c:176:5:
174. put_bits(&pb, 1, 0); //frame length - 1024 samples
175. put_bits(&pb, 1, 0); //does not depend on core coder
176. put_bits(&pb, 1, 0); //is not extension
^
177.
178. //Explicitly Mark SBR absent
libavcodec/put_bits.h:128:1: start of procedure put_bits()
126. * Use put_bits32 to write 32 bits.
127. */
128. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
^
129. {
130. unsigned int bit_buf;
libavcodec/put_bits.h:134:5:
132.
133. // printf("put_bits=%d %x\n", n, value);
134. assert(n <= 31 && value < (1U << n));
^
135.
136. bit_buf = s->bit_buf;
libavcodec/put_bits.h:136:5:
134. assert(n <= 31 && value < (1U << n));
135.
136. bit_buf = s->bit_buf;
^
137. bit_left = s->bit_left;
138.
libavcodec/put_bits.h:137:5:
135.
136. bit_buf = s->bit_buf;
137. bit_left = s->bit_left;
^
138.
139. // printf("n=%d value=%x cnt=%d buf=%x\n", n, value, bit_cnt, bit_buf);
libavcodec/put_bits.h:151:9: Taking true branch
149. bit_left-=n;
150. #else
151. if (n < bit_left) {
^
152. bit_buf = (bit_buf<<n) | value;
153. bit_left-=n;
libavcodec/put_bits.h:152:9:
150. #else
151. if (n < bit_left) {
152. bit_buf = (bit_buf<<n) | value;
^
153. bit_left-=n;
154. } else {
libavcodec/put_bits.h:153:9:
151. if (n < bit_left) {
152. bit_buf = (bit_buf<<n) | value;
153. bit_left-=n;
^
154. } else {
155. bit_buf<<=bit_left;
libavcodec/put_bits.h:165:5:
163. #endif
164.
165. s->bit_buf = bit_buf;
^
166. s->bit_left = bit_left;
167. }
libavcodec/put_bits.h:166:5:
164.
165. s->bit_buf = bit_buf;
166. s->bit_left = bit_left;
^
167. }
168.
libavcodec/put_bits.h:167:1: return from a call to put_bits
165. s->bit_buf = bit_buf;
166. s->bit_left = bit_left;
167. }
^
168.
169. static inline void put_sbits(PutBitContext *pb, int n, int32_t value)
libavcodec/aacenc.c:179:5:
177.
178. //Explicitly Mark SBR absent
179. put_bits(&pb, 11, 0x2b7); //sync extension
^
180. put_bits(&pb, 5, AOT_SBR);
181. put_bits(&pb, 1, 0);
libavcodec/put_bits.h:128:1: start of procedure put_bits()
126. * Use put_bits32 to write 32 bits.
127. */
128. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
^
129. {
130. unsigned int bit_buf;
libavcodec/put_bits.h:134:5:
132.
133. // printf("put_bits=%d %x\n", n, value);
134. assert(n <= 31 && value < (1U << n));
^
135.
136. bit_buf = s->bit_buf;
libavcodec/put_bits.h:136:5:
134. assert(n <= 31 && value < (1U << n));
135.
136. bit_buf = s->bit_buf;
^
137. bit_left = s->bit_left;
138.
libavcodec/put_bits.h:137:5:
135.
136. bit_buf = s->bit_buf;
137. bit_left = s->bit_left;
^
138.
139. // printf("n=%d value=%x cnt=%d buf=%x\n", n, value, bit_cnt, bit_buf);
libavcodec/put_bits.h:151:9: Taking true branch
149. bit_left-=n;
150. #else
151. if (n < bit_left) {
^
152. bit_buf = (bit_buf<<n) | value;
153. bit_left-=n;
libavcodec/put_bits.h:152:9:
150. #else
151. if (n < bit_left) {
152. bit_buf = (bit_buf<<n) | value;
^
153. bit_left-=n;
154. } else {
libavcodec/put_bits.h:153:9:
151. if (n < bit_left) {
152. bit_buf = (bit_buf<<n) | value;
153. bit_left-=n;
^
154. } else {
155. bit_buf<<=bit_left;
libavcodec/put_bits.h:165:5:
163. #endif
164.
165. s->bit_buf = bit_buf;
^
166. s->bit_left = bit_left;
167. }
libavcodec/put_bits.h:166:5:
164.
165. s->bit_buf = bit_buf;
166. s->bit_left = bit_left;
^
167. }
168.
libavcodec/put_bits.h:167:1: return from a call to put_bits
165. s->bit_buf = bit_buf;
166. s->bit_left = bit_left;
167. }
^
168.
169. static inline void put_sbits(PutBitContext *pb, int n, int32_t value)
libavcodec/aacenc.c:180:5:
178. //Explicitly Mark SBR absent
179. put_bits(&pb, 11, 0x2b7); //sync extension
180. put_bits(&pb, 5, AOT_SBR);
^
181. put_bits(&pb, 1, 0);
182. flush_put_bits(&pb);
libavcodec/put_bits.h:128:1: start of procedure put_bits()
126. * Use put_bits32 to write 32 bits.
127. */
128. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
^
129. {
130. unsigned int bit_buf;
libavcodec/put_bits.h:134:5:
132.
133. // printf("put_bits=%d %x\n", n, value);
134. assert(n <= 31 && value < (1U << n));
^
135.
136. bit_buf = s->bit_buf;
libavcodec/put_bits.h:136:5:
134. assert(n <= 31 && value < (1U << n));
135.
136. bit_buf = s->bit_buf;
^
137. bit_left = s->bit_left;
138.
libavcodec/put_bits.h:137:5:
135.
136. bit_buf = s->bit_buf;
137. bit_left = s->bit_left;
^
138.
139. // printf("n=%d value=%x cnt=%d buf=%x\n", n, value, bit_cnt, bit_buf);
libavcodec/put_bits.h:151:9: Taking false branch
149. bit_left-=n;
150. #else
151. if (n < bit_left) {
^
152. bit_buf = (bit_buf<<n) | value;
153. bit_left-=n;
libavcodec/put_bits.h:155:9:
153. bit_left-=n;
154. } else {
155. bit_buf<<=bit_left;
^
156. bit_buf |= value >> (n - bit_left);
157. AV_WB32(s->buf_ptr, bit_buf);
libavcodec/put_bits.h:156:9:
154. } else {
155. bit_buf<<=bit_left;
156. bit_buf |= value >> (n - bit_left);
^
157. AV_WB32(s->buf_ptr, bit_buf);
158. //printf("bitbuf = %08x\n", bit_buf);
libavcodec/put_bits.h:157:9:
155. bit_buf<<=bit_left;
156. bit_buf |= value >> (n - bit_left);
157. AV_WB32(s->buf_ptr, bit_buf);
^
158. //printf("bitbuf = %08x\n", bit_buf);
159. s->buf_ptr+=4;
|
https://github.com/libav/libav/blob/a839d6abf870af82bdde8afdef40377eb31c82f8/libavcodec/aacenc.c/#L180
|
d2a_code_trace_data_43045
|
int BN_hex2bn(BIGNUM **bn, const char *a)
{
BIGNUM *ret = NULL;
BN_ULONG l = 0;
int neg = 0, h, m, i, j, k, c;
int num;
if ((a == NULL) || (*a == '\0'))
return (0);
if (*a == '-') {
neg = 1;
a++;
}
for (i = 0; isxdigit((unsigned char)a[i]); i++) ;
num = i + neg;
if (bn == NULL)
return (num);
if (*bn == NULL) {
if ((ret = BN_new()) == NULL)
return (0);
} else {
ret = *bn;
BN_zero(ret);
}
if (bn_expand(ret, i * 4) == NULL)
goto err;
j = i;
m = 0;
h = 0;
while (j > 0) {
m = ((BN_BYTES * 2) <= j) ? (BN_BYTES * 2) : j;
l = 0;
for (;;) {
c = a[j - m];
if ((c >= '0') && (c <= '9'))
k = c - '0';
else if ((c >= 'a') && (c <= 'f'))
k = c - 'a' + 10;
else if ((c >= 'A') && (c <= 'F'))
k = c - 'A' + 10;
else
k = 0;
l = (l << 4) | k;
if (--m <= 0) {
ret->d[h++] = l;
break;
}
}
j -= (BN_BYTES * 2);
}
ret->top = h;
bn_correct_top(ret);
ret->neg = neg;
*bn = ret;
bn_check_top(ret);
return (num);
err:
if (*bn == NULL)
BN_free(ret);
return (0);
}
crypto/bn/bntest.c:721: error: BUFFER_OVERRUN_L3
Offset: [-15, +oo] (⇐ [0, 1] + [-15, +oo]) Size: 65 by call to `BN_hex2bn`.
Showing all 7 steps of the trace
crypto/bn/bntest.c:721:5: Call
719.
720. /* Regression test for a BN_sqr overflow bug. */
721. BN_hex2bn(&a,
^
722. "80000000000000008000000000000001"
723. "FFFFFFFFFFFFFFFE0000000000000000");
crypto/bn/bn_print.c:187:10: <Offset trace>
185. }
186.
187. for (i = 0; isxdigit((unsigned char)a[i]); i++) ;
^
188.
189. num = i + neg;
crypto/bn/bn_print.c:187:10: Assignment
185. }
186.
187. for (i = 0; isxdigit((unsigned char)a[i]); i++) ;
^
188.
189. num = i + neg;
crypto/bn/bn_print.c:206:5: Assignment
204. goto err;
205.
206. j = i; /* least significant 'hex' */
^
207. m = 0;
208. h = 0;
crypto/bn/bn_print.c:172:1: <Length trace>
170. }
171.
172. > int BN_hex2bn(BIGNUM **bn, const char *a)
173. {
174. BIGNUM *ret = NULL;
crypto/bn/bn_print.c:172:1: Parameter `*a`
170. }
171.
172. > int BN_hex2bn(BIGNUM **bn, const char *a)
173. {
174. BIGNUM *ret = NULL;
crypto/bn/bn_print.c:213:17: Array access: Offset: [-15, +oo] (⇐ [0, 1] + [-15, +oo]) Size: 65 by call to `BN_hex2bn`
211. l = 0;
212. for (;;) {
213. c = a[j - m];
^
214. if ((c >= '0') && (c <= '9'))
215. k = c - '0';
|
https://github.com/openssl/openssl/blob/9c46f4b9cd4912b61cb546c48b678488d7f26ed6/crypto/bn/bn_print.c/#L213
|
d2a_code_trace_data_43046
|
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/s3_srvr.c:304: error: INTEGER_OVERFLOW_L2
([0, +oo] - 1):unsigned32 by call to `ssl3_get_client_hello`.
Showing all 17 steps of the trace
ssl/s3_srvr.c:186:1: Parameter `s->ctx->sessions->p`
184. ssl3_get_server_method)
185.
186. > int ssl3_accept(SSL *s)
187. {
188. BUF_MEM *buf;
ssl/s3_srvr.c:304:8: Call
302.
303. s->shutdown=0;
304. ret=ssl3_get_client_hello(s);
^
305. if (ret <= 0) goto end;
306.
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_43047
|
int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm)
{
SSL_COMP *comp;
if (cm == NULL || cm->type == NID_undef)
return 1;
if (id < 193 || id > 255)
{
SSLerr(SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD,SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE);
return 0;
}
MemCheck_off();
comp=(SSL_COMP *)OPENSSL_malloc(sizeof(SSL_COMP));
comp->id=id;
comp->method=cm;
load_builtin_compressions();
if (ssl_comp_methods
&& sk_SSL_COMP_find(ssl_comp_methods,comp) >= 0)
{
OPENSSL_free(comp);
MemCheck_on();
SSLerr(SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD,SSL_R_DUPLICATE_COMPRESSION_ID);
return(1);
}
else if ((ssl_comp_methods == NULL)
|| !sk_SSL_COMP_push(ssl_comp_methods,comp))
{
OPENSSL_free(comp);
MemCheck_on();
SSLerr(SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD,ERR_R_MALLOC_FAILURE);
return(1);
}
else
{
MemCheck_on();
return(0);
}
}
ssl/ssl_ciph.c:1860: error: NULL_DEREFERENCE
pointer `comp` last assigned on line 1859 could be null and is dereferenced at line 1860, column 2.
Showing all 44 steps of the trace
ssl/ssl_ciph.c:1839:1: start of procedure SSL_COMP_add_compression_method()
1837. }
1838.
1839. > int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm)
1840. {
1841. SSL_COMP *comp;
ssl/ssl_ciph.c:1843:13: Taking false branch
1841. SSL_COMP *comp;
1842.
1843. if (cm == NULL || cm->type == NID_undef)
^
1844. return 1;
1845.
ssl/ssl_ciph.c:1843:27: Taking false branch
1841. SSL_COMP *comp;
1842.
1843. if (cm == NULL || cm->type == NID_undef)
^
1844. return 1;
1845.
ssl/ssl_ciph.c:1852:6: Taking false branch
1850. 64 to 192: external party methods assigned by IANA
1851. 193 to 255: reserved for private use */
1852. if (id < 193 || id > 255)
^
1853. {
1854. SSLerr(SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD,SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE);
ssl/ssl_ciph.c:1852:18: Taking false branch
1850. 64 to 192: external party methods assigned by IANA
1851. 193 to 255: reserved for private use */
1852. if (id < 193 || id > 255)
^
1853. {
1854. SSLerr(SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD,SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE);
ssl/ssl_ciph.c:1858:2:
1856. }
1857.
1858. > MemCheck_off();
1859. comp=(SSL_COMP *)OPENSSL_malloc(sizeof(SSL_COMP));
1860. comp->id=id;
crypto/mem_dbg.c:216:1: start of procedure CRYPTO_mem_ctrl()
214. }
215.
216. > int CRYPTO_mem_ctrl(int mode)
217. {
218. int ret=mh_mode;
crypto/mem_dbg.c:218:2:
216. int CRYPTO_mem_ctrl(int mode)
217. {
218. > int ret=mh_mode;
219.
220. CRYPTO_w_lock(CRYPTO_LOCK_MALLOC);
crypto/mem_dbg.c:220:2:
218. int ret=mh_mode;
219.
220. > CRYPTO_w_lock(CRYPTO_LOCK_MALLOC);
221. switch (mode)
222. {
crypto/lock.c:426:1: start of procedure CRYPTO_lock()
424. }
425.
426. > void CRYPTO_lock(int mode, int type, const char *file, int line)
427. {
428. #ifdef LOCK_DEBUG
crypto/lock.c:453:6: Taking false branch
451. }
452. #endif
453. if (type < 0)
^
454. {
455. if (dynlock_lock_callback != NULL)
crypto/lock.c:468:7: Taking true branch
466. }
467. else
468. if (locking_callback != NULL)
^
469. locking_callback(mode,type,file,line);
470. }
crypto/lock.c:469:4: Skipping __function_pointer__(): unresolved function pointer
467. else
468. if (locking_callback != NULL)
469. locking_callback(mode,type,file,line);
^
470. }
471.
crypto/lock.c:453:2:
451. }
452. #endif
453. > if (type < 0)
454. {
455. if (dynlock_lock_callback != NULL)
crypto/lock.c:470:2: return from a call to CRYPTO_lock
468. if (locking_callback != NULL)
469. locking_callback(mode,type,file,line);
470. }
^
471.
472. int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,
crypto/mem_dbg.c:221:2:
219.
220. CRYPTO_w_lock(CRYPTO_LOCK_MALLOC);
221. > switch (mode)
222. {
223. /* for applications (not to be called while multiple threads
crypto/mem_dbg.c:225:2: Switch condition is false. Skipping switch case
223. /* for applications (not to be called while multiple threads
224. * use the library): */
225. case CRYPTO_MEM_CHECK_ON: /* aka MemCheck_start() */
^
226. mh_mode = CRYPTO_MEM_CHECK_ON|CRYPTO_MEM_CHECK_ENABLE;
227. num_disable = 0;
crypto/mem_dbg.c:229:2: Switch condition is false. Skipping switch case
227. num_disable = 0;
228. break;
229. case CRYPTO_MEM_CHECK_OFF: /* aka MemCheck_stop() */
^
230. mh_mode = 0;
231. num_disable = 0; /* should be true *before* MemCheck_stop is used,
crypto/mem_dbg.c:236:2: Switch condition is true. Entering switch case
234.
235. /* switch off temporarily (for library-internal use): */
236. case CRYPTO_MEM_CHECK_DISABLE: /* aka MemCheck_off() */
^
237. if (mh_mode & CRYPTO_MEM_CHECK_ON)
238. {
crypto/mem_dbg.c:237:7: Taking false branch
235. /* switch off temporarily (for library-internal use): */
236. case CRYPTO_MEM_CHECK_DISABLE: /* aka MemCheck_off() */
237. if (mh_mode & CRYPTO_MEM_CHECK_ON)
^
238. {
239. CRYPTO_THREADID cur;
crypto/mem_dbg.c:282:2:
280. break;
281. }
282. > CRYPTO_w_unlock(CRYPTO_LOCK_MALLOC);
283. return(ret);
284. }
crypto/lock.c:426:1: start of procedure CRYPTO_lock()
424. }
425.
426. > void CRYPTO_lock(int mode, int type, const char *file, int line)
427. {
428. #ifdef LOCK_DEBUG
crypto/lock.c:453:6: Taking false branch
451. }
452. #endif
453. if (type < 0)
^
454. {
455. if (dynlock_lock_callback != NULL)
crypto/lock.c:468:7: Taking true branch
466. }
467. else
468. if (locking_callback != NULL)
^
469. locking_callback(mode,type,file,line);
470. }
crypto/lock.c:469:4: Skipping __function_pointer__(): unresolved function pointer
467. else
468. if (locking_callback != NULL)
469. locking_callback(mode,type,file,line);
^
470. }
471.
crypto/lock.c:453:2:
451. }
452. #endif
453. > if (type < 0)
454. {
455. if (dynlock_lock_callback != NULL)
crypto/lock.c:470:2: return from a call to CRYPTO_lock
468. if (locking_callback != NULL)
469. locking_callback(mode,type,file,line);
470. }
^
471.
472. int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,
crypto/mem_dbg.c:283:2:
281. }
282. CRYPTO_w_unlock(CRYPTO_LOCK_MALLOC);
283. > return(ret);
284. }
285.
crypto/mem_dbg.c:284:2: return from a call to CRYPTO_mem_ctrl
282. CRYPTO_w_unlock(CRYPTO_LOCK_MALLOC);
283. return(ret);
284. }
^
285.
286. int CRYPTO_is_mem_check_on(void)
ssl/ssl_ciph.c:1859:2:
1857.
1858. MemCheck_off();
1859. > comp=(SSL_COMP *)OPENSSL_malloc(sizeof(SSL_COMP));
1860. comp->id=id;
1861. comp->method=cm;
crypto/mem.c:295:1: start of procedure CRYPTO_malloc()
293. }
294.
295. > void *CRYPTO_malloc(int num, const char *file, int line)
296. {
297. void *ret = NULL;
crypto/mem.c:297:2:
295. void *CRYPTO_malloc(int num, const char *file, int line)
296. {
297. > void *ret = NULL;
298.
299. if (num <= 0) return NULL;
crypto/mem.c:299:6: Taking false branch
297. void *ret = NULL;
298.
299. if (num <= 0) return NULL;
^
300.
301. allow_customize = 0;
crypto/mem.c:301:2:
299. if (num <= 0) return NULL;
300.
301. > allow_customize = 0;
302. if (malloc_debug_func != NULL)
303. {
crypto/mem.c:302:6: Taking true branch
300.
301. allow_customize = 0;
302. if (malloc_debug_func != NULL)
^
303. {
304. allow_customize_debug = 0;
crypto/mem.c:304:3:
302. if (malloc_debug_func != NULL)
303. {
304. > allow_customize_debug = 0;
305. malloc_debug_func(NULL, num, file, line, 0);
306. }
crypto/mem.c:305:3: Skipping __function_pointer__(): unresolved function pointer
303. {
304. allow_customize_debug = 0;
305. malloc_debug_func(NULL, num, file, line, 0);
^
306. }
307. ret = malloc_ex_func(num,file,line);
crypto/mem.c:307:2: Skipping __function_pointer__(): unresolved function pointer
305. malloc_debug_func(NULL, num, file, line, 0);
306. }
307. ret = malloc_ex_func(num,file,line);
^
308. #ifdef LEVITTE_DEBUG_MEM
309. fprintf(stderr, "LEVITTE_DEBUG_MEM: > 0x%p (%d)\n", ret, num);
crypto/mem.c:311:6: Taking true branch
309. fprintf(stderr, "LEVITTE_DEBUG_MEM: > 0x%p (%d)\n", ret, num);
310. #endif
311. if (malloc_debug_func != NULL)
^
312. malloc_debug_func(ret, num, file, line, 1);
313.
crypto/mem.c:312:3: Skipping __function_pointer__(): unresolved function pointer
310. #endif
311. if (malloc_debug_func != NULL)
312. malloc_debug_func(ret, num, file, line, 1);
^
313.
314. #ifndef OPENSSL_CPUID_OBJ
crypto/mem.c:318:12: Taking false branch
316. * sanitisation function can't be optimised out. NB: We only do
317. * this for >2Kb so the overhead doesn't bother us. */
318. if(ret && (num > 2048))
^
319. { extern unsigned char cleanse_ctr;
320. ((unsigned char *)ret)[0] = cleanse_ctr;
crypto/mem.c:324:2:
322. #endif
323.
324. > return ret;
325. }
326. char *CRYPTO_strdup(const char *str, const char *file, int line)
crypto/mem.c:325:2: return from a call to CRYPTO_malloc
323.
324. return ret;
325. }
^
326. char *CRYPTO_strdup(const char *str, const char *file, int line)
327. {
ssl/ssl_ciph.c:1860:2:
1858. MemCheck_off();
1859. comp=(SSL_COMP *)OPENSSL_malloc(sizeof(SSL_COMP));
1860. > comp->id=id;
1861. comp->method=cm;
1862. load_builtin_compressions();
|
https://github.com/openssl/openssl/blob/4f16215b9dd196b0c2b3f2c255d17439f572a2e7/ssl/ssl_ciph.c/#L1860
|
d2a_code_trace_data_43048
|
int test_div(BIO *bp, BN_CTX *ctx)
{
BIGNUM *a, *b, *c, *d, *e;
int i;
a = BN_new();
b = BN_new();
c = BN_new();
d = BN_new();
e = BN_new();
BN_one(a);
BN_zero(b);
if (BN_div(d, c, a, b, ctx)) {
fprintf(stderr, "Division by zero succeeded!\n");
return 0;
}
for (i = 0; i < num0 + num1; i++) {
if (i < num1) {
BN_bntest_rand(a, 400, 0, 0);
BN_copy(b, a);
BN_lshift(a, a, i);
BN_add_word(a, i);
} else
BN_bntest_rand(b, 50 + 3 * (i - num1), 0, 0);
a->neg = rand_neg();
b->neg = rand_neg();
BN_div(d, c, a, b, ctx);
if (bp != NULL) {
if (!results) {
BN_print(bp, a);
BIO_puts(bp, " / ");
BN_print(bp, b);
BIO_puts(bp, " - ");
}
BN_print(bp, d);
BIO_puts(bp, "\n");
if (!results) {
BN_print(bp, a);
BIO_puts(bp, " % ");
BN_print(bp, b);
BIO_puts(bp, " - ");
}
BN_print(bp, c);
BIO_puts(bp, "\n");
}
BN_mul(e, d, b, ctx);
BN_add(d, e, c);
BN_sub(d, d, a);
if (!BN_is_zero(d)) {
fprintf(stderr, "Division test failed!\n");
return 0;
}
}
BN_free(a);
BN_free(b);
BN_free(c);
BN_free(d);
BN_free(e);
return (1);
}
test/bntest.c:454: error: MEMORY_LEAK
memory dynamically allocated by call to `BN_new()` at line 444, column 9 is not reachable after line 454, column 17.
Showing all 133 steps of the trace
test/bntest.c:439:1: start of procedure test_div()
437. }
438.
439. > int test_div(BIO *bp, BN_CTX *ctx)
440. {
441. BIGNUM *a, *b, *c, *d, *e;
test/bntest.c:444:5:
442. int i;
443.
444. > a = BN_new();
445. b = BN_new();
446. c = BN_new();
crypto/bn/bn_lib.c:277:1: start of procedure BN_new()
275. }
276.
277. > BIGNUM *BN_new(void)
278. {
279. BIGNUM *ret;
crypto/bn/bn_lib.c:281:9:
279. BIGNUM *ret;
280.
281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
155. }
156.
157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:159:5:
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. > void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:161:9: Taking true branch
159. void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
^
162. memset(ret, 0, num);
163. return ret;
crypto/mem.c:162:9:
160.
161. if (ret != NULL)
162. > memset(ret, 0, num);
163. return ret;
164. }
crypto/mem.c:163:5:
161. if (ret != NULL)
162. memset(ret, 0, num);
163. > return ret;
164. }
165.
crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
162. memset(ret, 0, num);
163. return ret;
164. > }
165.
166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/bn/bn_lib.c:281:9: Taking false branch
279. BIGNUM *ret;
280.
281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
^
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/bn/bn_lib.c:285:5:
283. return (NULL);
284. }
285. > ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. return (ret);
crypto/bn/bn_lib.c:287:5:
285. ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. > return (ret);
288. }
289.
crypto/bn/bn_lib.c:288:1: return from a call to BN_new
286. bn_check_top(ret);
287. return (ret);
288. > }
289.
290. BIGNUM *BN_secure_new(void)
test/bntest.c:445:5:
443.
444. a = BN_new();
445. > b = BN_new();
446. c = BN_new();
447. d = BN_new();
crypto/bn/bn_lib.c:277:1: start of procedure BN_new()
275. }
276.
277. > BIGNUM *BN_new(void)
278. {
279. BIGNUM *ret;
crypto/bn/bn_lib.c:281:9:
279. BIGNUM *ret;
280.
281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
155. }
156.
157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:159:5:
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. > void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:161:9: Taking true branch
159. void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
^
162. memset(ret, 0, num);
163. return ret;
crypto/mem.c:162:9:
160.
161. if (ret != NULL)
162. > memset(ret, 0, num);
163. return ret;
164. }
crypto/mem.c:163:5:
161. if (ret != NULL)
162. memset(ret, 0, num);
163. > return ret;
164. }
165.
crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
162. memset(ret, 0, num);
163. return ret;
164. > }
165.
166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/bn/bn_lib.c:281:9: Taking false branch
279. BIGNUM *ret;
280.
281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
^
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/bn/bn_lib.c:285:5:
283. return (NULL);
284. }
285. > ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. return (ret);
crypto/bn/bn_lib.c:287:5:
285. ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. > return (ret);
288. }
289.
crypto/bn/bn_lib.c:288:1: return from a call to BN_new
286. bn_check_top(ret);
287. return (ret);
288. > }
289.
290. BIGNUM *BN_secure_new(void)
test/bntest.c:446:5:
444. a = BN_new();
445. b = BN_new();
446. > c = BN_new();
447. d = BN_new();
448. e = BN_new();
crypto/bn/bn_lib.c:277:1: start of procedure BN_new()
275. }
276.
277. > BIGNUM *BN_new(void)
278. {
279. BIGNUM *ret;
crypto/bn/bn_lib.c:281:9:
279. BIGNUM *ret;
280.
281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
155. }
156.
157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:159:5:
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. > void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:161:9: Taking true branch
159. void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
^
162. memset(ret, 0, num);
163. return ret;
crypto/mem.c:162:9:
160.
161. if (ret != NULL)
162. > memset(ret, 0, num);
163. return ret;
164. }
crypto/mem.c:163:5:
161. if (ret != NULL)
162. memset(ret, 0, num);
163. > return ret;
164. }
165.
crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
162. memset(ret, 0, num);
163. return ret;
164. > }
165.
166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/bn/bn_lib.c:281:9: Taking false branch
279. BIGNUM *ret;
280.
281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
^
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/bn/bn_lib.c:285:5:
283. return (NULL);
284. }
285. > ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. return (ret);
crypto/bn/bn_lib.c:287:5:
285. ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. > return (ret);
288. }
289.
crypto/bn/bn_lib.c:288:1: return from a call to BN_new
286. bn_check_top(ret);
287. return (ret);
288. > }
289.
290. BIGNUM *BN_secure_new(void)
test/bntest.c:447:5:
445. b = BN_new();
446. c = BN_new();
447. > d = BN_new();
448. e = BN_new();
449.
crypto/bn/bn_lib.c:277:1: start of procedure BN_new()
275. }
276.
277. > BIGNUM *BN_new(void)
278. {
279. BIGNUM *ret;
crypto/bn/bn_lib.c:281:9:
279. BIGNUM *ret;
280.
281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
155. }
156.
157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:159:5:
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. > void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:161:9: Taking true branch
159. void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
^
162. memset(ret, 0, num);
163. return ret;
crypto/mem.c:162:9:
160.
161. if (ret != NULL)
162. > memset(ret, 0, num);
163. return ret;
164. }
crypto/mem.c:163:5:
161. if (ret != NULL)
162. memset(ret, 0, num);
163. > return ret;
164. }
165.
crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
162. memset(ret, 0, num);
163. return ret;
164. > }
165.
166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/bn/bn_lib.c:281:9: Taking false branch
279. BIGNUM *ret;
280.
281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
^
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/bn/bn_lib.c:285:5:
283. return (NULL);
284. }
285. > ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. return (ret);
crypto/bn/bn_lib.c:287:5:
285. ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. > return (ret);
288. }
289.
crypto/bn/bn_lib.c:288:1: return from a call to BN_new
286. bn_check_top(ret);
287. return (ret);
288. > }
289.
290. BIGNUM *BN_secure_new(void)
test/bntest.c:448:5:
446. c = BN_new();
447. d = BN_new();
448. > e = BN_new();
449.
450. BN_one(a);
crypto/bn/bn_lib.c:277:1: start of procedure BN_new()
275. }
276.
277. > BIGNUM *BN_new(void)
278. {
279. BIGNUM *ret;
crypto/bn/bn_lib.c:281:9:
279. BIGNUM *ret;
280.
281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
155. }
156.
157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:159:5:
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. > void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:161:9: Taking true branch
159. void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
^
162. memset(ret, 0, num);
163. return ret;
crypto/mem.c:162:9:
160.
161. if (ret != NULL)
162. > memset(ret, 0, num);
163. return ret;
164. }
crypto/mem.c:163:5:
161. if (ret != NULL)
162. memset(ret, 0, num);
163. > return ret;
164. }
165.
crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
162. memset(ret, 0, num);
163. return ret;
164. > }
165.
166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/bn/bn_lib.c:281:9: Taking false branch
279. BIGNUM *ret;
280.
281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
^
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/bn/bn_lib.c:285:5:
283. return (NULL);
284. }
285. > ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. return (ret);
crypto/bn/bn_lib.c:287:5:
285. ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. > return (ret);
288. }
289.
crypto/bn/bn_lib.c:288:1: return from a call to BN_new
286. bn_check_top(ret);
287. return (ret);
288. > }
289.
290. BIGNUM *BN_secure_new(void)
test/bntest.c:450:5:
448. e = BN_new();
449.
450. > BN_one(a);
451. BN_zero(b);
452.
crypto/bn/bn_lib.c:530:1: start of procedure BN_set_word()
528. }
529.
530. > int BN_set_word(BIGNUM *a, BN_ULONG w)
531. {
532. bn_check_top(a);
crypto/bn/bn_lib.c:533:9: Condition is true
531. {
532. bn_check_top(a);
533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
^
534. return (0);
535. a->neg = 0;
crypto/bn/bn_lib.c:533:9: Taking false branch
531. {
532. bn_check_top(a);
533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
^
534. return (0);
535. a->neg = 0;
crypto/bn/bn_lib.c:535:5:
533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
534. return (0);
535. > a->neg = 0;
536. a->d[0] = w;
537. a->top = (w ? 1 : 0);
crypto/bn/bn_lib.c:536:5:
534. return (0);
535. a->neg = 0;
536. > a->d[0] = w;
537. a->top = (w ? 1 : 0);
538. bn_check_top(a);
crypto/bn/bn_lib.c:537:15: Condition is true
535. a->neg = 0;
536. a->d[0] = w;
537. a->top = (w ? 1 : 0);
^
538. bn_check_top(a);
539. return (1);
crypto/bn/bn_lib.c:537:5:
535. a->neg = 0;
536. a->d[0] = w;
537. > a->top = (w ? 1 : 0);
538. bn_check_top(a);
539. return (1);
crypto/bn/bn_lib.c:539:5:
537. a->top = (w ? 1 : 0);
538. bn_check_top(a);
539. > return (1);
540. }
541.
crypto/bn/bn_lib.c:540:1: return from a call to BN_set_word
538. bn_check_top(a);
539. return (1);
540. > }
541.
542. BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret)
test/bntest.c:451:5:
449.
450. BN_one(a);
451. > BN_zero(b);
452.
453. if (BN_div(d, c, a, b, ctx)) {
crypto/bn/bn_lib.c:530:1: start of procedure BN_set_word()
528. }
529.
530. > int BN_set_word(BIGNUM *a, BN_ULONG w)
531. {
532. bn_check_top(a);
crypto/bn/bn_lib.c:533:9: Condition is true
531. {
532. bn_check_top(a);
533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
^
534. return (0);
535. a->neg = 0;
crypto/bn/bn_lib.c:533:9: Taking false branch
531. {
532. bn_check_top(a);
533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
^
534. return (0);
535. a->neg = 0;
crypto/bn/bn_lib.c:535:5:
533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
534. return (0);
535. > a->neg = 0;
536. a->d[0] = w;
537. a->top = (w ? 1 : 0);
crypto/bn/bn_lib.c:536:5:
534. return (0);
535. a->neg = 0;
536. > a->d[0] = w;
537. a->top = (w ? 1 : 0);
538. bn_check_top(a);
crypto/bn/bn_lib.c:537:15: Condition is false
535. a->neg = 0;
536. a->d[0] = w;
537. a->top = (w ? 1 : 0);
^
538. bn_check_top(a);
539. return (1);
crypto/bn/bn_lib.c:537:5:
535. a->neg = 0;
536. a->d[0] = w;
537. > a->top = (w ? 1 : 0);
538. bn_check_top(a);
539. return (1);
crypto/bn/bn_lib.c:539:5:
537. a->top = (w ? 1 : 0);
538. bn_check_top(a);
539. > return (1);
540. }
541.
crypto/bn/bn_lib.c:540:1: return from a call to BN_set_word
538. bn_check_top(a);
539. return (1);
540. > }
541.
542. BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret)
test/bntest.c:453:9: Taking true branch
451. BN_zero(b);
452.
453. if (BN_div(d, c, a, b, ctx)) {
^
454. fprintf(stderr, "Division by zero succeeded!\n");
455. return 0;
test/bntest.c:454:9:
452.
453. if (BN_div(d, c, a, b, ctx)) {
454. > fprintf(stderr, "Division by zero succeeded!\n");
455. return 0;
456. }
|
https://github.com/openssl/openssl/blob/d9e309a675900030d7308e36f614962a344816f9/test/bntest.c/#L454
|
d2a_code_trace_data_43049
|
static int decode_tilehdr(WmallDecodeCtx *s)
{
uint16_t num_samples[WMALL_MAX_CHANNELS] = { 0 };
uint8_t contains_subframe[WMALL_MAX_CHANNELS];
int channels_for_cur_subframe = s->num_channels;
int fixed_channel_layout = 0;
int min_channel_len = 0;
int c, tile_aligned;
for (c = 0; c < s->num_channels; c++)
s->channel[c].num_subframes = 0;
tile_aligned = get_bits1(&s->gb);
if (s->max_num_subframes == 1 || tile_aligned)
fixed_channel_layout = 1;
do {
int subframe_len;
for (c = 0; c < s->num_channels; c++) {
if (num_samples[c] == min_channel_len) {
if (fixed_channel_layout || channels_for_cur_subframe == 1 ||
(min_channel_len == s->samples_per_frame - s->min_samples_per_subframe)) {
contains_subframe[c] = 1;
} else {
contains_subframe[c] = get_bits1(&s->gb);
}
} else
contains_subframe[c] = 0;
}
if ((subframe_len = decode_subframe_length(s, min_channel_len)) <= 0)
return AVERROR_INVALIDDATA;
min_channel_len += subframe_len;
for (c = 0; c < s->num_channels; c++) {
WmallChannelCtx *chan = &s->channel[c];
if (contains_subframe[c]) {
if (chan->num_subframes >= MAX_SUBFRAMES) {
av_log(s->avctx, AV_LOG_ERROR,
"broken frame: num subframes > 31\n");
return AVERROR_INVALIDDATA;
}
chan->subframe_len[chan->num_subframes] = subframe_len;
num_samples[c] += subframe_len;
++chan->num_subframes;
if (num_samples[c] > s->samples_per_frame) {
av_log(s->avctx, AV_LOG_ERROR, "broken frame: "
"channel len(%d) > samples_per_frame(%d)\n",
num_samples[c], s->samples_per_frame);
return AVERROR_INVALIDDATA;
}
} else if (num_samples[c] <= min_channel_len) {
if (num_samples[c] < min_channel_len) {
channels_for_cur_subframe = 0;
min_channel_len = num_samples[c];
}
++channels_for_cur_subframe;
}
}
} while (min_channel_len < s->samples_per_frame);
for (c = 0; c < s->num_channels; c++) {
int i, offset = 0;
for (i = 0; i < s->channel[c].num_subframes; i++) {
s->channel[c].subframe_offsets[i] = offset;
offset += s->channel[c].subframe_len[i];
}
}
return 0;
}
libavcodec/wmalosslessdec.c:356: error: Uninitialized Value
The value read from contains_subframe[_] was never initialized.
libavcodec/wmalosslessdec.c:356:17:
354. WmallChannelCtx *chan = &s->channel[c];
355.
356. if (contains_subframe[c]) {
^
357. if (chan->num_subframes >= MAX_SUBFRAMES) {
358. av_log(s->avctx, AV_LOG_ERROR,
|
https://github.com/libav/libav/blob/9c239f6026a170866a4a0c96908980ac2cfaa8b3/libavcodec/wmalosslessdec.c/#L356
|
d2a_code_trace_data_43050
|
IMPLEMENT_new_ctx(cfb, CFB, 192)
providers/common/ciphers/aes.c:307: error: NULL_DEREFERENCE
pointer `ctx` last assigned on line 307 could be null and is dereferenced at line 307, column 1.
Showing all 18 steps of the trace
providers/common/ciphers/aes.c:307:1: start of procedure aes_192_cfb_newctx()
305. IMPLEMENT_new_params(cfb8, CFB)
306. IMPLEMENT_new_ctx(cfb, CFB, 256)
307. > IMPLEMENT_new_ctx(cfb, CFB, 192)
308. IMPLEMENT_new_ctx(cfb, CFB, 128)
309. IMPLEMENT_new_ctx(cfb1, CFB, 256)
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:307:1:
305. IMPLEMENT_new_params(cfb8, CFB)
306. IMPLEMENT_new_ctx(cfb, CFB, 256)
307. > IMPLEMENT_new_ctx(cfb, CFB, 192)
308. IMPLEMENT_new_ctx(cfb, CFB, 128)
309. IMPLEMENT_new_ctx(cfb1, CFB, 256)
|
https://github.com/openssl/openssl/blob/f79858ac4d90a450d0620d1ecb713bc35d7d9f8d/providers/common/ciphers/aes.c/#L307
|
d2a_code_trace_data_43051
|
int dtls1_send_server_key_exchange(SSL *s)
{
#ifndef OPENSSL_NO_RSA
unsigned char *q;
int j,num;
RSA *rsa;
unsigned char md_buf[MD5_DIGEST_LENGTH+SHA_DIGEST_LENGTH];
unsigned int u;
#endif
#ifndef OPENSSL_NO_DH
DH *dh=NULL,*dhp;
#endif
#ifndef OPENSSL_NO_ECDH
EC_KEY *ecdh=NULL, *ecdhp;
unsigned char *encodedPoint = NULL;
int encodedlen = 0;
int curve_id = 0;
BN_CTX *bn_ctx = NULL;
#endif
EVP_PKEY *pkey;
unsigned char *p,*d;
int al,i;
unsigned long type;
int n;
CERT *cert;
BIGNUM *r[4];
int nr[4],kn;
BUF_MEM *buf;
EVP_MD_CTX md_ctx;
EVP_MD_CTX_init(&md_ctx);
if (s->state == SSL3_ST_SW_KEY_EXCH_A)
{
type=s->s3->tmp.new_cipher->algorithm_mkey;
cert=s->cert;
buf=s->init_buf;
r[0]=r[1]=r[2]=r[3]=NULL;
n=0;
#ifndef OPENSSL_NO_RSA
if (type & SSL_kRSA)
{
rsa=cert->rsa_tmp;
if ((rsa == NULL) && (s->cert->rsa_tmp_cb != NULL))
{
rsa=s->cert->rsa_tmp_cb(s,
SSL_C_IS_EXPORT(s->s3->tmp.new_cipher),
SSL_C_EXPORT_PKEYLENGTH(s->s3->tmp.new_cipher));
if(rsa == NULL)
{
al=SSL_AD_HANDSHAKE_FAILURE;
SSLerr(SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE,SSL_R_ERROR_GENERATING_TMP_RSA_KEY);
goto f_err;
}
RSA_up_ref(rsa);
cert->rsa_tmp=rsa;
}
if (rsa == NULL)
{
al=SSL_AD_HANDSHAKE_FAILURE;
SSLerr(SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE,SSL_R_MISSING_TMP_RSA_KEY);
goto f_err;
}
r[0]=rsa->n;
r[1]=rsa->e;
s->s3->tmp.use_rsa_tmp=1;
}
else
#endif
#ifndef OPENSSL_NO_DH
if (type & SSL_kEDH)
{
dhp=cert->dh_tmp;
if ((dhp == NULL) && (s->cert->dh_tmp_cb != NULL))
dhp=s->cert->dh_tmp_cb(s,
SSL_C_IS_EXPORT(s->s3->tmp.new_cipher),
SSL_C_EXPORT_PKEYLENGTH(s->s3->tmp.new_cipher));
if (dhp == NULL)
{
al=SSL_AD_HANDSHAKE_FAILURE;
SSLerr(SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE,SSL_R_MISSING_TMP_DH_KEY);
goto f_err;
}
if (s->s3->tmp.dh != NULL)
{
DH_free(dh);
SSLerr(SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE, ERR_R_INTERNAL_ERROR);
goto err;
}
if ((dh=DHparams_dup(dhp)) == NULL)
{
SSLerr(SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE,ERR_R_DH_LIB);
goto err;
}
s->s3->tmp.dh=dh;
if ((dhp->pub_key == NULL ||
dhp->priv_key == NULL ||
(s->options & SSL_OP_SINGLE_DH_USE)))
{
if(!DH_generate_key(dh))
{
SSLerr(SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE,
ERR_R_DH_LIB);
goto err;
}
}
else
{
dh->pub_key=BN_dup(dhp->pub_key);
dh->priv_key=BN_dup(dhp->priv_key);
if ((dh->pub_key == NULL) ||
(dh->priv_key == NULL))
{
SSLerr(SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE,ERR_R_DH_LIB);
goto err;
}
}
r[0]=dh->p;
r[1]=dh->g;
r[2]=dh->pub_key;
}
else
#endif
#ifndef OPENSSL_NO_ECDH
if (type & SSL_kEECDH)
{
const EC_GROUP *group;
ecdhp=cert->ecdh_tmp;
if ((ecdhp == NULL) && (s->cert->ecdh_tmp_cb != NULL))
{
ecdhp=s->cert->ecdh_tmp_cb(s,
SSL_C_IS_EXPORT(s->s3->tmp.new_cipher),
SSL_C_EXPORT_PKEYLENGTH(s->s3->tmp.new_cipher));
}
if (ecdhp == NULL)
{
al=SSL_AD_HANDSHAKE_FAILURE;
SSLerr(SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE,SSL_R_MISSING_TMP_ECDH_KEY);
goto f_err;
}
if (s->s3->tmp.ecdh != NULL)
{
EC_KEY_free(s->s3->tmp.ecdh);
SSLerr(SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE, ERR_R_INTERNAL_ERROR);
goto err;
}
if (ecdhp == NULL)
{
SSLerr(SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE,ERR_R_ECDH_LIB);
goto err;
}
if ((ecdh = EC_KEY_dup(ecdhp)) == NULL)
{
SSLerr(SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE,ERR_R_ECDH_LIB);
goto err;
}
s->s3->tmp.ecdh=ecdh;
if ((EC_KEY_get0_public_key(ecdh) == NULL) ||
(EC_KEY_get0_private_key(ecdh) == NULL) ||
(s->options & SSL_OP_SINGLE_ECDH_USE))
{
if(!EC_KEY_generate_key(ecdh))
{
SSLerr(SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE,ERR_R_ECDH_LIB);
goto err;
}
}
if (((group = EC_KEY_get0_group(ecdh)) == NULL) ||
(EC_KEY_get0_public_key(ecdh) == NULL) ||
(EC_KEY_get0_private_key(ecdh) == NULL))
{
SSLerr(SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE,ERR_R_ECDH_LIB);
goto err;
}
if (SSL_C_IS_EXPORT(s->s3->tmp.new_cipher) &&
(EC_GROUP_get_degree(group) > 163))
{
SSLerr(SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE,SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER);
goto err;
}
if ((curve_id =
tls1_ec_nid2curve_id(EC_GROUP_get_curve_name(group)))
== 0)
{
SSLerr(SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE,SSL_R_UNSUPPORTED_ELLIPTIC_CURVE);
goto err;
}
encodedlen = EC_POINT_point2oct(group,
EC_KEY_get0_public_key(ecdh),
POINT_CONVERSION_UNCOMPRESSED,
NULL, 0, NULL);
encodedPoint = (unsigned char *)
OPENSSL_malloc(encodedlen*sizeof(unsigned char));
bn_ctx = BN_CTX_new();
if ((encodedPoint == NULL) || (bn_ctx == NULL))
{
SSLerr(SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE,ERR_R_MALLOC_FAILURE);
goto err;
}
encodedlen = EC_POINT_point2oct(group,
EC_KEY_get0_public_key(ecdh),
POINT_CONVERSION_UNCOMPRESSED,
encodedPoint, encodedlen, bn_ctx);
if (encodedlen == 0)
{
SSLerr(SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE,ERR_R_ECDH_LIB);
goto err;
}
BN_CTX_free(bn_ctx); bn_ctx=NULL;
n = 4 + encodedlen;
r[0]=NULL;
r[1]=NULL;
r[2]=NULL;
r[3]=NULL;
}
else
#endif
#ifndef OPENSSL_NO_PSK
if (type & SSL_kPSK)
{
n+=2+strlen(s->ctx->psk_identity_hint);
}
else
#endif
{
al=SSL_AD_HANDSHAKE_FAILURE;
SSLerr(SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE,SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE);
goto f_err;
}
for (i=0; r[i] != NULL; i++)
{
nr[i]=BN_num_bytes(r[i]);
n+=2+nr[i];
}
if (!(s->s3->tmp.new_cipher->algorithm_auth & SSL_aNULL)
&& !(s->s3->tmp.new_cipher->algorithm_mkey & SSL_kPSK))
{
if ((pkey=ssl_get_sign_pkey(s,s->s3->tmp.new_cipher, NULL))
== NULL)
{
al=SSL_AD_DECODE_ERROR;
goto f_err;
}
kn=EVP_PKEY_size(pkey);
}
else
{
pkey=NULL;
kn=0;
}
if (!BUF_MEM_grow_clean(buf,n+DTLS1_HM_HEADER_LENGTH+kn))
{
SSLerr(SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE,ERR_LIB_BUF);
goto err;
}
d=(unsigned char *)s->init_buf->data;
p= &(d[DTLS1_HM_HEADER_LENGTH]);
for (i=0; r[i] != NULL; i++)
{
s2n(nr[i],p);
BN_bn2bin(r[i],p);
p+=nr[i];
}
#ifndef OPENSSL_NO_ECDH
if (type & SSL_kEECDH)
{
*p = NAMED_CURVE_TYPE;
p += 1;
*p = 0;
p += 1;
*p = curve_id;
p += 1;
*p = encodedlen;
p += 1;
memcpy((unsigned char*)p,
(unsigned char *)encodedPoint,
encodedlen);
OPENSSL_free(encodedPoint);
p += encodedlen;
}
#endif
#ifndef OPENSSL_NO_PSK
if (type & SSL_kPSK)
{
s2n(strlen(s->ctx->psk_identity_hint), p);
strncpy((char *)p, s->ctx->psk_identity_hint, strlen(s->ctx->psk_identity_hint));
p+=strlen(s->ctx->psk_identity_hint);
}
#endif
if (pkey != NULL)
{
#ifndef OPENSSL_NO_RSA
if (pkey->type == EVP_PKEY_RSA)
{
q=md_buf;
j=0;
for (num=2; num > 0; num--)
{
EVP_DigestInit_ex(&md_ctx,(num == 2)
?s->ctx->md5:s->ctx->sha1, NULL);
EVP_DigestUpdate(&md_ctx,&(s->s3->client_random[0]),SSL3_RANDOM_SIZE);
EVP_DigestUpdate(&md_ctx,&(s->s3->server_random[0]),SSL3_RANDOM_SIZE);
EVP_DigestUpdate(&md_ctx,&(d[DTLS1_HM_HEADER_LENGTH]),n);
EVP_DigestFinal_ex(&md_ctx,q,
(unsigned int *)&i);
q+=i;
j+=i;
}
if (RSA_sign(NID_md5_sha1, md_buf, j,
&(p[2]), &u, pkey->pkey.rsa) <= 0)
{
SSLerr(SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE,ERR_LIB_RSA);
goto err;
}
s2n(u,p);
n+=u+2;
}
else
#endif
#if !defined(OPENSSL_NO_DSA)
if (pkey->type == EVP_PKEY_DSA)
{
EVP_SignInit_ex(&md_ctx,EVP_dss1(), NULL);
EVP_SignUpdate(&md_ctx,&(s->s3->client_random[0]),SSL3_RANDOM_SIZE);
EVP_SignUpdate(&md_ctx,&(s->s3->server_random[0]),SSL3_RANDOM_SIZE);
EVP_SignUpdate(&md_ctx,&(d[DTLS1_HM_HEADER_LENGTH]),n);
if (!EVP_SignFinal(&md_ctx,&(p[2]),
(unsigned int *)&i,pkey))
{
SSLerr(SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE,ERR_LIB_DSA);
goto err;
}
s2n(i,p);
n+=i+2;
}
else
#endif
#if !defined(OPENSSL_NO_ECDSA)
if (pkey->type == EVP_PKEY_EC)
{
EVP_SignInit_ex(&md_ctx,EVP_ecdsa(), NULL);
EVP_SignUpdate(&md_ctx,&(s->s3->client_random[0]),SSL3_RANDOM_SIZE);
EVP_SignUpdate(&md_ctx,&(s->s3->server_random[0]),SSL3_RANDOM_SIZE);
EVP_SignUpdate(&md_ctx,&(d[4]),n);
if (!EVP_SignFinal(&md_ctx,&(p[2]),
(unsigned int *)&i,pkey))
{
SSLerr(SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE,ERR_LIB_ECDSA);
goto err;
}
s2n(i,p);
n+=i+2;
}
else
#endif
{
al=SSL_AD_HANDSHAKE_FAILURE;
SSLerr(SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE,SSL_R_UNKNOWN_PKEY_TYPE);
goto f_err;
}
}
d = dtls1_set_message_header(s, d,
SSL3_MT_SERVER_KEY_EXCHANGE, n, 0, n);
s->init_num=n+DTLS1_HM_HEADER_LENGTH;
s->init_off=0;
dtls1_buffer_message(s, 0);
}
s->state = SSL3_ST_SW_KEY_EXCH_B;
EVP_MD_CTX_cleanup(&md_ctx);
return(dtls1_do_write(s,SSL3_RT_HANDSHAKE));
f_err:
ssl3_send_alert(s,SSL3_AL_FATAL,al);
err:
#ifndef OPENSSL_NO_ECDH
if (encodedPoint != NULL) OPENSSL_free(encodedPoint);
BN_CTX_free(bn_ctx);
#endif
EVP_MD_CTX_cleanup(&md_ctx);
return(-1);
}
ssl/d1_srvr.c:959: error: NULL_DEREFERENCE
pointer `dh` last assigned on line 882 could be null and is dereferenced by call to `DH_free()` at line 959, column 5.
Showing all 27 steps of the trace
ssl/d1_srvr.c:872:1: start of procedure dtls1_send_server_key_exchange()
870. }
871.
872. > int dtls1_send_server_key_exchange(SSL *s)
873. {
874. #ifndef OPENSSL_NO_RSA
ssl/d1_srvr.c:882:2:
880. #endif
881. #ifndef OPENSSL_NO_DH
882. > DH *dh=NULL,*dhp;
883. #endif
884. #ifndef OPENSSL_NO_ECDH
ssl/d1_srvr.c:885:2:
883. #endif
884. #ifndef OPENSSL_NO_ECDH
885. > EC_KEY *ecdh=NULL, *ecdhp;
886. unsigned char *encodedPoint = NULL;
887. int encodedlen = 0;
ssl/d1_srvr.c:886:2:
884. #ifndef OPENSSL_NO_ECDH
885. EC_KEY *ecdh=NULL, *ecdhp;
886. > unsigned char *encodedPoint = NULL;
887. int encodedlen = 0;
888. int curve_id = 0;
ssl/d1_srvr.c:887:2:
885. EC_KEY *ecdh=NULL, *ecdhp;
886. unsigned char *encodedPoint = NULL;
887. > int encodedlen = 0;
888. int curve_id = 0;
889. BN_CTX *bn_ctx = NULL;
ssl/d1_srvr.c:888:2:
886. unsigned char *encodedPoint = NULL;
887. int encodedlen = 0;
888. > int curve_id = 0;
889. BN_CTX *bn_ctx = NULL;
890. #endif
ssl/d1_srvr.c:889:2:
887. int encodedlen = 0;
888. int curve_id = 0;
889. > BN_CTX *bn_ctx = NULL;
890. #endif
891. EVP_PKEY *pkey;
ssl/d1_srvr.c:902:2:
900. EVP_MD_CTX md_ctx;
901.
902. > EVP_MD_CTX_init(&md_ctx);
903. if (s->state == SSL3_ST_SW_KEY_EXCH_A)
904. {
crypto/evp/digest.c:120:1: start of procedure EVP_MD_CTX_init()
118. #endif
119.
120. > void EVP_MD_CTX_init(EVP_MD_CTX *ctx)
121. {
122. memset(ctx,'\0',sizeof *ctx);
crypto/evp/digest.c:122:2:
120. void EVP_MD_CTX_init(EVP_MD_CTX *ctx)
121. {
122. > memset(ctx,'\0',sizeof *ctx);
123. }
124.
crypto/evp/digest.c:123:2: return from a call to EVP_MD_CTX_init
121. {
122. memset(ctx,'\0',sizeof *ctx);
123. }
^
124.
125. EVP_MD_CTX *EVP_MD_CTX_create(void)
ssl/d1_srvr.c:903:6: Taking true branch
901.
902. EVP_MD_CTX_init(&md_ctx);
903. if (s->state == SSL3_ST_SW_KEY_EXCH_A)
^
904. {
905. type=s->s3->tmp.new_cipher->algorithm_mkey;
ssl/d1_srvr.c:905:3:
903. if (s->state == SSL3_ST_SW_KEY_EXCH_A)
904. {
905. > type=s->s3->tmp.new_cipher->algorithm_mkey;
906. cert=s->cert;
907.
ssl/d1_srvr.c:906:3:
904. {
905. type=s->s3->tmp.new_cipher->algorithm_mkey;
906. > cert=s->cert;
907.
908. buf=s->init_buf;
ssl/d1_srvr.c:908:3:
906. cert=s->cert;
907.
908. > buf=s->init_buf;
909.
910. r[0]=r[1]=r[2]=r[3]=NULL;
ssl/d1_srvr.c:910:3:
908. buf=s->init_buf;
909.
910. > r[0]=r[1]=r[2]=r[3]=NULL;
911. n=0;
912. #ifndef OPENSSL_NO_RSA
ssl/d1_srvr.c:911:3:
909.
910. r[0]=r[1]=r[2]=r[3]=NULL;
911. > n=0;
912. #ifndef OPENSSL_NO_RSA
913. if (type & SSL_kRSA)
ssl/d1_srvr.c:913:7: Taking false branch
911. n=0;
912. #ifndef OPENSSL_NO_RSA
913. if (type & SSL_kRSA)
^
914. {
915. rsa=cert->rsa_tmp;
ssl/d1_srvr.c:943:8: Taking true branch
941. #endif
942. #ifndef OPENSSL_NO_DH
943. if (type & SSL_kEDH)
^
944. {
945. dhp=cert->dh_tmp;
ssl/d1_srvr.c:945:4:
943. if (type & SSL_kEDH)
944. {
945. > dhp=cert->dh_tmp;
946. if ((dhp == NULL) && (s->cert->dh_tmp_cb != NULL))
947. dhp=s->cert->dh_tmp_cb(s,
ssl/d1_srvr.c:946:9: Taking true branch
944. {
945. dhp=cert->dh_tmp;
946. if ((dhp == NULL) && (s->cert->dh_tmp_cb != NULL))
^
947. dhp=s->cert->dh_tmp_cb(s,
948. SSL_C_IS_EXPORT(s->s3->tmp.new_cipher),
ssl/d1_srvr.c:946:26: Taking true branch
944. {
945. dhp=cert->dh_tmp;
946. if ((dhp == NULL) && (s->cert->dh_tmp_cb != NULL))
^
947. dhp=s->cert->dh_tmp_cb(s,
948. SSL_C_IS_EXPORT(s->s3->tmp.new_cipher),
ssl/d1_srvr.c:949:11: Condition is false
947. dhp=s->cert->dh_tmp_cb(s,
948. SSL_C_IS_EXPORT(s->s3->tmp.new_cipher),
949. SSL_C_EXPORT_PKEYLENGTH(s->s3->tmp.new_cipher));
^
950. if (dhp == NULL)
951. {
ssl/d1_srvr.c:947:5: Skipping __function_pointer__(): unresolved function pointer
945. dhp=cert->dh_tmp;
946. if ((dhp == NULL) && (s->cert->dh_tmp_cb != NULL))
947. dhp=s->cert->dh_tmp_cb(s,
^
948. SSL_C_IS_EXPORT(s->s3->tmp.new_cipher),
949. SSL_C_EXPORT_PKEYLENGTH(s->s3->tmp.new_cipher));
ssl/d1_srvr.c:950:8: Taking false branch
948. SSL_C_IS_EXPORT(s->s3->tmp.new_cipher),
949. SSL_C_EXPORT_PKEYLENGTH(s->s3->tmp.new_cipher));
950. if (dhp == NULL)
^
951. {
952. al=SSL_AD_HANDSHAKE_FAILURE;
ssl/d1_srvr.c:957:8: Taking true branch
955. }
956.
957. if (s->s3->tmp.dh != NULL)
^
958. {
959. DH_free(dh);
ssl/d1_srvr.c:959:5:
957. if (s->s3->tmp.dh != NULL)
958. {
959. > DH_free(dh);
960. SSLerr(SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE, ERR_R_INTERNAL_ERROR);
961. goto err;
|
https://github.com/openssl/openssl/blob/bbb19418e672007590c65a12aa24e1b59927b2cc/ssl/d1_srvr.c/#L959
|
d2a_code_trace_data_43052
|
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_clnt.c:2299: error: INTEGER_OVERFLOW_L2
([0, +oo] - [`pkt->written`, `pkt->written` + 1]):unsigned64 by call to `WPACKET_sub_memcpy__`.
Showing all 14 steps of the trace
ssl/statem/statem_clnt.c:2270:1: Parameter `pkt->written`
2268. }
2269.
2270. > static int tls_construct_cke_ecdhe(SSL *s, WPACKET *pkt, int *al)
2271. {
2272. #ifndef OPENSSL_NO_EC
ssl/statem/statem_clnt.c:2299:10: Call
2297. }
2298.
2299. if (!WPACKET_sub_memcpy_u8(pkt, encodedPoint, encoded_pt_len)) {
^
2300. SSLerr(SSL_F_TLS_CONSTRUCT_CKE_ECDHE, ERR_R_INTERNAL_ERROR);
2301. goto err;
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 + 1]):unsigned64 by call to `WPACKET_sub_memcpy__`
44. return 0;
45.
46. if (pkt->buf->length - pkt->written < len) {
^
47. size_t newlen;
48. size_t reflen;
|
https://github.com/openssl/openssl/blob/e4e1aa903e624044d3319622fc50222f1b2c7328/ssl/packet.c/#L46
|
d2a_code_trace_data_43053
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
test/bntest.c:1013: error: BUFFER_OVERRUN_L3
Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mul`.
Showing all 11 steps of the trace
test/bntest.c:1013:17: Call
1011. || !BN_add(ret, a, a)
1012. || !equalBN("A + A", lshift1, ret)
1013. || !BN_mul(ret, a, two, ctx)
^
1014. || !equalBN("A * 2", lshift1, ret)
1015. || !BN_div(ret, remainder, lshift1, two, ctx)
crypto/bn/bn_mul.c:854:5: Call
852. top = al + bl;
853.
854. BN_CTX_start(ctx);
^
855. if ((r == a) || (r == b)) {
856. if ((rr = BN_CTX_get(ctx)) == NULL)
crypto/bn/bn_ctx.c:181:1: Parameter `*ctx->stack.indexes`
179. }
180.
181. > void BN_CTX_start(BN_CTX *ctx)
182. {
183. CTXDBG_ENTRY("BN_CTX_start", ctx);
crypto/bn/bn_mul.c:979:5: Call
977. err:
978. bn_check_top(r);
979. BN_CTX_end(ctx);
^
980. return (ret);
981. }
crypto/bn/bn_ctx.c:195:1: Parameter `*ctx->stack.indexes`
193. }
194.
195. > void BN_CTX_end(BN_CTX *ctx)
196. {
197. CTXDBG_ENTRY("BN_CTX_end", ctx);
crypto/bn/bn_ctx.c:201:27: Call
199. ctx->err_stack--;
200. else {
201. unsigned int fp = BN_STACK_pop(&ctx->stack);
^
202. /* Does this stack frame have anything to release? */
203. if (fp < ctx->used)
crypto/bn/bn_ctx.c:271:1: <Offset trace>
269. }
270.
271. > static unsigned int BN_STACK_pop(BN_STACK *st)
272. {
273. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:271:1: Parameter `st->depth`
269. }
270.
271. > static unsigned int BN_STACK_pop(BN_STACK *st)
272. {
273. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:271:1: <Length trace>
269. }
270.
271. > static unsigned int BN_STACK_pop(BN_STACK *st)
272. {
273. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:271:1: Parameter `*st->indexes`
269. }
270.
271. > static unsigned int BN_STACK_pop(BN_STACK *st)
272. {
273. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:273:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mul`
271. static unsigned int BN_STACK_pop(BN_STACK *st)
272. {
273. return st->indexes[--(st->depth)];
^
274. }
275.
|
https://github.com/openssl/openssl/blob/0282aeb690d63fab73a07191b63300a2fe30d212/crypto/bn/bn_ctx.c/#L273
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.