id
stringlengths
25
25
content
stringlengths
649
72.1k
max_stars_repo_path
stringlengths
91
133
d2a_code_trace_data_45054
static void doall_util_fn(OPENSSL_LHASH *lh, int use_arg, OPENSSL_LH_DOALL_FUNC func, OPENSSL_LH_DOALL_FUNCARG func_arg, void *arg) { int i; OPENSSL_LH_NODE *a, *n; if (lh == NULL) return; for (i = lh->num_nodes - 1; i >= 0; i--) { a = lh->b[i]; while (a != NULL) { n = a->next; if (use_arg) func_arg(a->data, arg); else func(a->data); a = n; } } } test/sslapitest.c:2515: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `SSL_free`. Showing all 17 steps of the trace test/sslapitest.c:2487:10: Call 2485. } 2486. 2487. if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, ^ 2488. &clientssl, NULL, NULL))) 2489. goto end; test/ssltestlib.c:576:15: Call 574. if (*sssl != NULL) 575. serverssl = *sssl; 576. else if (!TEST_ptr(serverssl = SSL_new(serverctx))) ^ 577. goto error; 578. if (*cssl != NULL) ssl/ssl_lib.c:668:1: Parameter `ctx->sessions->num_nodes` 666. } 667. 668. > SSL *SSL_new(SSL_CTX *ctx) 669. { 670. SSL *s; test/sslapitest.c:2515:5: Call 2513. 2514. end: 2515. SSL_free(serverssl); ^ 2516. SSL_free(clientssl); 2517. SSL_CTX_free(sctx); ssl/ssl_lib.c:1124:1: Parameter `s->ctx->sessions->num_nodes` 1122. } 1123. 1124. > void SSL_free(SSL *s) 1125. { 1126. int i; ssl/ssl_lib.c:1196:5: Call 1194. RECORD_LAYER_release(&s->rlayer); 1195. 1196. SSL_CTX_free(s->ctx); ^ 1197. 1198. ASYNC_WAIT_CTX_free(s->waitctx); ssl/ssl_lib.c:3139:1: Parameter `a->sessions->num_nodes` 3137. } 3138. 3139. > void SSL_CTX_free(SSL_CTX *a) 3140. { 3141. int i; ssl/ssl_lib.c:3165:9: Call 3163. */ 3164. if (a->sessions != NULL) 3165. SSL_CTX_flush_sessions(a, 0); ^ 3166. 3167. CRYPTO_free_ex_data(CRYPTO_EX_INDEX_SSL_CTX, a, &a->ex_data); ssl/ssl_sess.c:1116:1: Parameter `s->sessions->num_nodes` 1114. IMPLEMENT_LHASH_DOALL_ARG(SSL_SESSION, TIMEOUT_PARAM); 1115. 1116. > void SSL_CTX_flush_sessions(SSL_CTX *s, long t) 1117. { 1118. unsigned long i; ssl/ssl_sess.c:1129:5: Call 1127. i = lh_SSL_SESSION_get_down_load(s->sessions); 1128. lh_SSL_SESSION_set_down_load(s->sessions, 0); 1129. lh_SSL_SESSION_doall_TIMEOUT_PARAM(tp.cache, timeout_cb, &tp); ^ 1130. lh_SSL_SESSION_set_down_load(s->sessions, i); 1131. CRYPTO_THREAD_unlock(s->lock); ssl/ssl_sess.c:1114:1: Parameter `lh->num_nodes` 1112. } 1113. 1114. > IMPLEMENT_LHASH_DOALL_ARG(SSL_SESSION, TIMEOUT_PARAM); 1115. 1116. void SSL_CTX_flush_sessions(SSL_CTX *s, long t) ssl/ssl_sess.c:1114:1: Call 1112. } 1113. 1114. > IMPLEMENT_LHASH_DOALL_ARG(SSL_SESSION, TIMEOUT_PARAM); 1115. 1116. void SSL_CTX_flush_sessions(SSL_CTX *s, long t) crypto/lhash/lhash.c:198:1: Parameter `lh->num_nodes` 196. } 197. 198. > void OPENSSL_LH_doall_arg(OPENSSL_LHASH *lh, OPENSSL_LH_DOALL_FUNCARG func, void *arg) 199. { 200. doall_util_fn(lh, 1, (OPENSSL_LH_DOALL_FUNC)0, func, arg); crypto/lhash/lhash.c:200:5: Call 198. void OPENSSL_LH_doall_arg(OPENSSL_LHASH *lh, OPENSSL_LH_DOALL_FUNCARG func, void *arg) 199. { 200. doall_util_fn(lh, 1, (OPENSSL_LH_DOALL_FUNC)0, func, arg); ^ 201. } 202. crypto/lhash/lhash.c:166:1: <LHS trace> 164. } 165. 166. > static void doall_util_fn(OPENSSL_LHASH *lh, int use_arg, 167. OPENSSL_LH_DOALL_FUNC func, 168. OPENSSL_LH_DOALL_FUNCARG func_arg, void *arg) crypto/lhash/lhash.c:166:1: Parameter `lh->num_nodes` 164. } 165. 166. > static void doall_util_fn(OPENSSL_LHASH *lh, int use_arg, 167. OPENSSL_LH_DOALL_FUNC func, 168. OPENSSL_LH_DOALL_FUNCARG func_arg, void *arg) crypto/lhash/lhash.c:180:10: Binary operation: ([0, +oo] - 1):unsigned32 by call to `SSL_free` 178. * memory leaks otherwise 179. */ 180. for (i = lh->num_nodes - 1; i >= 0; i--) { ^ 181. a = lh->b[i]; 182. while (a != NULL) {
https://github.com/openssl/openssl/blob/034cb87b6c7758986b40692d1d5abdd2a7ba826e/crypto/lhash/lhash.c/#L180
d2a_code_trace_data_45055
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:794: error: NULL_DEREFERENCE pointer `meth` last assigned on line 792 could be null and is dereferenced at line 794, column 9. Showing all 14 steps of the trace crypto/rand/rand_lib.c:790:1: start of procedure RAND_add() 788. } 789. 790. > void RAND_add(const void *buf, int num, double randomness) 791. { 792. const RAND_METHOD *meth = RAND_get_rand_method(); crypto/rand/rand_lib.c:792:5: 790. void RAND_add(const void *buf, int num, double randomness) 791. { 792. > const RAND_METHOD *meth = RAND_get_rand_method(); 793. 794. if (meth->add != NULL) crypto/rand/rand_lib.c:726:1: start of procedure RAND_get_rand_method() 724. } 725. 726. > const RAND_METHOD *RAND_get_rand_method(void) 727. { 728. const RAND_METHOD *tmp_meth = NULL; crypto/rand/rand_lib.c:728:5: 726. const RAND_METHOD *RAND_get_rand_method(void) 727. { 728. > const RAND_METHOD *tmp_meth = NULL; 729. 730. if (!RUN_ONCE(&rand_init, do_rand_init)) crypto/rand/rand_lib.c:730:10: 728. const RAND_METHOD *tmp_meth = NULL; 729. 730. > if (!RUN_ONCE(&rand_init, do_rand_init)) 731. return NULL; 732. crypto/threads_pthread.c:111:1: start of procedure CRYPTO_THREAD_run_once() 109. } 110. 111. > int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void)) 112. { 113. if (pthread_once(once, init) != 0) crypto/threads_pthread.c:113:9: Taking true branch 111. int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void)) 112. { 113. if (pthread_once(once, init) != 0) ^ 114. return 0; 115. crypto/threads_pthread.c:114:9: 112. { 113. if (pthread_once(once, init) != 0) 114. > return 0; 115. 116. return 1; crypto/threads_pthread.c:117:1: return from a call to CRYPTO_THREAD_run_once 115. 116. return 1; 117. > } 118. 119. int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *)) crypto/rand/rand_lib.c:730:10: Condition is false 728. const RAND_METHOD *tmp_meth = NULL; 729. 730. if (!RUN_ONCE(&rand_init, do_rand_init)) ^ 731. return NULL; 732. crypto/rand/rand_lib.c:730:10: Taking true branch 728. const RAND_METHOD *tmp_meth = NULL; 729. 730. if (!RUN_ONCE(&rand_init, do_rand_init)) ^ 731. return NULL; 732. crypto/rand/rand_lib.c:731:9: 729. 730. if (!RUN_ONCE(&rand_init, do_rand_init)) 731. > return NULL; 732. 733. CRYPTO_THREAD_write_lock(rand_meth_lock); crypto/rand/rand_lib.c:754:1: return from a call to RAND_get_rand_method 752. CRYPTO_THREAD_unlock(rand_meth_lock); 753. return tmp_meth; 754. > } 755. 756. #ifndef OPENSSL_NO_ENGINE crypto/rand/rand_lib.c:794:9: 792. const RAND_METHOD *meth = RAND_get_rand_method(); 793. 794. > if (meth->add != NULL) 795. meth->add(buf, num, randomness); 796. }
https://github.com/openssl/openssl/blob/9bba2c4c97a5fc5aea9e24223eebb85a15817e74/crypto/rand/rand_lib.c/#L794
d2a_code_trace_data_45056
static int early_select_server_ctx(SSL *s, void *arg, int ignore) { const char *servername; const unsigned char *p; size_t len, remaining; HANDSHAKE_EX_DATA *ex_data = (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx)); if (!SSL_early_get0_ext(s, TLSEXT_TYPE_server_name, &p, &remaining) || remaining <= 2) return 0; len = (*(p++) << 1); len += *(p++); if (len + 2 != remaining) return 0; remaining = len; if (remaining == 0 || *p++ != TLSEXT_NAMETYPE_host_name) return 0; remaining--; if (remaining <= 2) return 0; len = (*(p++) << 1); len += *(p++); if (len + 2 > remaining) return 0; remaining = len; servername = (const char *)p; if (len == strlen("server2") && strncmp(servername, "server2", len) == 0) { SSL_CTX *new_ctx = arg; SSL_set_SSL_CTX(s, new_ctx); SSL_clear_options(s, 0xFFFFFFFFL); SSL_set_options(s, SSL_CTX_get_options(new_ctx)); ex_data->servername = SSL_TEST_SERVERNAME_SERVER2; return 1; } else if (len == strlen("server1") && strncmp(servername, "server1", len) == 0) { ex_data->servername = SSL_TEST_SERVERNAME_SERVER1; return 1; } else if (ignore) { ex_data->servername = SSL_TEST_SERVERNAME_SERVER1; return 1; } return 0; } test/handshake_helper.c:191: error: NULL_DEREFERENCE pointer `ex_data` last assigned on line 147 could be null and is dereferenced at line 191, column 9. Showing all 69 steps of the trace test/handshake_helper.c:142:1: start of procedure early_select_server_ctx() 140. } 141. 142. > static int early_select_server_ctx(SSL *s, void *arg, int ignore) 143. { 144. const char *servername; test/handshake_helper.c:147:5: 145. const unsigned char *p; 146. size_t len, remaining; 147. > HANDSHAKE_EX_DATA *ex_data = 148. (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx)); 149. ssl/ssl_lib.c:3729:1: start of procedure SSL_get_ex_data() 3727. } 3728. 3729. > void *SSL_get_ex_data(const SSL *s, int idx) 3730. { 3731. return (CRYPTO_get_ex_data(&s->ex_data, idx)); ssl/ssl_lib.c:3731:5: 3729. void *SSL_get_ex_data(const SSL *s, int idx) 3730. { 3731. > return (CRYPTO_get_ex_data(&s->ex_data, idx)); 3732. } 3733. crypto/ex_data.c:387:1: start of procedure CRYPTO_get_ex_data() 385. * particular index in the class used by this variable 386. */ 387. > void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx) 388. { 389. if (ad->sk == NULL || idx >= sk_void_num(ad->sk)) crypto/ex_data.c:389:9: Taking true branch 387. void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx) 388. { 389. if (ad->sk == NULL || idx >= sk_void_num(ad->sk)) ^ 390. return NULL; 391. return sk_void_value(ad->sk, idx); crypto/ex_data.c:390:9: 388. { 389. if (ad->sk == NULL || idx >= sk_void_num(ad->sk)) 390. > return NULL; 391. return sk_void_value(ad->sk, idx); 392. } crypto/ex_data.c:392:1: return from a call to CRYPTO_get_ex_data 390. return NULL; 391. return sk_void_value(ad->sk, idx); 392. > } ssl/ssl_lib.c:3732:1: return from a call to SSL_get_ex_data 3730. { 3731. return (CRYPTO_get_ex_data(&s->ex_data, idx)); 3732. > } 3733. 3734. int SSL_CTX_set_ex_data(SSL_CTX *s, int idx, void *arg) test/handshake_helper.c:154:10: Taking false branch 152. * was written, so parsing the normal case is a bit complex. 153. */ 154. if (!SSL_early_get0_ext(s, TLSEXT_TYPE_server_name, &p, &remaining) || ^ 155. remaining <= 2) 156. return 0; test/handshake_helper.c:155:9: Taking false branch 153. */ 154. if (!SSL_early_get0_ext(s, TLSEXT_TYPE_server_name, &p, &remaining) || 155. remaining <= 2) ^ 156. return 0; 157. /* Extract the length of the supplied list of names. */ test/handshake_helper.c:158:5: 156. return 0; 157. /* Extract the length of the supplied list of names. */ 158. > len = (*(p++) << 1); 159. len += *(p++); 160. if (len + 2 != remaining) test/handshake_helper.c:159:5: 157. /* Extract the length of the supplied list of names. */ 158. len = (*(p++) << 1); 159. > len += *(p++); 160. if (len + 2 != remaining) 161. return 0; test/handshake_helper.c:160:9: Taking false branch 158. len = (*(p++) << 1); 159. len += *(p++); 160. if (len + 2 != remaining) ^ 161. return 0; 162. remaining = len; test/handshake_helper.c:162:5: 160. if (len + 2 != remaining) 161. return 0; 162. > remaining = len; 163. /* 164. * The list in practice only has a single element, so we only consider test/handshake_helper.c:167:9: Taking false branch 165. * the first one. 166. */ 167. if (remaining == 0 || *p++ != TLSEXT_NAMETYPE_host_name) ^ 168. return 0; 169. remaining--; test/handshake_helper.c:167:27: Taking false branch 165. * the first one. 166. */ 167. if (remaining == 0 || *p++ != TLSEXT_NAMETYPE_host_name) ^ 168. return 0; 169. remaining--; test/handshake_helper.c:169:5: 167. if (remaining == 0 || *p++ != TLSEXT_NAMETYPE_host_name) 168. return 0; 169. > remaining--; 170. /* Now we can finally pull out the byte array with the actual hostname. */ 171. if (remaining <= 2) test/handshake_helper.c:171:9: Taking false branch 169. remaining--; 170. /* Now we can finally pull out the byte array with the actual hostname. */ 171. if (remaining <= 2) ^ 172. return 0; 173. len = (*(p++) << 1); test/handshake_helper.c:173:5: 171. if (remaining <= 2) 172. return 0; 173. > len = (*(p++) << 1); 174. len += *(p++); 175. if (len + 2 > remaining) test/handshake_helper.c:174:5: 172. return 0; 173. len = (*(p++) << 1); 174. > len += *(p++); 175. if (len + 2 > remaining) 176. return 0; test/handshake_helper.c:175:9: Taking false branch 173. len = (*(p++) << 1); 174. len += *(p++); 175. if (len + 2 > remaining) ^ 176. return 0; 177. remaining = len; test/handshake_helper.c:177:5: 175. if (len + 2 > remaining) 176. return 0; 177. > remaining = len; 178. servername = (const char *)p; 179. test/handshake_helper.c:178:5: 176. return 0; 177. remaining = len; 178. > servername = (const char *)p; 179. 180. if (len == strlen("server2") && strncmp(servername, "server2", len) == 0) { test/handshake_helper.c:180:9: Taking true branch 178. servername = (const char *)p; 179. 180. if (len == strlen("server2") && strncmp(servername, "server2", len) == 0) { ^ 181. SSL_CTX *new_ctx = arg; 182. SSL_set_SSL_CTX(s, new_ctx); test/handshake_helper.c:180:37: Taking true branch 178. servername = (const char *)p; 179. 180. if (len == strlen("server2") && strncmp(servername, "server2", len) == 0) { ^ 181. SSL_CTX *new_ctx = arg; 182. SSL_set_SSL_CTX(s, new_ctx); test/handshake_helper.c:181:9: 179. 180. if (len == strlen("server2") && strncmp(servername, "server2", len) == 0) { 181. > SSL_CTX *new_ctx = arg; 182. SSL_set_SSL_CTX(s, new_ctx); 183. /* test/handshake_helper.c:182:9: 180. if (len == strlen("server2") && strncmp(servername, "server2", len) == 0) { 181. SSL_CTX *new_ctx = arg; 182. > SSL_set_SSL_CTX(s, new_ctx); 183. /* 184. * Copy over all the SSL_CTX options - reasonable behavior ssl/ssl_lib.c:3585:1: start of procedure SSL_set_SSL_CTX() 3583. } 3584. 3585. > SSL_CTX *SSL_set_SSL_CTX(SSL *ssl, SSL_CTX *ctx) 3586. { 3587. CERT *new_cert; ssl/ssl_lib.c:3588:9: Taking false branch 3586. { 3587. CERT *new_cert; 3588. if (ssl->ctx == ctx) ^ 3589. return ssl->ctx; 3590. if (ctx == NULL) ssl/ssl_lib.c:3590:9: Taking false branch 3588. if (ssl->ctx == ctx) 3589. return ssl->ctx; 3590. if (ctx == NULL) ^ 3591. ctx = ssl->session_ctx; 3592. new_cert = ssl_cert_dup(ctx->cert); ssl/ssl_lib.c:3592:5: Skipping ssl_cert_dup(): empty list of specs 3590. if (ctx == NULL) 3591. ctx = ssl->session_ctx; 3592. new_cert = ssl_cert_dup(ctx->cert); ^ 3593. if (new_cert == NULL) { 3594. return NULL; ssl/ssl_lib.c:3593:9: Taking false branch 3591. ctx = ssl->session_ctx; 3592. new_cert = ssl_cert_dup(ctx->cert); 3593. if (new_cert == NULL) { ^ 3594. return NULL; 3595. } ssl/ssl_lib.c:3596:5: 3594. return NULL; 3595. } 3596. > ssl_cert_free(ssl->cert); 3597. ssl->cert = new_cert; 3598. ssl/ssl_cert.c:231:1: start of procedure ssl_cert_free() 229. } 230. 231. > void ssl_cert_free(CERT *c) 232. { 233. int i; ssl/ssl_cert.c:235:9: Taking true branch 233. int i; 234. 235. if (c == NULL) ^ 236. return; 237. ssl/ssl_cert.c:236:9: 234. 235. if (c == NULL) 236. > return; 237. 238. CRYPTO_DOWN_REF(&c->references, &i, c->lock); ssl/ssl_cert.c:261:1: return from a call to ssl_cert_free 259. CRYPTO_THREAD_lock_free(c->lock); 260. OPENSSL_free(c); 261. > } 262. 263. int ssl_cert_set0_chain(SSL *s, SSL_CTX *ctx, STACK_OF(X509) *chain) ssl/ssl_lib.c:3597:5: 3595. } 3596. ssl_cert_free(ssl->cert); 3597. > ssl->cert = new_cert; 3598. 3599. /* ssl/ssl_lib.c:3603:5: Condition is true 3601. * so setter APIs must prevent invalid lengths from entering the system. 3602. */ 3603. OPENSSL_assert(ssl->sid_ctx_length <= sizeof(ssl->sid_ctx)); ^ 3604. 3605. /* ssl/ssl_lib.c:3611:10: Taking false branch 3609. * leave it unchanged. 3610. */ 3611. if ((ssl->ctx != NULL) && ^ 3612. (ssl->sid_ctx_length == ssl->ctx->sid_ctx_length) && 3613. (memcmp(ssl->sid_ctx, ssl->ctx->sid_ctx, ssl->sid_ctx_length) == 0)) { ssl/ssl_lib.c:3618:5: 3616. } 3617. 3618. > SSL_CTX_up_ref(ctx); 3619. SSL_CTX_free(ssl->ctx); /* decrement reference count */ 3620. ssl->ctx = ctx; ssl/ssl_lib.c:2768:1: start of procedure SSL_CTX_up_ref() 2766. } 2767. 2768. > int SSL_CTX_up_ref(SSL_CTX *ctx) 2769. { 2770. int i; ssl/ssl_lib.c:2772:9: 2770. int i; 2771. 2772. > if (CRYPTO_UP_REF(&ctx->references, &i, ctx->lock) <= 0) 2773. return 0; 2774. include/internal/refcount.h:25:1: start of procedure CRYPTO_UP_REF() 23. typedef _Atomic int CRYPTO_REF_COUNT; 24. 25. > static ossl_inline int CRYPTO_UP_REF(_Atomic int *val, int *ret, void *lock) 26. { 27. *ret = atomic_fetch_add_explicit(val, 1, memory_order_relaxed) + 1; include/internal/refcount.h:27:5: 25. static ossl_inline int CRYPTO_UP_REF(_Atomic int *val, int *ret, void *lock) 26. { 27. > *ret = atomic_fetch_add_explicit(val, 1, memory_order_relaxed) + 1; 28. return 1; 29. } include/internal/refcount.h:28:5: 26. { 27. *ret = atomic_fetch_add_explicit(val, 1, memory_order_relaxed) + 1; 28. > return 1; 29. } 30. include/internal/refcount.h:29:1: return from a call to CRYPTO_UP_REF 27. *ret = atomic_fetch_add_explicit(val, 1, memory_order_relaxed) + 1; 28. return 1; 29. > } 30. 31. static ossl_inline int CRYPTO_DOWN_REF(_Atomic int *val, int *ret, void *lock) ssl/ssl_lib.c:2772:9: Taking false branch 2770. int i; 2771. 2772. if (CRYPTO_UP_REF(&ctx->references, &i, ctx->lock) <= 0) ^ 2773. return 0; 2774. ssl/ssl_lib.c:2777:14: Condition is false 2775. REF_PRINT_COUNT("SSL_CTX", ctx); 2776. REF_ASSERT_ISNT(i < 2); 2777. return ((i > 1) ? 1 : 0); ^ 2778. } 2779. ssl/ssl_lib.c:2777:13: 2775. REF_PRINT_COUNT("SSL_CTX", ctx); 2776. REF_ASSERT_ISNT(i < 2); 2777. > return ((i > 1) ? 1 : 0); 2778. } 2779. ssl/ssl_lib.c:2777:5: 2775. REF_PRINT_COUNT("SSL_CTX", ctx); 2776. REF_ASSERT_ISNT(i < 2); 2777. > return ((i > 1) ? 1 : 0); 2778. } 2779. ssl/ssl_lib.c:2778:1: return from a call to SSL_CTX_up_ref 2776. REF_ASSERT_ISNT(i < 2); 2777. return ((i > 1) ? 1 : 0); 2778. > } 2779. 2780. void SSL_CTX_free(SSL_CTX *a) ssl/ssl_lib.c:3619:5: Skipping SSL_CTX_free(): empty list of specs 3617. 3618. SSL_CTX_up_ref(ctx); 3619. SSL_CTX_free(ssl->ctx); /* decrement reference count */ ^ 3620. ssl->ctx = ctx; 3621. ssl/ssl_lib.c:3620:5: 3618. SSL_CTX_up_ref(ctx); 3619. SSL_CTX_free(ssl->ctx); /* decrement reference count */ 3620. > ssl->ctx = ctx; 3621. 3622. return ssl->ctx; ssl/ssl_lib.c:3622:5: 3620. ssl->ctx = ctx; 3621. 3622. > return ssl->ctx; 3623. } 3624. ssl/ssl_lib.c:3623:1: return from a call to SSL_set_SSL_CTX 3621. 3622. return ssl->ctx; 3623. > } 3624. 3625. int SSL_CTX_set_default_verify_paths(SSL_CTX *ctx) test/handshake_helper.c:188:9: 186. * contexts differ/conflict 187. */ 188. > SSL_clear_options(s, 0xFFFFFFFFL); 189. SSL_set_options(s, SSL_CTX_get_options(new_ctx)); 190. ssl/ssl_lib.c:4067:1: start of procedure SSL_clear_options() 4065. } 4066. 4067. > unsigned long SSL_clear_options(SSL *s, unsigned long op) 4068. { 4069. return s->options &= ~op; ssl/ssl_lib.c:4069:5: 4067. unsigned long SSL_clear_options(SSL *s, unsigned long op) 4068. { 4069. > return s->options &= ~op; 4070. } 4071. ssl/ssl_lib.c:4070:1: return from a call to SSL_clear_options 4068. { 4069. return s->options &= ~op; 4070. > } 4071. 4072. STACK_OF(X509) *SSL_get0_verified_chain(const SSL *s) test/handshake_helper.c:189:9: 187. */ 188. SSL_clear_options(s, 0xFFFFFFFFL); 189. > SSL_set_options(s, SSL_CTX_get_options(new_ctx)); 190. 191. ex_data->servername = SSL_TEST_SERVERNAME_SERVER2; ssl/ssl_lib.c:4042:1: start of procedure SSL_CTX_get_options() 4040. * control interface. 4041. */ 4042. > unsigned long SSL_CTX_get_options(const SSL_CTX *ctx) 4043. { 4044. return ctx->options; ssl/ssl_lib.c:4044:5: 4042. unsigned long SSL_CTX_get_options(const SSL_CTX *ctx) 4043. { 4044. > return ctx->options; 4045. } 4046. ssl/ssl_lib.c:4045:1: return from a call to SSL_CTX_get_options 4043. { 4044. return ctx->options; 4045. > } 4046. 4047. unsigned long SSL_get_options(const SSL *s) ssl/ssl_lib.c:4057:1: start of procedure SSL_set_options() 4055. } 4056. 4057. > unsigned long SSL_set_options(SSL *s, unsigned long op) 4058. { 4059. return s->options |= op; ssl/ssl_lib.c:4059:5: 4057. unsigned long SSL_set_options(SSL *s, unsigned long op) 4058. { 4059. > return s->options |= op; 4060. } 4061. ssl/ssl_lib.c:4060:1: return from a call to SSL_set_options 4058. { 4059. return s->options |= op; 4060. > } 4061. 4062. unsigned long SSL_CTX_clear_options(SSL_CTX *ctx, unsigned long op) test/handshake_helper.c:191:9: 189. SSL_set_options(s, SSL_CTX_get_options(new_ctx)); 190. 191. > ex_data->servername = SSL_TEST_SERVERNAME_SERVER2; 192. return 1; 193. } else if (len == strlen("server1") &&
https://github.com/openssl/openssl/blob/0f5df0f1037590de12cc11eeab26fe29bf3f16a3/test/handshake_helper.c/#L191
d2a_code_trace_data_45057
static int inter_recon(AVCodecContext *avctx) { static const uint8_t bwlog_tab[2][N_BS_SIZES] = { { 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4 }, { 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4 }, }; VP9Context *s = avctx->priv_data; VP9Block *const b = &s->b; int row = b->row, col = b->col; AVFrame *ref1 = s->refs[s->refidx[b->ref[0]]]; AVFrame *ref2 = b->comp ? s->refs[s->refidx[b->ref[1]]] : NULL; int w = avctx->width, h = avctx->height; ptrdiff_t ls_y = b->y_stride, ls_uv = b->uv_stride; if (!ref1->data[0] || (b->comp && !ref2->data[0])) return AVERROR_INVALIDDATA; if (b->bs > BS_8x8) { if (b->bs == BS_8x4) { mc_luma_dir(s, s->dsp.mc[3][b->filter][0], b->dst[0], ls_y, ref1->data[0], ref1->linesize[0], row << 3, col << 3, &b->mv[0][0], 8, 4, w, h); mc_luma_dir(s, s->dsp.mc[3][b->filter][0], b->dst[0] + 4 * ls_y, ls_y, ref1->data[0], ref1->linesize[0], (row << 3) + 4, col << 3, &b->mv[2][0], 8, 4, w, h); if (b->comp) { mc_luma_dir(s, s->dsp.mc[3][b->filter][1], b->dst[0], ls_y, ref2->data[0], ref2->linesize[0], row << 3, col << 3, &b->mv[0][1], 8, 4, w, h); mc_luma_dir(s, s->dsp.mc[3][b->filter][1], b->dst[0] + 4 * ls_y, ls_y, ref2->data[0], ref2->linesize[0], (row << 3) + 4, col << 3, &b->mv[2][1], 8, 4, w, h); } } else if (b->bs == BS_4x8) { mc_luma_dir(s, s->dsp.mc[4][b->filter][0], b->dst[0], ls_y, ref1->data[0], ref1->linesize[0], row << 3, col << 3, &b->mv[0][0], 4, 8, w, h); mc_luma_dir(s, s->dsp.mc[4][b->filter][0], b->dst[0] + 4, ls_y, ref1->data[0], ref1->linesize[0], row << 3, (col << 3) + 4, &b->mv[1][0], 4, 8, w, h); if (b->comp) { mc_luma_dir(s, s->dsp.mc[4][b->filter][1], b->dst[0], ls_y, ref2->data[0], ref2->linesize[0], row << 3, col << 3, &b->mv[0][1], 4, 8, w, h); mc_luma_dir(s, s->dsp.mc[4][b->filter][1], b->dst[0] + 4, ls_y, ref2->data[0], ref2->linesize[0], row << 3, (col << 3) + 4, &b->mv[1][1], 4, 8, w, h); } } else { av_assert2(b->bs == BS_4x4); mc_luma_dir(s, s->dsp.mc[4][b->filter][0], b->dst[0], ls_y, ref1->data[0], ref1->linesize[0], row << 3, col << 3, &b->mv[0][0], 4, 4, w, h); mc_luma_dir(s, s->dsp.mc[4][b->filter][0], b->dst[0] + 4, ls_y, ref1->data[0], ref1->linesize[0], row << 3, (col << 3) + 4, &b->mv[1][0], 4, 4, w, h); mc_luma_dir(s, s->dsp.mc[4][b->filter][0], b->dst[0] + 4 * ls_y, ls_y, ref1->data[0], ref1->linesize[0], (row << 3) + 4, col << 3, &b->mv[2][0], 4, 4, w, h); mc_luma_dir(s, s->dsp.mc[4][b->filter][0], b->dst[0] + 4 * ls_y + 4, ls_y, ref1->data[0], ref1->linesize[0], (row << 3) + 4, (col << 3) + 4, &b->mv[3][0], 4, 4, w, h); if (b->comp) { mc_luma_dir(s, s->dsp.mc[4][b->filter][1], b->dst[0], ls_y, ref2->data[0], ref2->linesize[0], row << 3, col << 3, &b->mv[0][1], 4, 4, w, h); mc_luma_dir(s, s->dsp.mc[4][b->filter][1], b->dst[0] + 4, ls_y, ref2->data[0], ref2->linesize[0], row << 3, (col << 3) + 4, &b->mv[1][1], 4, 4, w, h); mc_luma_dir(s, s->dsp.mc[4][b->filter][1], b->dst[0] + 4 * ls_y, ls_y, ref2->data[0], ref2->linesize[0], (row << 3) + 4, col << 3, &b->mv[2][1], 4, 4, w, h); mc_luma_dir(s, s->dsp.mc[4][b->filter][1], b->dst[0] + 4 * ls_y + 4, ls_y, ref2->data[0], ref2->linesize[0], (row << 3) + 4, (col << 3) + 4, &b->mv[3][1], 4, 4, w, h); } } } else { int bwl = bwlog_tab[0][b->bs]; int bw = bwh_tab[0][b->bs][0] * 4; int bh = bwh_tab[0][b->bs][1] * 4; mc_luma_dir(s, s->dsp.mc[bwl][b->filter][0], b->dst[0], ls_y, ref1->data[0], ref1->linesize[0], row << 3, col << 3, &b->mv[0][0], bw, bh, w, h); if (b->comp) mc_luma_dir(s, s->dsp.mc[bwl][b->filter][1], b->dst[0], ls_y, ref2->data[0], ref2->linesize[0], row << 3, col << 3, &b->mv[0][1], bw, bh, w, h); } { int bwl = bwlog_tab[1][b->bs]; int bw = bwh_tab[1][b->bs][0] * 4, bh = bwh_tab[1][b->bs][1] * 4; VP56mv mvuv; w = (w + 1) >> 1; h = (h + 1) >> 1; if (b->bs > BS_8x8) { mvuv.x = ROUNDED_DIV(b->mv[0][0].x + b->mv[1][0].x + b->mv[2][0].x + b->mv[3][0].x, 4); mvuv.y = ROUNDED_DIV(b->mv[0][0].y + b->mv[1][0].y + b->mv[2][0].y + b->mv[3][0].y, 4); } else { mvuv = b->mv[0][0]; } mc_chroma_dir(s, s->dsp.mc[bwl][b->filter][0], b->dst[1], b->dst[2], ls_uv, ref1->data[1], ref1->linesize[1], ref1->data[2], ref1->linesize[2], row << 2, col << 2, &mvuv, bw, bh, w, h); if (b->comp) { if (b->bs > BS_8x8) { mvuv.x = ROUNDED_DIV(b->mv[0][1].x + b->mv[1][1].x + b->mv[2][1].x + b->mv[3][1].x, 4); mvuv.y = ROUNDED_DIV(b->mv[0][1].y + b->mv[1][1].y + b->mv[2][1].y + b->mv[3][1].y, 4); } else { mvuv = b->mv[0][1]; } mc_chroma_dir(s, s->dsp.mc[bwl][b->filter][1], b->dst[1], b->dst[2], ls_uv, ref2->data[1], ref2->linesize[1], ref2->data[2], ref2->linesize[2], row << 2, col << 2, &mvuv, bw, bh, w, h); } } if (!b->skip) { int w4 = bwh_tab[1][b->bs][0] << 1, step1d = 1 << b->tx, n; int h4 = bwh_tab[1][b->bs][1] << 1, x, y, step = 1 << (b->tx * 2); int end_x = FFMIN(2 * (s->cols - col), w4); int end_y = FFMIN(2 * (s->rows - row), h4); int tx = 4 * s->lossless + b->tx, uvtx = b->uvtx + 4 * s->lossless; int uvstep1d = 1 << b->uvtx, p; uint8_t *dst = b->dst[0]; for (n = 0, y = 0; y < end_y; y += step1d) { uint8_t *ptr = dst; for (x = 0; x < end_x; x += step1d, ptr += 4 * step1d, n += step) { int eob = b->tx > TX_8X8 ? AV_RN16A(&s->eob[n]) : s->eob[n]; if (eob) s->dsp.itxfm_add[tx][DCT_DCT](ptr, b->y_stride, s->block + 16 * n, eob); } dst += 4 * b->y_stride * step1d; } h4 >>= 1; w4 >>= 1; end_x >>= 1; end_y >>= 1; step = 1 << (b->uvtx * 2); for (p = 0; p < 2; p++) { dst = b->dst[p + 1]; for (n = 0, y = 0; y < end_y; y += uvstep1d) { uint8_t *ptr = dst; for (x = 0; x < end_x; x += uvstep1d, ptr += 4 * uvstep1d, n += step) { int eob = b->uvtx > TX_8X8 ? AV_RN16A(&s->uveob[p][n]) : s->uveob[p][n]; if (eob) s->dsp.itxfm_add[uvtx][DCT_DCT](ptr, b->uv_stride, s->uvblock[p] + 16 * n, eob); } dst += 4 * uvstep1d * b->uv_stride; } } } return 0; } libavcodec/vp9block.c:1293: error: Null Dereference pointer `ref2` last assigned on line 1228 could be null and is dereferenced at line 1293, column 29. libavcodec/vp9block.c:1218:1: start of procedure inter_recon() 1216. } 1217. 1218. static int inter_recon(AVCodecContext *avctx) ^ 1219. { 1220. static const uint8_t bwlog_tab[2][N_BS_SIZES] = { libavcodec/vp9block.c:1220:5: 1218. static int inter_recon(AVCodecContext *avctx) 1219. { 1220. static const uint8_t bwlog_tab[2][N_BS_SIZES] = { ^ 1221. { 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4 }, 1222. { 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4 }, libavcodec/vp9block.c:1224:5: 1222. { 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4 }, 1223. }; 1224. VP9Context *s = avctx->priv_data; ^ 1225. VP9Block *const b = &s->b; 1226. int row = b->row, col = b->col; libavcodec/vp9block.c:1225:5: 1223. }; 1224. VP9Context *s = avctx->priv_data; 1225. VP9Block *const b = &s->b; ^ 1226. int row = b->row, col = b->col; 1227. AVFrame *ref1 = s->refs[s->refidx[b->ref[0]]]; libavcodec/vp9block.c:1226:5: 1224. VP9Context *s = avctx->priv_data; 1225. VP9Block *const b = &s->b; 1226. int row = b->row, col = b->col; ^ 1227. AVFrame *ref1 = s->refs[s->refidx[b->ref[0]]]; 1228. AVFrame *ref2 = b->comp ? s->refs[s->refidx[b->ref[1]]] : NULL; libavcodec/vp9block.c:1227:5: 1225. VP9Block *const b = &s->b; 1226. int row = b->row, col = b->col; 1227. AVFrame *ref1 = s->refs[s->refidx[b->ref[0]]]; ^ 1228. AVFrame *ref2 = b->comp ? s->refs[s->refidx[b->ref[1]]] : NULL; 1229. int w = avctx->width, h = avctx->height; libavcodec/vp9block.c:1228:21: Condition is false 1226. int row = b->row, col = b->col; 1227. AVFrame *ref1 = s->refs[s->refidx[b->ref[0]]]; 1228. AVFrame *ref2 = b->comp ? s->refs[s->refidx[b->ref[1]]] : NULL; ^ 1229. int w = avctx->width, h = avctx->height; 1230. ptrdiff_t ls_y = b->y_stride, ls_uv = b->uv_stride; libavcodec/vp9block.c:1228:5: 1226. int row = b->row, col = b->col; 1227. AVFrame *ref1 = s->refs[s->refidx[b->ref[0]]]; 1228. AVFrame *ref2 = b->comp ? s->refs[s->refidx[b->ref[1]]] : NULL; ^ 1229. int w = avctx->width, h = avctx->height; 1230. ptrdiff_t ls_y = b->y_stride, ls_uv = b->uv_stride; libavcodec/vp9block.c:1229:5: 1227. AVFrame *ref1 = s->refs[s->refidx[b->ref[0]]]; 1228. AVFrame *ref2 = b->comp ? s->refs[s->refidx[b->ref[1]]] : NULL; 1229. int w = avctx->width, h = avctx->height; ^ 1230. ptrdiff_t ls_y = b->y_stride, ls_uv = b->uv_stride; 1231. libavcodec/vp9block.c:1230:5: 1228. AVFrame *ref2 = b->comp ? s->refs[s->refidx[b->ref[1]]] : NULL; 1229. int w = avctx->width, h = avctx->height; 1230. ptrdiff_t ls_y = b->y_stride, ls_uv = b->uv_stride; ^ 1231. 1232. if (!ref1->data[0] || (b->comp && !ref2->data[0])) libavcodec/vp9block.c:1232:10: Taking false branch 1230. ptrdiff_t ls_y = b->y_stride, ls_uv = b->uv_stride; 1231. 1232. if (!ref1->data[0] || (b->comp && !ref2->data[0])) ^ 1233. return AVERROR_INVALIDDATA; 1234. libavcodec/vp9block.c:1232:28: Taking false branch 1230. ptrdiff_t ls_y = b->y_stride, ls_uv = b->uv_stride; 1231. 1232. if (!ref1->data[0] || (b->comp && !ref2->data[0])) ^ 1233. return AVERROR_INVALIDDATA; 1234. libavcodec/vp9block.c:1236:9: Taking true branch 1234. 1235. // y inter pred 1236. if (b->bs > BS_8x8) { ^ 1237. if (b->bs == BS_8x4) { 1238. mc_luma_dir(s, s->dsp.mc[3][b->filter][0], b->dst[0], ls_y, libavcodec/vp9block.c:1237:13: Taking false branch 1235. // y inter pred 1236. if (b->bs > BS_8x8) { 1237. if (b->bs == BS_8x4) { ^ 1238. mc_luma_dir(s, s->dsp.mc[3][b->filter][0], b->dst[0], ls_y, 1239. ref1->data[0], ref1->linesize[0], libavcodec/vp9block.c:1255:20: Taking false branch 1253. (row << 3) + 4, col << 3, &b->mv[2][1], 8, 4, w, h); 1254. } 1255. } else if (b->bs == BS_4x8) { ^ 1256. mc_luma_dir(s, s->dsp.mc[4][b->filter][0], b->dst[0], ls_y, 1257. ref1->data[0], ref1->linesize[0], libavcodec/vp9block.c:1272:13: 1270. } 1271. } else { 1272. av_assert2(b->bs == BS_4x4); ^ 1273. 1274. // FIXME if two horizontally adjacent blocks have the same MV, libavcodec/vp9block.c:1276:13: Skipping mc_luma_dir(): empty list of specs 1274. // FIXME if two horizontally adjacent blocks have the same MV, 1275. // do a w8 instead of a w4 call 1276. mc_luma_dir(s, s->dsp.mc[4][b->filter][0], b->dst[0], ls_y, ^ 1277. ref1->data[0], ref1->linesize[0], 1278. row << 3, col << 3, &b->mv[0][0], 4, 4, w, h); libavcodec/vp9block.c:1279:13: Skipping mc_luma_dir(): empty list of specs 1277. ref1->data[0], ref1->linesize[0], 1278. row << 3, col << 3, &b->mv[0][0], 4, 4, w, h); 1279. mc_luma_dir(s, s->dsp.mc[4][b->filter][0], b->dst[0] + 4, ls_y, ^ 1280. ref1->data[0], ref1->linesize[0], 1281. row << 3, (col << 3) + 4, &b->mv[1][0], 4, 4, w, h); libavcodec/vp9block.c:1282:13: Skipping mc_luma_dir(): empty list of specs 1280. ref1->data[0], ref1->linesize[0], 1281. row << 3, (col << 3) + 4, &b->mv[1][0], 4, 4, w, h); 1282. mc_luma_dir(s, s->dsp.mc[4][b->filter][0], ^ 1283. b->dst[0] + 4 * ls_y, ls_y, 1284. ref1->data[0], ref1->linesize[0], libavcodec/vp9block.c:1286:13: Skipping mc_luma_dir(): empty list of specs 1284. ref1->data[0], ref1->linesize[0], 1285. (row << 3) + 4, col << 3, &b->mv[2][0], 4, 4, w, h); 1286. mc_luma_dir(s, s->dsp.mc[4][b->filter][0], ^ 1287. b->dst[0] + 4 * ls_y + 4, ls_y, 1288. ref1->data[0], ref1->linesize[0], libavcodec/vp9block.c:1291:17: Taking true branch 1289. (row << 3) + 4, (col << 3) + 4, &b->mv[3][0], 4, 4, w, h); 1290. 1291. if (b->comp) { ^ 1292. mc_luma_dir(s, s->dsp.mc[4][b->filter][1], b->dst[0], ls_y, 1293. ref2->data[0], ref2->linesize[0], libavcodec/vp9block.c:1292:17: 1290. 1291. if (b->comp) { 1292. mc_luma_dir(s, s->dsp.mc[4][b->filter][1], b->dst[0], ls_y, ^ 1293. ref2->data[0], ref2->linesize[0], 1294. row << 3, col << 3, &b->mv[0][1], 4, 4, w, h);
https://github.com/libav/libav/blob/16e7b189c548b4075ff4b5dd62af10e2acae260b/libavcodec/vp9block.c/#L1293
d2a_code_trace_data_45058
void avcodec_pix_fmt_string (char *buf, int buf_size, int pix_fmt) { PixFmtInfo info= pix_fmt_info[pix_fmt]; char is_alpha_char= info.is_alpha ? 'y' : 'n'; if (pix_fmt < 0) snprintf (buf, buf_size, "name " " nb_channels" " depth" " is_alpha" ); else snprintf (buf, buf_size, "%-10s" " %1d " " %2d " " %c ", info.name, info.nb_channels, info.depth, is_alpha_char ); } ffmpeg.c:2380: error: Buffer Overrun L3 Offset: [-1, 39] Size: 40 by call to `avcodec_pix_fmt_string`. ffmpeg.c:2379:10: Assignment 2377. int i; 2378. char pix_fmt_str[128]; 2379. for (i=-1; i < PIX_FMT_NB; i++) { ^ 2380. avcodec_pix_fmt_string (pix_fmt_str, sizeof(pix_fmt_str), i); 2381. fprintf(stdout, "%s\n", pix_fmt_str); ffmpeg.c:2380:9: Call 2378. char pix_fmt_str[128]; 2379. for (i=-1; i < PIX_FMT_NB; i++) { 2380. avcodec_pix_fmt_string (pix_fmt_str, sizeof(pix_fmt_str), i); ^ 2381. fprintf(stdout, "%s\n", pix_fmt_str); 2382. } libavcodec/imgconvert.c:408:1: <Offset trace> 406. } 407. 408. void avcodec_pix_fmt_string (char *buf, int buf_size, int pix_fmt) ^ 409. { 410. PixFmtInfo info= pix_fmt_info[pix_fmt]; libavcodec/imgconvert.c:408:1: Parameter `pix_fmt` 406. } 407. 408. void avcodec_pix_fmt_string (char *buf, int buf_size, int pix_fmt) ^ 409. { 410. PixFmtInfo info= pix_fmt_info[pix_fmt]; libavcodec/imgconvert.c:65:1: <Length trace> 63. 64. /* this table gives more information about formats */ 65. static const PixFmtInfo pix_fmt_info[PIX_FMT_NB] = { ^ 66. /* YUV formats */ 67. [PIX_FMT_YUV420P] = { libavcodec/imgconvert.c:65:1: Array declaration 63. 64. /* this table gives more information about formats */ 65. static const PixFmtInfo pix_fmt_info[PIX_FMT_NB] = { ^ 66. /* YUV formats */ 67. [PIX_FMT_YUV420P] = { libavcodec/imgconvert.c:410:22: Array access: Offset: [-1, 39] Size: 40 by call to `avcodec_pix_fmt_string` 408. void avcodec_pix_fmt_string (char *buf, int buf_size, int pix_fmt) 409. { 410. PixFmtInfo info= pix_fmt_info[pix_fmt]; ^ 411. 412. char is_alpha_char= info.is_alpha ? 'y' : 'n';
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/imgconvert.c/#L410
d2a_code_trace_data_45059
static enum AVPixelFormat get_format(AVCodecContext *s, const enum AVPixelFormat *pix_fmts) { InputStream *ist = s->opaque; const enum AVPixelFormat *p; int ret; for (p = pix_fmts; *p != -1; p++) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(*p); const HWAccel *hwaccel; if (!(desc->flags & AV_PIX_FMT_FLAG_HWACCEL)) break; hwaccel = get_hwaccel(*p); if (!hwaccel || (ist->active_hwaccel_id && ist->active_hwaccel_id != hwaccel->id) || (ist->hwaccel_id != HWACCEL_AUTO && ist->hwaccel_id != hwaccel->id)) continue; ret = hwaccel->init(s); if (ret < 0) { if (ist->hwaccel_id == hwaccel->id) { av_log(NULL, AV_LOG_FATAL, "%s hwaccel requested for input stream #%d:%d, " "but cannot be initialized.\n", hwaccel->name, ist->file_index, ist->st->index); return AV_PIX_FMT_NONE; } continue; } if (ist->hw_frames_ctx) { s->hw_frames_ctx = av_buffer_ref(ist->hw_frames_ctx); if (!s->hw_frames_ctx) return AV_PIX_FMT_NONE; } ist->active_hwaccel_id = hwaccel->id; ist->hwaccel_pix_fmt = *p; break; } return *p; } avconv.c:1599: error: Null Dereference pointer `desc` last assigned on line 1596 could be null and is dereferenced at line 1599, column 15. avconv.c:1589:1: start of procedure get_format() 1587. } 1588. 1589. static enum AVPixelFormat get_format(AVCodecContext *s, const enum AVPixelFormat *pix_fmts) ^ 1590. { 1591. InputStream *ist = s->opaque; avconv.c:1591:5: 1589. static enum AVPixelFormat get_format(AVCodecContext *s, const enum AVPixelFormat *pix_fmts) 1590. { 1591. InputStream *ist = s->opaque; ^ 1592. const enum AVPixelFormat *p; 1593. int ret; avconv.c:1595:10: 1593. int ret; 1594. 1595. for (p = pix_fmts; *p != -1; p++) { ^ 1596. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(*p); 1597. const HWAccel *hwaccel; avconv.c:1595:24: Loop condition is true. Entering loop body 1593. int ret; 1594. 1595. for (p = pix_fmts; *p != -1; p++) { ^ 1596. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(*p); 1597. const HWAccel *hwaccel; avconv.c:1596:9: 1594. 1595. for (p = pix_fmts; *p != -1; p++) { 1596. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(*p); ^ 1597. const HWAccel *hwaccel; 1598. libavutil/pixdesc.c:1744:1: start of procedure av_pix_fmt_desc_get() 1742. } 1743. 1744. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt) ^ 1745. { 1746. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) libavutil/pixdesc.c:1746:9: Taking false branch 1744. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt) 1745. { 1746. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) ^ 1747. return NULL; 1748. return &av_pix_fmt_descriptors[pix_fmt]; libavutil/pixdesc.c:1746:24: Taking true branch 1744. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt) 1745. { 1746. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) ^ 1747. return NULL; 1748. return &av_pix_fmt_descriptors[pix_fmt]; libavutil/pixdesc.c:1747:9: 1745. { 1746. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) 1747. return NULL; ^ 1748. return &av_pix_fmt_descriptors[pix_fmt]; 1749. } libavutil/pixdesc.c:1749:1: return from a call to av_pix_fmt_desc_get 1747. return NULL; 1748. return &av_pix_fmt_descriptors[pix_fmt]; 1749. } ^ 1750. 1751. const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev) avconv.c:1599:15: 1597. const HWAccel *hwaccel; 1598. 1599. if (!(desc->flags & AV_PIX_FMT_FLAG_HWACCEL)) ^ 1600. break; 1601.
https://github.com/libav/libav/blob/bd31c61cf94d01dbe1051cf65874e7b2c0ac5454/avconv.c/#L1599
d2a_code_trace_data_45060
int X509_verify_cert(X509_STORE_CTX *ctx) { X509 *x,*xtmp,*chain_ss=NULL; X509_NAME *xn; int bad_chain = 0; X509_VERIFY_PARAM *param = ctx->param; int depth,i,ok=0; int num; int (*cb)(int xok,X509_STORE_CTX *xctx); STACK_OF(X509) *sktmp=NULL; if (ctx->cert == NULL) { X509err(X509_F_X509_VERIFY_CERT,X509_R_NO_CERT_SET_FOR_US_TO_VERIFY); return -1; } cb=ctx->verify_cb; if (ctx->chain == NULL) { if ( ((ctx->chain=sk_X509_new_null()) == NULL) || (!sk_X509_push(ctx->chain,ctx->cert))) { X509err(X509_F_X509_VERIFY_CERT,ERR_R_MALLOC_FAILURE); goto end; } CRYPTO_add(&ctx->cert->references,1,CRYPTO_LOCK_X509); ctx->last_untrusted=1; } if (ctx->untrusted != NULL && (sktmp=sk_X509_dup(ctx->untrusted)) == NULL) { X509err(X509_F_X509_VERIFY_CERT,ERR_R_MALLOC_FAILURE); goto end; } num=sk_X509_num(ctx->chain); x=sk_X509_value(ctx->chain,num-1); depth=param->depth; for (;;) { if (depth < num) break; xn=X509_get_issuer_name(x); if (ctx->check_issued(ctx, x,x)) break; if (ctx->untrusted != NULL) { xtmp=find_issuer(ctx, sktmp,x); if (xtmp != NULL) { if (!sk_X509_push(ctx->chain,xtmp)) { X509err(X509_F_X509_VERIFY_CERT,ERR_R_MALLOC_FAILURE); goto end; } CRYPTO_add(&xtmp->references,1,CRYPTO_LOCK_X509); (void)sk_X509_delete_ptr(sktmp,xtmp); ctx->last_untrusted++; x=xtmp; num++; continue; } } break; } i=sk_X509_num(ctx->chain); x=sk_X509_value(ctx->chain,i-1); xn = X509_get_subject_name(x); if (ctx->check_issued(ctx, x, x)) { if (sk_X509_num(ctx->chain) == 1) { ok = ctx->get_issuer(&xtmp, ctx, x); if ((ok <= 0) || X509_cmp(x, xtmp)) { ctx->error=X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT; ctx->current_cert=x; ctx->error_depth=i-1; if (ok == 1) X509_free(xtmp); bad_chain = 1; ok=cb(0,ctx); if (!ok) goto end; } else { X509_free(x); x = xtmp; (void)sk_X509_set(ctx->chain, i - 1, x); ctx->last_untrusted=0; } } else { chain_ss=sk_X509_pop(ctx->chain); ctx->last_untrusted--; num--; x=sk_X509_value(ctx->chain,num-1); } } for (;;) { if (depth < num) break; xn=X509_get_issuer_name(x); if (ctx->check_issued(ctx,x,x)) break; ok = ctx->get_issuer(&xtmp, ctx, x); if (ok < 0) return ok; if (ok == 0) break; x = xtmp; if (!sk_X509_push(ctx->chain,x)) { X509_free(xtmp); X509err(X509_F_X509_VERIFY_CERT,ERR_R_MALLOC_FAILURE); return 0; } num++; } xn=X509_get_issuer_name(x); if (!ctx->check_issued(ctx,x,x)) { if ((chain_ss == NULL) || !ctx->check_issued(ctx, x, chain_ss)) { if (ctx->last_untrusted >= num) ctx->error=X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY; else ctx->error=X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT; ctx->current_cert=x; } else { sk_X509_push(ctx->chain,chain_ss); num++; ctx->last_untrusted=num; ctx->current_cert=chain_ss; ctx->error=X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN; chain_ss=NULL; } ctx->error_depth=num-1; bad_chain = 1; ok=cb(0,ctx); if (!ok) goto end; } ok = check_chain_extensions(ctx); if (!ok) goto end; ok = check_name_constraints(ctx); if (!ok) goto end; if (param->trust > 0) ok = check_trust(ctx); if (!ok) goto end; X509_get_pubkey_parameters(NULL,ctx->chain); ok = ctx->check_revocation(ctx); if(!ok) goto end; if (ctx->verify != NULL) ok=ctx->verify(ctx); else ok=internal_verify(ctx); if(!ok) goto end; #ifndef OPENSSL_NO_RFC3779 ok = v3_asid_validate_path(ctx); if (!ok) goto end; ok = v3_addr_validate_path(ctx); if (!ok) goto end; #endif if (!bad_chain && (ctx->param->flags & X509_V_FLAG_POLICY_CHECK)) ok = ctx->check_policy(ctx); if(!ok) goto end; if (0) { end: X509_get_pubkey_parameters(NULL,ctx->chain); } if (sktmp != NULL) sk_X509_free(sktmp); if (chain_ss != NULL) X509_free(chain_ss); return ok; } crypto/x509/x509_vfy.c:245: error: NULL_DEREFERENCE pointer `x` last assigned on line 244 could be null and is dereferenced by call to `X509_get_subject_name()` at line 245, column 7. Showing all 48 steps of the trace crypto/x509/x509_vfy.c:153:1: start of procedure X509_verify_cert() 151. #endif 152. 153. > int X509_verify_cert(X509_STORE_CTX *ctx) 154. { 155. X509 *x,*xtmp,*chain_ss=NULL; crypto/x509/x509_vfy.c:155:2: 153. int X509_verify_cert(X509_STORE_CTX *ctx) 154. { 155. > X509 *x,*xtmp,*chain_ss=NULL; 156. X509_NAME *xn; 157. int bad_chain = 0; crypto/x509/x509_vfy.c:157:2: 155. X509 *x,*xtmp,*chain_ss=NULL; 156. X509_NAME *xn; 157. > int bad_chain = 0; 158. X509_VERIFY_PARAM *param = ctx->param; 159. int depth,i,ok=0; crypto/x509/x509_vfy.c:158:2: 156. X509_NAME *xn; 157. int bad_chain = 0; 158. > X509_VERIFY_PARAM *param = ctx->param; 159. int depth,i,ok=0; 160. int num; crypto/x509/x509_vfy.c:159:2: 157. int bad_chain = 0; 158. X509_VERIFY_PARAM *param = ctx->param; 159. > int depth,i,ok=0; 160. int num; 161. int (*cb)(int xok,X509_STORE_CTX *xctx); crypto/x509/x509_vfy.c:162:2: 160. int num; 161. int (*cb)(int xok,X509_STORE_CTX *xctx); 162. > STACK_OF(X509) *sktmp=NULL; 163. if (ctx->cert == NULL) 164. { crypto/x509/x509_vfy.c:163:6: Taking false branch 161. int (*cb)(int xok,X509_STORE_CTX *xctx); 162. STACK_OF(X509) *sktmp=NULL; 163. if (ctx->cert == NULL) ^ 164. { 165. X509err(X509_F_X509_VERIFY_CERT,X509_R_NO_CERT_SET_FOR_US_TO_VERIFY); crypto/x509/x509_vfy.c:169:2: 167. } 168. 169. > cb=ctx->verify_cb; 170. 171. /* first we make sure the chain we are going to build is crypto/x509/x509_vfy.c:173:6: Taking false branch 171. /* first we make sure the chain we are going to build is 172. * present and that the first entry is in place */ 173. if (ctx->chain == NULL) ^ 174. { 175. if ( ((ctx->chain=sk_X509_new_null()) == NULL) || crypto/x509/x509_vfy.c:186:6: Taking false branch 184. 185. /* We use a temporary STACK so we can chop and hack at it */ 186. if (ctx->untrusted != NULL ^ 187. && (sktmp=sk_X509_dup(ctx->untrusted)) == NULL) 188. { crypto/x509/x509_vfy.c:193:6: Condition is true 191. } 192. 193. num=sk_X509_num(ctx->chain); ^ 194. x=sk_X509_value(ctx->chain,num-1); 195. depth=param->depth; crypto/x509/x509_vfy.c:193:2: 191. } 192. 193. > num=sk_X509_num(ctx->chain); 194. x=sk_X509_value(ctx->chain,num-1); 195. depth=param->depth; crypto/stack/stack.c:294:1: start of procedure sk_num() 292. } 293. 294. > int sk_num(const _STACK *st) 295. { 296. if(st == NULL) return -1; crypto/stack/stack.c:296:5: Taking false branch 294. int sk_num(const _STACK *st) 295. { 296. if(st == NULL) return -1; ^ 297. return st->num; 298. } crypto/stack/stack.c:297:2: 295. { 296. if(st == NULL) return -1; 297. > return st->num; 298. } 299. crypto/stack/stack.c:298:1: return from a call to sk_num 296. if(st == NULL) return -1; 297. return st->num; 298. > } 299. 300. void *sk_value(const _STACK *st, int i) crypto/x509/x509_vfy.c:194:4: Condition is true 192. 193. num=sk_X509_num(ctx->chain); 194. x=sk_X509_value(ctx->chain,num-1); ^ 195. depth=param->depth; 196. crypto/x509/x509_vfy.c:194:2: 192. 193. num=sk_X509_num(ctx->chain); 194. > x=sk_X509_value(ctx->chain,num-1); 195. depth=param->depth; 196. crypto/stack/stack.c:300:1: start of procedure sk_value() 298. } 299. 300. > void *sk_value(const _STACK *st, int i) 301. { 302. if(!st || (i < 0) || (i >= st->num)) return NULL; crypto/stack/stack.c:302:6: Taking false branch 300. void *sk_value(const _STACK *st, int i) 301. { 302. if(!st || (i < 0) || (i >= st->num)) return NULL; ^ 303. return st->data[i]; 304. } crypto/stack/stack.c:302:13: Taking false branch 300. void *sk_value(const _STACK *st, int i) 301. { 302. if(!st || (i < 0) || (i >= st->num)) return NULL; ^ 303. return st->data[i]; 304. } crypto/stack/stack.c:302:24: Taking false branch 300. void *sk_value(const _STACK *st, int i) 301. { 302. if(!st || (i < 0) || (i >= st->num)) return NULL; ^ 303. return st->data[i]; 304. } crypto/stack/stack.c:303:2: 301. { 302. if(!st || (i < 0) || (i >= st->num)) return NULL; 303. > return st->data[i]; 304. } 305. crypto/stack/stack.c:304:1: return from a call to sk_value 302. if(!st || (i < 0) || (i >= st->num)) return NULL; 303. return st->data[i]; 304. > } 305. 306. void *sk_set(_STACK *st, int i, void *value) crypto/x509/x509_vfy.c:195:2: 193. num=sk_X509_num(ctx->chain); 194. x=sk_X509_value(ctx->chain,num-1); 195. > depth=param->depth; 196. 197. crypto/x509/x509_vfy.c:233:3: Loop condition is true. Entering loop body 231. } 232. break; 233. } ^ 234. 235. /* at this point, chain should contain a list of untrusted crypto/x509/x509_vfy.c:201:7: Taking false branch 199. { 200. /* If we have enough, we break */ 201. if (depth < num) break; /* FIXME: If this happens, we should take ^ 202. * note of it and, if appropriate, use the 203. * X509_V_ERR_CERT_CHAIN_TOO_LONG error crypto/x509/x509_vfy.c:208:3: 206. 207. /* If we are self signed, we break */ 208. > xn=X509_get_issuer_name(x); 209. if (ctx->check_issued(ctx, x,x)) break; 210. crypto/x509/x509_cmp.c:131:1: start of procedure X509_get_issuer_name() 129. #endif 130. 131. > X509_NAME *X509_get_issuer_name(X509 *a) 132. { 133. return(a->cert_info->issuer); crypto/x509/x509_cmp.c:133:2: 131. X509_NAME *X509_get_issuer_name(X509 *a) 132. { 133. > return(a->cert_info->issuer); 134. } 135. crypto/x509/x509_cmp.c:134:2: return from a call to X509_get_issuer_name 132. { 133. return(a->cert_info->issuer); 134. } ^ 135. 136. unsigned long X509_issuer_name_hash(X509 *x) crypto/x509/x509_vfy.c:209:7: Taking true branch 207. /* If we are self signed, we break */ 208. xn=X509_get_issuer_name(x); 209. if (ctx->check_issued(ctx, x,x)) break; ^ 210. 211. /* If we were passed a cert chain, use it first */ crypto/x509/x509_vfy.c:243:4: Condition is true 241. */ 242. 243. i=sk_X509_num(ctx->chain); ^ 244. x=sk_X509_value(ctx->chain,i-1); 245. xn = X509_get_subject_name(x); crypto/x509/x509_vfy.c:243:2: 241. */ 242. 243. > i=sk_X509_num(ctx->chain); 244. x=sk_X509_value(ctx->chain,i-1); 245. xn = X509_get_subject_name(x); crypto/stack/stack.c:294:1: start of procedure sk_num() 292. } 293. 294. > int sk_num(const _STACK *st) 295. { 296. if(st == NULL) return -1; crypto/stack/stack.c:296:5: Taking false branch 294. int sk_num(const _STACK *st) 295. { 296. if(st == NULL) return -1; ^ 297. return st->num; 298. } crypto/stack/stack.c:297:2: 295. { 296. if(st == NULL) return -1; 297. > return st->num; 298. } 299. crypto/stack/stack.c:298:1: return from a call to sk_num 296. if(st == NULL) return -1; 297. return st->num; 298. > } 299. 300. void *sk_value(const _STACK *st, int i) crypto/x509/x509_vfy.c:244:4: Condition is true 242. 243. i=sk_X509_num(ctx->chain); 244. x=sk_X509_value(ctx->chain,i-1); ^ 245. xn = X509_get_subject_name(x); 246. if (ctx->check_issued(ctx, x, x)) crypto/x509/x509_vfy.c:244:2: 242. 243. i=sk_X509_num(ctx->chain); 244. > x=sk_X509_value(ctx->chain,i-1); 245. xn = X509_get_subject_name(x); 246. if (ctx->check_issued(ctx, x, x)) crypto/stack/stack.c:300:1: start of procedure sk_value() 298. } 299. 300. > void *sk_value(const _STACK *st, int i) 301. { 302. if(!st || (i < 0) || (i >= st->num)) return NULL; crypto/stack/stack.c:302:6: Taking false branch 300. void *sk_value(const _STACK *st, int i) 301. { 302. if(!st || (i < 0) || (i >= st->num)) return NULL; ^ 303. return st->data[i]; 304. } crypto/stack/stack.c:302:13: Taking true branch 300. void *sk_value(const _STACK *st, int i) 301. { 302. if(!st || (i < 0) || (i >= st->num)) return NULL; ^ 303. return st->data[i]; 304. } crypto/stack/stack.c:302:39: 300. void *sk_value(const _STACK *st, int i) 301. { 302. > if(!st || (i < 0) || (i >= st->num)) return NULL; 303. return st->data[i]; 304. } crypto/stack/stack.c:304:1: return from a call to sk_value 302. if(!st || (i < 0) || (i >= st->num)) return NULL; 303. return st->data[i]; 304. > } 305. 306. void *sk_set(_STACK *st, int i, void *value) crypto/x509/x509_vfy.c:245:2: 243. i=sk_X509_num(ctx->chain); 244. x=sk_X509_value(ctx->chain,i-1); 245. > xn = X509_get_subject_name(x); 246. if (ctx->check_issued(ctx, x, x)) 247. { crypto/x509/x509_cmp.c:148:1: start of procedure X509_get_subject_name() 146. #endif 147. 148. > X509_NAME *X509_get_subject_name(X509 *a) 149. { 150. return(a->cert_info->subject); crypto/x509/x509_cmp.c:150:2: 148. X509_NAME *X509_get_subject_name(X509 *a) 149. { 150. > return(a->cert_info->subject); 151. } 152.
https://github.com/openssl/openssl/blob/1b31b5ad560b16e2fe1cad54a755e3e6b5e778a3/crypto/x509/x509_vfy.c/#L245
d2a_code_trace_data_45061
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/bn/bn_exp.c:1294: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_mul`. Showing all 28 steps of the trace crypto/bn/bn_exp.c:1246:1: Parameter `ctx->stack.depth` 1244. 1245. /* The old fallback, simple version :-) */ 1246. > int BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, 1247. const BIGNUM *m, BN_CTX *ctx) 1248. { crypto/bn/bn_exp.c:1273:5: Call 1271. } 1272. 1273. BN_CTX_start(ctx); ^ 1274. d = BN_CTX_get(ctx); 1275. val[0] = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:181:1: Parameter `ctx->stack.depth` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_exp.c:1279:10: Call 1277. goto err; 1278. 1279. if (!BN_nnmod(val[0], a, m, ctx)) ^ 1280. goto err; /* 1 */ 1281. 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:140:1: Parameter `ctx->stack.depth` 138. * If 'dv' or 'rm' is NULL, the respective value is not returned. 139. */ 140. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 141. BN_CTX *ctx) 142. { crypto/bn/bn_exp.c:1289:14: Call 1287. window = BN_window_bits_for_exponent_size(bits); 1288. if (window > 1) { 1289. if (!BN_mod_mul(d, val[0], val[0], m, ctx)) ^ 1290. goto err; /* 2 */ 1291. j = 1 << (window - 1); crypto/bn/bn_mod.c:73:1: Parameter `ctx->stack.depth` 71. 72. /* slow but works */ 73. > int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, 74. BN_CTX *ctx) 75. { crypto/bn/bn_mod.c:83:5: Call 81. bn_check_top(m); 82. 83. BN_CTX_start(ctx); ^ 84. if ((t = BN_CTX_get(ctx)) == NULL) 85. goto err; crypto/bn/bn_ctx.c:181:1: Parameter `ctx->stack.depth` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_mod.c:98:5: Call 96. ret = 1; 97. err: 98. BN_CTX_end(ctx); ^ 99. return (ret); 100. } 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_exp.c:1294:18: Call 1292. for (i = 1; i < j; i++) { 1293. if (((val[i] = BN_CTX_get(ctx)) == NULL) || 1294. !BN_mod_mul(val[i], val[i - 1], d, m, ctx)) ^ 1295. goto err; 1296. } crypto/bn/bn_mod.c:73:1: Parameter `ctx->stack.depth` 71. 72. /* slow but works */ 73. > int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, 74. BN_CTX *ctx) 75. { crypto/bn/bn_mod.c:83:5: Call 81. bn_check_top(m); 82. 83. BN_CTX_start(ctx); ^ 84. if ((t = BN_CTX_get(ctx)) == NULL) 85. goto err; crypto/bn/bn_ctx.c:181:1: Parameter `ctx->stack.depth` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_mod.c:87:14: Call 85. goto err; 86. if (a == b) { 87. if (!BN_sqr(t, a, ctx)) ^ 88. goto err; 89. } else { crypto/bn/bn_sqr.c:32:5: Call 30. } 31. 32. BN_CTX_start(ctx); ^ 33. rr = (a != r) ? r : BN_CTX_get(ctx); 34. tmp = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:181:1: Parameter `*ctx->stack.indexes` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_sqr.c:100:5: Call 98. bn_check_top(rr); 99. bn_check_top(tmp); 100. BN_CTX_end(ctx); ^ 101. return (ret); 102. } crypto/bn/bn_ctx.c:195:1: Parameter `*ctx->stack.indexes` 193. } 194. 195. > void BN_CTX_end(BN_CTX *ctx) 196. { 197. CTXDBG_ENTRY("BN_CTX_end", ctx); crypto/bn/bn_ctx.c:201:27: Call 199. ctx->err_stack--; 200. else { 201. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 202. /* Does this stack frame have anything to release? */ 203. if (fp < ctx->used) crypto/bn/bn_ctx.c:271:1: <Offset trace> 269. } 270. 271. > static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:271:1: Parameter `st->depth` 269. } 270. 271. > static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:271:1: <Length trace> 269. } 270. 271. > static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:271:1: Parameter `*st->indexes` 269. } 270. 271. > static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:273:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_mul` 271. static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; ^ 274. } 275.
https://github.com/openssl/openssl/blob/d7c42d71ba407a4b3c26ed58263ae225976bbac3/crypto/bn/bn_ctx.c/#L273
d2a_code_trace_data_45062
void t2p_pdf_currenttime(T2P* t2p) { struct tm* currenttime; time_t timenow; if (time(&timenow) == (time_t) -1) { TIFFError(TIFF2PDF_MODULE, "Can't get the current time: %s", strerror(errno)); timenow = (time_t) 0; } currenttime = localtime(&timenow); snprintf(t2p->pdf_datetime, sizeof(t2p->pdf_datetime), "D:%.4d%.2d%.2d%.2d%.2d%.2d", (currenttime->tm_year + 1900) % 65536, (currenttime->tm_mon + 1) % 256, (currenttime->tm_mday) % 256, (currenttime->tm_hour) % 256, (currenttime->tm_min) % 256, (currenttime->tm_sec) % 256); return; } tools/tiff2pdf.c:3958: error: Null Dereference pointer `currenttime` last assigned on line 3955 could be null and is dereferenced at line 3958, column 5. tools/tiff2pdf.c:3944:1: start of procedure t2p_pdf_currenttime() 3942. */ 3943. 3944. void t2p_pdf_currenttime(T2P* t2p) ^ 3945. { 3946. struct tm* currenttime; tools/tiff2pdf.c:3949:6: Taking true branch 3947. time_t timenow; 3948. 3949. if (time(&timenow) == (time_t) -1) { ^ 3950. TIFFError(TIFF2PDF_MODULE, 3951. "Can't get the current time: %s", strerror(errno)); tools/tiff2pdf.c:3950:3: Skipping strerror(): method has no implementation 3948. 3949. if (time(&timenow) == (time_t) -1) { 3950. TIFFError(TIFF2PDF_MODULE, ^ 3951. "Can't get the current time: %s", strerror(errno)); 3952. timenow = (time_t) 0; libtiff/tif_error.c:50:1: start of procedure TIFFError() 48. } 49. 50. void ^ 51. TIFFError(const char* module, const char* fmt, ...) 52. { libtiff/tif_error.c:54:2: 52. { 53. va_list ap; 54. va_start(ap, fmt); ^ 55. if (_TIFFerrorHandler) 56. (*_TIFFerrorHandler)(module, fmt, ap); libtiff/tif_error.c:55:6: Taking true branch 53. va_list ap; 54. va_start(ap, fmt); 55. if (_TIFFerrorHandler) ^ 56. (*_TIFFerrorHandler)(module, fmt, ap); 57. if (_TIFFerrorHandlerExt) libtiff/tif_error.c:56:3: Skipping __function_pointer__(): unresolved function pointer 54. va_start(ap, fmt); 55. if (_TIFFerrorHandler) 56. (*_TIFFerrorHandler)(module, fmt, ap); ^ 57. if (_TIFFerrorHandlerExt) 58. (*_TIFFerrorHandlerExt)(0, module, fmt, ap); libtiff/tif_error.c:57:6: Taking true branch 55. if (_TIFFerrorHandler) 56. (*_TIFFerrorHandler)(module, fmt, ap); 57. if (_TIFFerrorHandlerExt) ^ 58. (*_TIFFerrorHandlerExt)(0, module, fmt, ap); 59. va_end(ap); libtiff/tif_error.c:58:3: Skipping __function_pointer__(): unresolved function pointer 56. (*_TIFFerrorHandler)(module, fmt, ap); 57. if (_TIFFerrorHandlerExt) 58. (*_TIFFerrorHandlerExt)(0, module, fmt, ap); ^ 59. va_end(ap); 60. } libtiff/tif_error.c:59:2: 57. if (_TIFFerrorHandlerExt) 58. (*_TIFFerrorHandlerExt)(0, module, fmt, ap); 59. va_end(ap); ^ 60. } 61. libtiff/tif_error.c:60:1: return from a call to TIFFError 58. (*_TIFFerrorHandlerExt)(0, module, fmt, ap); 59. va_end(ap); 60. } ^ 61. 62. void tools/tiff2pdf.c:3952:3: 3950. TIFFError(TIFF2PDF_MODULE, 3951. "Can't get the current time: %s", strerror(errno)); 3952. timenow = (time_t) 0; ^ 3953. } 3954. tools/tiff2pdf.c:3955:2: 3953. } 3954. 3955. currenttime = localtime(&timenow); ^ 3956. snprintf(t2p->pdf_datetime, sizeof(t2p->pdf_datetime), 3957. "D:%.4d%.2d%.2d%.2d%.2d%.2d", tools/tiff2pdf.c:3956:2: 3954. 3955. currenttime = localtime(&timenow); 3956. snprintf(t2p->pdf_datetime, sizeof(t2p->pdf_datetime), ^ 3957. "D:%.4d%.2d%.2d%.2d%.2d%.2d", 3958. (currenttime->tm_year + 1900) % 65536,
https://gitlab.com/libtiff/libtiff/blob/b69a1998bedfabc32cd541408bffdef05bd01e45/tools/tiff2pdf.c/#L3958
d2a_code_trace_data_45063
int ssl3_cbc_copy_mac(unsigned char *out, const SSL3_RECORD *rec, size_t md_size) { #if defined(CBC_MAC_ROTATE_IN_PLACE) unsigned char rotated_mac_buf[64 + EVP_MAX_MD_SIZE]; unsigned char *rotated_mac; #else unsigned char rotated_mac[EVP_MAX_MD_SIZE]; #endif size_t mac_end = rec->length; size_t mac_start = mac_end - md_size; size_t in_mac; size_t scan_start = 0; size_t i, j; size_t rotate_offset; if (!ossl_assert(rec->orig_len >= md_size && md_size <= EVP_MAX_MD_SIZE)) return 0; #if defined(CBC_MAC_ROTATE_IN_PLACE) rotated_mac = rotated_mac_buf + ((0 - (size_t)rotated_mac_buf) & 63); #endif if (rec->orig_len > md_size + 255 + 1) scan_start = rec->orig_len - (md_size + 255 + 1); in_mac = 0; rotate_offset = 0; memset(rotated_mac, 0, md_size); for (i = scan_start, j = 0; i < rec->orig_len; i++) { size_t mac_started = constant_time_eq_s(i, mac_start); size_t mac_ended = constant_time_lt_s(i, mac_end); unsigned char b = rec->data[i]; in_mac |= mac_started; in_mac &= mac_ended; rotate_offset |= j & mac_started; rotated_mac[j++] |= b & in_mac; j &= constant_time_lt_s(j, md_size); } #if defined(CBC_MAC_ROTATE_IN_PLACE) j = 0; for (i = 0; i < md_size; i++) { ((volatile unsigned char *)rotated_mac)[rotate_offset ^ 32]; out[j++] = rotated_mac[rotate_offset++]; rotate_offset &= constant_time_lt_s(rotate_offset, md_size); } #else memset(out, 0, md_size); rotate_offset = md_size - rotate_offset; rotate_offset &= constant_time_lt_s(rotate_offset, md_size); for (i = 0; i < md_size; i++) { for (j = 0; j < md_size; j++) out[j] |= rotated_mac[i] & constant_time_eq_8_s(j, rotate_offset); rotate_offset++; rotate_offset &= constant_time_lt_s(rotate_offset, md_size); } #endif return 1; } ssl/record/rec_layer_d1.c:279: error: INTEGER_OVERFLOW_L2 ([0, 17728] - [256, 320]):unsigned64 by call to `dtls1_process_record`. Showing all 10 steps of the trace ssl/record/rec_layer_d1.c:222:1: Parameter `s->rlayer.rrec.length` 220. &((s)->rlayer.d->unprocessed_rcds)) 221. 222. > int dtls1_process_buffered_records(SSL *s) 223. { 224. pitem *item; ssl/record/rec_layer_d1.c:279:31: Call 277. } 278. 279. if (!replayok || !dtls1_process_record(s, bitmap)) { ^ 280. /* dump this record */ 281. rr->length = 0; ssl/record/ssl3_record.c:1495:1: Parameter `s->rlayer.rrec.length` 1493. } 1494. 1495. > int dtls1_process_record(SSL *s, DTLS1_BITMAP *bitmap) 1496. { 1497. int i, al; ssl/record/ssl3_record.c:1535:5: Assignment 1533. /* decrypt in place in 'rr->input' */ 1534. rr->data = rr->input; 1535. rr->orig_len = rr->length; ^ 1536. 1537. if (SSL_READ_ETM(s) && s->read_hash) { ssl/record/ssl3_record.c:1628:18: Call 1626. */ 1627. mac = mac_tmp; 1628. if (!ssl3_cbc_copy_mac(mac_tmp, rr, mac_size)) { ^ 1629. al = SSL_AD_INTERNAL_ERROR; 1630. SSLerr(SSL_F_DTLS1_PROCESS_RECORD, ERR_R_INTERNAL_ERROR); ssl/record/ssl3_record.c:1420:1: <LHS trace> 1418. #define CBC_MAC_ROTATE_IN_PLACE 1419. 1420. > int ssl3_cbc_copy_mac(unsigned char *out, 1421. const SSL3_RECORD *rec, size_t md_size) 1422. { ssl/record/ssl3_record.c:1420:1: Parameter `md_size` 1418. #define CBC_MAC_ROTATE_IN_PLACE 1419. 1420. > int ssl3_cbc_copy_mac(unsigned char *out, 1421. const SSL3_RECORD *rec, size_t md_size) 1422. { ssl/record/ssl3_record.c:1420:1: <RHS trace> 1418. #define CBC_MAC_ROTATE_IN_PLACE 1419. 1420. > int ssl3_cbc_copy_mac(unsigned char *out, 1421. const SSL3_RECORD *rec, size_t md_size) 1422. { ssl/record/ssl3_record.c:1420:1: Parameter `md_size` 1418. #define CBC_MAC_ROTATE_IN_PLACE 1419. 1420. > int ssl3_cbc_copy_mac(unsigned char *out, 1421. const SSL3_RECORD *rec, size_t md_size) 1422. { ssl/record/ssl3_record.c:1454:9: Binary operation: ([0, 17728] - [256, 320]):unsigned64 by call to `dtls1_process_record` 1452. /* This information is public so it's safe to branch based on it. */ 1453. if (rec->orig_len > md_size + 255 + 1) 1454. scan_start = rec->orig_len - (md_size + 255 + 1); ^ 1455. 1456. in_mac = 0;
https://github.com/openssl/openssl/blob/7f7eb90b8ac55997c5c825bb3ebcfe28611e06f5/ssl/record/ssl3_record.c/#L1454
d2a_code_trace_data_45064
void bn_mul_normal(BN_ULONG *r, BN_ULONG *a, int na, BN_ULONG *b, int nb) { BN_ULONG *rr; if (na < nb) { int itmp; BN_ULONG *ltmp; itmp = na; na = nb; nb = itmp; ltmp = a; a = b; b = ltmp; } rr = &(r[na]); if (nb <= 0) { (void)bn_mul_words(r, a, na, 0); return; } else rr[0] = bn_mul_words(r, a, na, b[0]); for (;;) { if (--nb <= 0) return; rr[1] = bn_mul_add_words(&(r[1]), a, na, b[1]); if (--nb <= 0) return; rr[2] = bn_mul_add_words(&(r[2]), a, na, b[2]); if (--nb <= 0) return; rr[3] = bn_mul_add_words(&(r[3]), a, na, b[3]); if (--nb <= 0) return; rr[4] = bn_mul_add_words(&(r[4]), a, na, b[4]); rr += 4; r += 4; b += 4; } } test/bntest.c:1924: error: BUFFER_OVERRUN_L3 Offset: [4, +oo] (⇐ [0, +oo] + 4) Size: [0, 8388607] by call to `BN_mod_exp`. Showing all 22 steps of the trace test/bntest.c:1922:5: Call 1920. || !TEST_ptr(r = BN_new())) 1921. goto err; 1922. BN_zero(zero); ^ 1923. 1924. if (!TEST_true(BN_mod_exp(r, a, zero, BN_value_one(), NULL)) crypto/bn/bn_lib.c:395:1: Parameter `*a->d` 393. } 394. 395. > int BN_set_word(BIGNUM *a, BN_ULONG w) 396. { 397. bn_check_top(a); crypto/bn/bn_lib.c:398:9: Call 396. { 397. bn_check_top(a); 398. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 399. return (0); 400. a->neg = 0; crypto/bn/bn_lcl.h:660:1: Parameter `*a->d` 658. const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx); 659. 660. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits) 661. { 662. if (bits > (INT_MAX - BN_BITS2 + 1)) test/bntest.c:1924:10: Call 1922. BN_zero(zero); 1923. 1924. if (!TEST_true(BN_mod_exp(r, a, zero, BN_value_one(), NULL)) ^ 1925. || !TEST_BN_eq_zero(r) 1926. || !TEST_true(BN_mod_exp_mont(r, a, zero, BN_value_one(), crypto/bn/bn_exp.c:91:1: Parameter `*a->d` 89. } 90. 91. > int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, 92. BN_CTX *ctx) 93. { crypto/bn/bn_exp.c:144:19: Call 142. } else 143. # endif 144. ret = BN_mod_exp_mont(r, a, p, m, ctx, NULL); ^ 145. } else 146. #endif crypto/bn/bn_exp.c:294:1: Parameter `*a->d` 292. } 293. 294. > int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, 295. const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont) 296. { crypto/bn/bn_exp.c:306:16: Call 304. 305. if (BN_get_flags(p, BN_FLG_CONSTTIME) != 0) { 306. return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont); ^ 307. } 308. crypto/bn/bn_exp.c:594:1: Parameter `*a->d` 592. * http://www.daemonology.net/hyperthreading-considered-harmful/) 593. */ 594. > int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, 595. const BIGNUM *m, BN_CTX *ctx, 596. BN_MONT_CTX *in_mont) crypto/bn/bn_exp.c:751:17: Call 749. if (!BN_to_montgomery(&am, &am, mont, ctx)) 750. goto err; 751. } else if (!BN_to_montgomery(&am, a, mont, ctx)) ^ 752. goto err; 753. crypto/bn/bn_lib.c:877:1: Parameter `*a->d` 875. } 876. 877. > int BN_to_montgomery(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont, 878. BN_CTX *ctx) 879. { crypto/bn/bn_lib.c:880:12: Call 878. BN_CTX *ctx) 879. { 880. return BN_mod_mul_montgomery(r, a, &(mont->RR), mont, ctx); ^ 881. } 882. crypto/bn/bn_mont.c:26:1: Parameter `*a->d` 24. #endif 25. 26. > int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, 27. BN_MONT_CTX *mont, BN_CTX *ctx) 28. { crypto/bn/bn_mont.c:56:14: Call 54. goto err; 55. } else { 56. if (!BN_mul(tmp, a, b, ctx)) ^ 57. goto err; 58. } crypto/bn/bn_mul.c:495:1: Parameter `*a->d` 493. #endif /* BN_RECURSION */ 494. 495. > int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) 496. { 497. int ret = 0; crypto/bn/bn_mul.c:575:17: Call 573. if (bn_wexpand(rr, k * 4) == NULL) 574. goto err; 575. bn_mul_part_recursive(rr->d, a->d, b->d, ^ 576. j, al - j, bl - j, t->d); 577. } else { /* al <= j || bl <= j */ crypto/bn/bn_mul.c:320:1: Parameter `*a` 318. */ 319. /* tnX may not be negative but less than n */ 320. > void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n, 321. int tna, int tnb, BN_ULONG *t) 322. { crypto/bn/bn_mul.c:328:9: Call 326. 327. if (n < 8) { 328. bn_mul_normal(r, a, n + tna, b, n + tnb); ^ 329. return; 330. } crypto/bn/bn_mul.c:650:1: <Length trace> 648. } 649. 650. > void bn_mul_normal(BN_ULONG *r, BN_ULONG *a, int na, BN_ULONG *b, int nb) 651. { 652. BN_ULONG *rr; crypto/bn/bn_mul.c:650:1: Parameter `*b` 648. } 649. 650. > void bn_mul_normal(BN_ULONG *r, BN_ULONG *a, int na, BN_ULONG *b, int nb) 651. { 652. BN_ULONG *rr; crypto/bn/bn_mul.c:685:50: Array access: Offset: [4, +oo] (⇐ [0, +oo] + 4) Size: [0, 8388607] by call to `BN_mod_exp` 683. if (--nb <= 0) 684. return; 685. rr[4] = bn_mul_add_words(&(r[4]), a, na, b[4]); ^ 686. rr += 4; 687. r += 4;
https://github.com/openssl/openssl/blob/3f97052392cb10fca5309212bf720685262ad4a6/crypto/bn/bn_mul.c/#L685
d2a_code_trace_data_45065
static void doall_util_fn(LHASH *lh, int use_arg, LHASH_DOALL_FN_TYPE func, LHASH_DOALL_ARG_FN_TYPE func_arg, void *arg) { int i; LHASH_NODE *a,*n; for (i=lh->num_nodes-1; i>=0; i--) { a=lh->b[i]; while (a != NULL) { n=a->next; if(use_arg) func_arg(a->data,arg); else func(a->data); a=n; } } } apps/ocsp.c:879: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `SSL_CTX_free`. Showing all 16 steps of the trace apps/ocsp.c:695:8: Call 693. goto end; 694. } 695. if (!make_serial_index(rdb)) ^ 696. goto end; 697. } apps/ca.c:3133:1: Parameter `(*db->index)->num_nodes` 3131. } 3132. 3133. > int make_serial_index(TXT_DB *db) 3134. { 3135. if (!TXT_DB_create_index(db, DB_serial, NULL, apps/ca.c:3135:7: Call 3133. int make_serial_index(TXT_DB *db) 3134. { 3135. if (!TXT_DB_create_index(db, DB_serial, NULL, ^ 3136. LHASH_HASH_FN(index_serial_hash), 3137. LHASH_COMP_FN(index_serial_cmp))) crypto/txt_db/txt_db.c:213:1: Parameter `(*db->index)->num_nodes` 211. } 212. 213. > int TXT_DB_create_index(TXT_DB *db, int field, int (*qual)(), 214. LHASH_HASH_FN_TYPE hash, LHASH_COMP_FN_TYPE cmp) 215. { apps/ocsp.c:862:2: Call 860. X509_free(rsigner); 861. X509_free(rca_cert); 862. TXT_DB_free(rdb); ^ 863. BIO_free_all(cbio); 864. BIO_free_all(acbio); crypto/txt_db/txt_db.c:340:1: Parameter `(*db->index)->num_nodes` 338. } 339. 340. > void TXT_DB_free(TXT_DB *db) 341. { 342. int i,n; apps/ocsp.c:879:3: Call 877. OPENSSL_free(port); 878. OPENSSL_free(path); 879. SSL_CTX_free(ctx); ^ 880. } 881. ssl/ssl_lib.c:1293:1: Parameter `a->sessions->num_nodes` 1291. #endif 1292. 1293. > void SSL_CTX_free(SSL_CTX *a) 1294. { 1295. int i; ssl/ssl_lib.c:1315:3: Call 1313. if (a->sessions != NULL) 1314. { 1315. SSL_CTX_flush_sessions(a,0); ^ 1316. lh_free(a->sessions); 1317. } ssl/ssl_sess.c:654:1: Parameter `s->sessions->num_nodes` 652. static IMPLEMENT_LHASH_DOALL_ARG_FN(timeout, SSL_SESSION *, TIMEOUT_PARAM *) 653. 654. > void SSL_CTX_flush_sessions(SSL_CTX *s, long t) 655. { 656. unsigned long i; ssl/ssl_sess.c:666:2: Call 664. i=tp.cache->down_load; 665. tp.cache->down_load=0; 666. lh_doall_arg(tp.cache, LHASH_DOALL_ARG_FN(timeout), &tp); ^ 667. tp.cache->down_load=i; 668. CRYPTO_w_unlock(CRYPTO_LOCK_SSL_CTX); crypto/lhash/lhash.c:300:1: Parameter `lh->num_nodes` 298. } 299. 300. > void lh_doall_arg(LHASH *lh, LHASH_DOALL_ARG_FN_TYPE func, void *arg) 301. { 302. doall_util_fn(lh, 1, (LHASH_DOALL_FN_TYPE)0, func, arg); crypto/lhash/lhash.c:302:2: Call 300. void lh_doall_arg(LHASH *lh, LHASH_DOALL_ARG_FN_TYPE func, void *arg) 301. { 302. doall_util_fn(lh, 1, (LHASH_DOALL_FN_TYPE)0, func, arg); ^ 303. } 304. crypto/lhash/lhash.c:270:1: <LHS trace> 268. } 269. 270. > static void doall_util_fn(LHASH *lh, int use_arg, LHASH_DOALL_FN_TYPE func, 271. LHASH_DOALL_ARG_FN_TYPE func_arg, void *arg) 272. { crypto/lhash/lhash.c:270:1: Parameter `lh->num_nodes` 268. } 269. 270. > static void doall_util_fn(LHASH *lh, int use_arg, LHASH_DOALL_FN_TYPE func, 271. LHASH_DOALL_ARG_FN_TYPE func_arg, void *arg) 272. { crypto/lhash/lhash.c:278:7: Binary operation: ([0, +oo] - 1):unsigned32 by call to `SSL_CTX_free` 276. /* reverse the order so we search from 'top to bottom' 277. * We were having memory leaks otherwise */ 278. for (i=lh->num_nodes-1; i>=0; i--) ^ 279. { 280. a=lh->b[i];
https://github.com/openssl/openssl/blob/6b46ca135a70ad7f77bba771496751f555e4863c/crypto/lhash/lhash.c/#L278
d2a_code_trace_data_45066
IMPLEMENT_new_ctx(cfb1, CFB, 192) providers/common/ciphers/aes.c:310: error: NULL_DEREFERENCE pointer `ctx` last assigned on line 310 could be null and is dereferenced at line 310, column 1. Showing all 18 steps of the trace providers/common/ciphers/aes.c:310:1: start of procedure aes_192_cfb1_newctx() 308. IMPLEMENT_new_ctx(cfb, CFB, 128) 309. IMPLEMENT_new_ctx(cfb1, CFB, 256) 310. > IMPLEMENT_new_ctx(cfb1, CFB, 192) 311. IMPLEMENT_new_ctx(cfb1, CFB, 128) 312. IMPLEMENT_new_ctx(cfb8, 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:310:1: 308. IMPLEMENT_new_ctx(cfb, CFB, 128) 309. IMPLEMENT_new_ctx(cfb1, CFB, 256) 310. > IMPLEMENT_new_ctx(cfb1, CFB, 192) 311. IMPLEMENT_new_ctx(cfb1, CFB, 128) 312. IMPLEMENT_new_ctx(cfb8, CFB, 256)
https://github.com/openssl/openssl/blob/f79858ac4d90a450d0620d1ecb713bc35d7d9f8d/providers/common/ciphers/aes.c/#L310
d2a_code_trace_data_45067
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:1075: error: Uninitialized Value The value read from ymax was never initialized. libavcodec/motion_est_template.c:1075:13: 1073. (last_mv[ref_mv_xy-ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16) 1074. }else{ 1075. CHECK_CLIPPED_MV((last_mv[ref_mv_xy+1][0]*ref_mv_scale + (1<<15))>>16, ^ 1076. (last_mv[ref_mv_xy+1][1]*ref_mv_scale + (1<<15))>>16) 1077. if(s->mb_y+1<s->end_mb_y) //FIXME replace at least with last_slice_line
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1075
d2a_code_trace_data_45068
CTLOG *CTLOG_new(EVP_PKEY *public_key, const char *name) { CTLOG *ret = OPENSSL_zalloc(sizeof(*ret)); if (ret == NULL) { CTerr(CT_F_CTLOG_NEW, ERR_R_MALLOC_FAILURE); return NULL; } ret->name = OPENSSL_strdup(name); if (ret->name == NULL) { CTerr(CT_F_CTLOG_NEW, ERR_R_MALLOC_FAILURE); goto err; } ret->public_key = public_key; if (ct_v1_log_id_from_pkey(public_key, ret->log_id) != 1) goto err; return ret; err: CTLOG_free(ret); return NULL; } crypto/ct/ct_log.c:256: error: MEMORY_LEAK memory dynamically allocated by call to `CRYPTO_strdup()` at line 244, column 17 is not reachable after line 256, column 5. Showing all 63 steps of the trace crypto/ct/ct_log.c:235:1: start of procedure CTLOG_new() 233. * Copies the name. 234. */ 235. > CTLOG *CTLOG_new(EVP_PKEY *public_key, const char *name) 236. { 237. CTLOG *ret = OPENSSL_zalloc(sizeof(*ret)); crypto/ct/ct_log.c:237:5: 235. CTLOG *CTLOG_new(EVP_PKEY *public_key, const char *name) 236. { 237. > CTLOG *ret = OPENSSL_zalloc(sizeof(*ret)); 238. 239. if (ret == NULL) { crypto/mem.c:98:1: start of procedure CRYPTO_zalloc() 96. } 97. 98. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 99. { 100. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:100:5: 98. void *CRYPTO_zalloc(size_t num, const char *file, int line) 99. { 100. > void *ret = CRYPTO_malloc(num, file, line); 101. 102. if (ret != NULL) crypto/mem.c:71:1: start of procedure CRYPTO_malloc() 69. } 70. 71. > void *CRYPTO_malloc(size_t num, const char *file, int line) 72. { 73. void *ret = NULL; crypto/mem.c:73:5: 71. void *CRYPTO_malloc(size_t num, const char *file, int line) 72. { 73. > void *ret = NULL; 74. 75. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) crypto/mem.c:75:9: Taking false branch 73. void *ret = NULL; 74. 75. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) ^ 76. return malloc_impl(num, file, line); 77. crypto/mem.c:78:9: Taking false branch 76. return malloc_impl(num, file, line); 77. 78. if (num <= 0) ^ 79. return NULL; 80. crypto/mem.c:81:5: 79. return NULL; 80. 81. > allow_customize = 0; 82. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 83. if (call_malloc_debug) { crypto/mem.c:91:5: 89. } 90. #else 91. > osslargused(file); osslargused(line); 92. ret = malloc(num); 93. #endif crypto/mem.c:91:24: 89. } 90. #else 91. > osslargused(file); osslargused(line); 92. ret = malloc(num); 93. #endif crypto/mem.c:92:5: 90. #else 91. osslargused(file); osslargused(line); 92. > ret = malloc(num); 93. #endif 94. crypto/mem.c:95:5: 93. #endif 94. 95. > return ret; 96. } 97. crypto/mem.c:96:1: return from a call to CRYPTO_malloc 94. 95. return ret; 96. > } 97. 98. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:102:9: Taking true branch 100. void *ret = CRYPTO_malloc(num, file, line); 101. 102. if (ret != NULL) ^ 103. memset(ret, 0, num); 104. return ret; crypto/mem.c:103:9: 101. 102. if (ret != NULL) 103. > memset(ret, 0, num); 104. return ret; 105. } crypto/mem.c:104:5: 102. if (ret != NULL) 103. memset(ret, 0, num); 104. > return ret; 105. } 106. crypto/mem.c:105:1: return from a call to CRYPTO_zalloc 103. memset(ret, 0, num); 104. return ret; 105. > } 106. 107. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/ct/ct_log.c:239:9: Taking false branch 237. CTLOG *ret = OPENSSL_zalloc(sizeof(*ret)); 238. 239. if (ret == NULL) { ^ 240. CTerr(CT_F_CTLOG_NEW, ERR_R_MALLOC_FAILURE); 241. return NULL; crypto/ct/ct_log.c:244:5: 242. } 243. 244. > ret->name = OPENSSL_strdup(name); 245. if (ret->name == NULL) { 246. CTerr(CT_F_CTLOG_NEW, ERR_R_MALLOC_FAILURE); crypto/o_str.c:28:1: start of procedure CRYPTO_strdup() 26. } 27. 28. > char *CRYPTO_strdup(const char *str, const char* file, int line) 29. { 30. char *ret; crypto/o_str.c:33:9: Taking false branch 31. size_t size; 32. 33. if (str == NULL) ^ 34. return NULL; 35. size = strlen(str) + 1; crypto/o_str.c:35:5: 33. if (str == NULL) 34. return NULL; 35. > size = strlen(str) + 1; 36. ret = CRYPTO_malloc(size, file, line); 37. if (ret != NULL) crypto/o_str.c:36:5: 34. return NULL; 35. size = strlen(str) + 1; 36. > ret = CRYPTO_malloc(size, file, line); 37. if (ret != NULL) 38. memcpy(ret, str, size); crypto/mem.c:71:1: start of procedure CRYPTO_malloc() 69. } 70. 71. > void *CRYPTO_malloc(size_t num, const char *file, int line) 72. { 73. void *ret = NULL; crypto/mem.c:73:5: 71. void *CRYPTO_malloc(size_t num, const char *file, int line) 72. { 73. > void *ret = NULL; 74. 75. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) crypto/mem.c:75:9: Taking false branch 73. void *ret = NULL; 74. 75. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) ^ 76. return malloc_impl(num, file, line); 77. crypto/mem.c:78:9: Taking false branch 76. return malloc_impl(num, file, line); 77. 78. if (num <= 0) ^ 79. return NULL; 80. crypto/mem.c:81:5: 79. return NULL; 80. 81. > allow_customize = 0; 82. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 83. if (call_malloc_debug) { crypto/mem.c:91:5: 89. } 90. #else 91. > osslargused(file); osslargused(line); 92. ret = malloc(num); 93. #endif crypto/mem.c:91:24: 89. } 90. #else 91. > osslargused(file); osslargused(line); 92. ret = malloc(num); 93. #endif crypto/mem.c:92:5: 90. #else 91. osslargused(file); osslargused(line); 92. > ret = malloc(num); 93. #endif 94. crypto/mem.c:95:5: 93. #endif 94. 95. > return ret; 96. } 97. crypto/mem.c:96:1: return from a call to CRYPTO_malloc 94. 95. return ret; 96. > } 97. 98. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/o_str.c:37:9: Taking true branch 35. size = strlen(str) + 1; 36. ret = CRYPTO_malloc(size, file, line); 37. if (ret != NULL) ^ 38. memcpy(ret, str, size); 39. return ret; crypto/o_str.c:38:9: 36. ret = CRYPTO_malloc(size, file, line); 37. if (ret != NULL) 38. > memcpy(ret, str, size); 39. return ret; 40. } crypto/o_str.c:39:5: 37. if (ret != NULL) 38. memcpy(ret, str, size); 39. > return ret; 40. } 41. crypto/o_str.c:40:1: return from a call to CRYPTO_strdup 38. memcpy(ret, str, size); 39. return ret; 40. > } 41. 42. char *CRYPTO_strndup(const char *str, size_t s, const char* file, int line) crypto/ct/ct_log.c:245:9: Taking false branch 243. 244. ret->name = OPENSSL_strdup(name); 245. if (ret->name == NULL) { ^ 246. CTerr(CT_F_CTLOG_NEW, ERR_R_MALLOC_FAILURE); 247. goto err; crypto/ct/ct_log.c:250:5: 248. } 249. 250. > ret->public_key = public_key; 251. if (ct_v1_log_id_from_pkey(public_key, ret->log_id) != 1) 252. goto err; crypto/ct/ct_log.c:251:9: 249. 250. ret->public_key = public_key; 251. > if (ct_v1_log_id_from_pkey(public_key, ret->log_id) != 1) 252. goto err; 253. crypto/ct/ct_log.c:73:1: start of procedure ct_v1_log_id_from_pkey() 71. 72. /* Converts a log's public key into a SHA256 log ID */ 73. > static int ct_v1_log_id_from_pkey(EVP_PKEY *pkey, 74. unsigned char log_id[CT_V1_HASHLEN]) 75. { crypto/ct/ct_log.c:76:5: 74. unsigned char log_id[CT_V1_HASHLEN]) 75. { 76. > int ret = 0; 77. unsigned char *pkey_der = NULL; 78. int pkey_der_len = i2d_PUBKEY(pkey, &pkey_der); crypto/ct/ct_log.c:77:5: 75. { 76. int ret = 0; 77. > unsigned char *pkey_der = NULL; 78. int pkey_der_len = i2d_PUBKEY(pkey, &pkey_der); 79. crypto/ct/ct_log.c:78:5: 76. int ret = 0; 77. unsigned char *pkey_der = NULL; 78. > int pkey_der_len = i2d_PUBKEY(pkey, &pkey_der); 79. 80. if (pkey_der_len <= 0) { crypto/x509/x_pubkey.c:202:1: start of procedure i2d_PUBKEY() 200. } 201. 202. > int i2d_PUBKEY(EVP_PKEY *a, unsigned char **pp) 203. { 204. X509_PUBKEY *xpk = NULL; crypto/x509/x_pubkey.c:204:5: 202. int i2d_PUBKEY(EVP_PKEY *a, unsigned char **pp) 203. { 204. > X509_PUBKEY *xpk = NULL; 205. int ret; 206. if (!a) crypto/x509/x_pubkey.c:206:10: Taking true branch 204. X509_PUBKEY *xpk = NULL; 205. int ret; 206. if (!a) ^ 207. return 0; 208. if (!X509_PUBKEY_set(&xpk, a)) crypto/x509/x_pubkey.c:207:9: 205. int ret; 206. if (!a) 207. > return 0; 208. if (!X509_PUBKEY_set(&xpk, a)) 209. return 0; crypto/x509/x_pubkey.c:213:1: return from a call to i2d_PUBKEY 211. X509_PUBKEY_free(xpk); 212. return ret; 213. > } 214. 215. /* crypto/ct/ct_log.c:80:9: Taking true branch 78. int pkey_der_len = i2d_PUBKEY(pkey, &pkey_der); 79. 80. if (pkey_der_len <= 0) { ^ 81. CTerr(CT_F_CT_V1_LOG_ID_FROM_PKEY, CT_R_LOG_KEY_INVALID); 82. goto err; crypto/ct/ct_log.c:81:9: Skipping ERR_put_error(): empty list of specs 79. 80. if (pkey_der_len <= 0) { 81. CTerr(CT_F_CT_V1_LOG_ID_FROM_PKEY, CT_R_LOG_KEY_INVALID); ^ 82. goto err; 83. } crypto/ct/ct_log.c:87:1: 85. SHA256(pkey_der, pkey_der_len, log_id); 86. ret = 1; 87. > err: 88. OPENSSL_free(pkey_der); 89. return ret; crypto/ct/ct_log.c:88:5: 86. ret = 1; 87. err: 88. > OPENSSL_free(pkey_der); 89. return ret; 90. } crypto/mem.c:163:1: start of procedure CRYPTO_free() 161. } 162. 163. > void CRYPTO_free(void *str, const char *file, int line) 164. { 165. if (free_impl != NULL && free_impl != &CRYPTO_free) { crypto/mem.c:165:9: Taking false branch 163. void CRYPTO_free(void *str, const char *file, int line) 164. { 165. if (free_impl != NULL && free_impl != &CRYPTO_free) { ^ 166. free_impl(str, file, line); 167. return; crypto/mem.c:179:5: 177. } 178. #else 179. > free(str); 180. #endif 181. } crypto/mem.c:181:1: return from a call to CRYPTO_free 179. free(str); 180. #endif 181. > } 182. 183. void CRYPTO_clear_free(void *str, size_t num, const char *file, int line) crypto/ct/ct_log.c:89:5: 87. err: 88. OPENSSL_free(pkey_der); 89. > return ret; 90. } 91. crypto/ct/ct_log.c:90:1: return from a call to ct_v1_log_id_from_pkey 88. OPENSSL_free(pkey_der); 89. return ret; 90. > } 91. 92. CTLOG_STORE *CTLOG_STORE_new(void) crypto/ct/ct_log.c:251:9: Taking true branch 249. 250. ret->public_key = public_key; 251. if (ct_v1_log_id_from_pkey(public_key, ret->log_id) != 1) ^ 252. goto err; 253. crypto/ct/ct_log.c:255:1: 253. 254. return ret; 255. > err: 256. CTLOG_free(ret); 257. return NULL; crypto/ct/ct_log.c:256:5: Skipping CTLOG_free(): empty list of specs 254. return ret; 255. err: 256. CTLOG_free(ret); ^ 257. return NULL; 258. }
https://github.com/openssl/openssl/blob/6025001707fd65679d758c877200469d4e72ea88/crypto/ct/ct_log.c/#L256
d2a_code_trace_data_45069
int pem_check_suffix(const char *pem_str, const char *suffix) { int pem_len = strlen(pem_str); int suffix_len = strlen(suffix); const char *p; if (suffix_len + 1 >= pem_len) return 0; p = pem_str + pem_len - suffix_len; if (strcmp(p, suffix)) return 0; p--; if (*p != ' ') return 0; return p - pem_str; } crypto/pem/pem_lib.c:265: error: BUFFER_OVERRUN_L3 Offset: [-12, +oo] Size: [1, 241] by call to `check_pem`. Showing all 10 steps of the trace crypto/pem/pem_lib.c:260:14: Call 258. pem_free(header, flags); 259. pem_free(data, flags); 260. if (!PEM_read_bio_ex(bp, &nm, &header, &data, &len, flags)) { ^ 261. if (ERR_GET_REASON(ERR_peek_error()) == PEM_R_NO_START_LINE) 262. ERR_add_error_data(2, "Expecting: ", name); crypto/pem/pem_lib.c:958:5: Assignment 956. } 957. BIO_read(headerB, *header, headerlen); 958. (*header)[headerlen] = '\0'; ^ 959. BIO_read(dataB, *data, len); 960. *len_out = len; crypto/pem/pem_lib.c:265:15: Call 263. return 0; 264. } 265. } while (!check_pem(nm, name)); ^ 266. if (!PEM_get_EVP_CIPHER_INFO(header, &cipher)) 267. goto err; crypto/pem/pem_lib.c:136:1: Parameter `*nm` 134. #endif 135. 136. > static int check_pem(const char *nm, const char *name) 137. { 138. /* Normal matching nm and name */ crypto/pem/pem_lib.c:151:16: Call 149. if (strcmp(nm, PEM_STRING_PKCS8INF) == 0) 150. return 1; 151. slen = pem_check_suffix(nm, "PRIVATE KEY"); ^ 152. if (slen > 0) { 153. /* crypto/pem/pem_lib.c:985:1: <Length trace> 983. */ 984. 985. > int pem_check_suffix(const char *pem_str, const char *suffix) 986. { 987. int pem_len = strlen(pem_str); crypto/pem/pem_lib.c:985:1: Parameter `*pem_str` 983. */ 984. 985. > int pem_check_suffix(const char *pem_str, const char *suffix) 986. { 987. int pem_len = strlen(pem_str); crypto/pem/pem_lib.c:992:5: Assignment 990. if (suffix_len + 1 >= pem_len) 991. return 0; 992. p = pem_str + pem_len - suffix_len; ^ 993. if (strcmp(p, suffix)) 994. return 0; crypto/pem/pem_lib.c:995:5: Assignment 993. if (strcmp(p, suffix)) 994. return 0; 995. p--; ^ 996. if (*p != ' ') 997. return 0; crypto/pem/pem_lib.c:996:9: Array access: Offset: [-12, +oo] Size: [1, 241] by call to `check_pem` 994. return 0; 995. p--; 996. if (*p != ' ') ^ 997. return 0; 998. return p - pem_str;
https://github.com/openssl/openssl/blob/7671342e550ed2de676b23c79d0e7f45a381c76e/crypto/pem/pem_lib.c/#L996
d2a_code_trace_data_45070
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } test/bntest.c:841: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `BN_mod_exp_recp`. Showing all 22 steps of the trace test/bntest.c:859:21: Call 857. } 858. 859. kronecker = BN_kronecker(a, b, ctx); ^ 860. if (kronecker < -1) 861. goto err; crypto/bn/bn_kron.c:17:1: Parameter `ctx->stack.depth` 15. 16. /* Returns -2 for errors because both -1 and 0 are valid results. */ 17. > int BN_kronecker(const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) 18. { 19. int i; crypto/bn/bn_kron.c:35:5: Call 33. bn_check_top(b); 34. 35. BN_CTX_start(ctx); ^ 36. A = BN_CTX_get(ctx); 37. B = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:181:1: Parameter `ctx->stack.depth` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_kron.c:135:5: Call 133. } 134. end: 135. BN_CTX_end(ctx); ^ 136. if (err) 137. return -2; 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:841:14: Call 839. b->neg = 0; 840. 841. if (!BN_mod_exp_recp(r, a, t, b, ctx)) ^ 842. goto err; 843. b->neg = 1; crypto/bn/bn_exp.c:168:1: Parameter `ctx->stack.depth` 166. } 167. 168. > int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, 169. const BIGNUM *m, BN_CTX *ctx) 170. { crypto/bn/bn_exp.c:196:5: Call 194. } 195. 196. BN_CTX_start(ctx); ^ 197. aa = BN_CTX_get(ctx); 198. val[0] = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:181:1: Parameter `ctx->stack.depth` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_exp.c:215:10: Call 213. } 214. 215. if (!BN_nnmod(val[0], a, m, ctx)) ^ 216. goto err; /* 1 */ 217. 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:140:1: Parameter `ctx->stack.depth` 138. * If 'dv' or 'rm' is NULL, the respective value is not returned. 139. */ 140. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 141. BN_CTX *ctx) 142. { crypto/bn/bn_div.c:193:5: Call 191. } 192. 193. BN_CTX_start(ctx); ^ 194. tmp = BN_CTX_get(ctx); 195. snum = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:181:1: Parameter `ctx->stack.depth` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_div.c:416:5: Call 414. if (no_branch) 415. bn_correct_top(res); 416. BN_CTX_end(ctx); ^ 417. return (1); 418. err: crypto/bn/bn_ctx.c:195:1: Parameter `ctx->stack.depth` 193. } 194. 195. > void BN_CTX_end(BN_CTX *ctx) 196. { 197. CTXDBG_ENTRY("BN_CTX_end", ctx); crypto/bn/bn_ctx.c:201:27: Call 199. ctx->err_stack--; 200. else { 201. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 202. /* Does this stack frame have anything to release? */ 203. if (fp < ctx->used) crypto/bn/bn_ctx.c:271:1: <LHS trace> 269. } 270. 271. > static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:271:1: Parameter `st->depth` 269. } 270. 271. > static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:273:12: Binary operation: ([0, +oo] - 1):unsigned32 by call to `BN_mod_exp_recp` 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_45071
static void crl_akid_check(X509_STORE_CTX *ctx, X509_CRL *crl, X509 **pissuer, int *pcrl_score) { X509 *crl_issuer = NULL; X509_NAME *cnm = X509_CRL_get_issuer(crl); int cidx = ctx->error_depth; int i; if (cidx != sk_X509_num(ctx->chain) - 1) cidx++; crl_issuer = sk_X509_value(ctx->chain, cidx); if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) { if (*pcrl_score & CRL_SCORE_ISSUER_NAME) { *pcrl_score |= CRL_SCORE_AKID | CRL_SCORE_ISSUER_CERT; *pissuer = crl_issuer; return; } } for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++) { crl_issuer = sk_X509_value(ctx->chain, cidx); if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm)) continue; if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) { *pcrl_score |= CRL_SCORE_AKID | CRL_SCORE_SAME_PATH; *pissuer = crl_issuer; return; } } if (!(ctx->param->flags & X509_V_FLAG_EXTENDED_CRL_SUPPORT)) return; for (i = 0; i < sk_X509_num(ctx->untrusted); i++) { crl_issuer = sk_X509_value(ctx->untrusted, i); if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm)) continue; if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) { *pissuer = crl_issuer; *pcrl_score |= CRL_SCORE_AKID; return; } } } crypto/x509/x509_vfy.c:1096: error: NULL_DEREFERENCE pointer `crl_issuer` last assigned on line 1095 could be null and is dereferenced by call to `X509_get_subject_name()` at line 1096, column 27. Showing all 52 steps of the trace crypto/x509/x509_vfy.c:1073:1: start of procedure crl_akid_check() 1071. } 1072. 1073. > static void crl_akid_check(X509_STORE_CTX *ctx, X509_CRL *crl, 1074. X509 **pissuer, int *pcrl_score) 1075. { crypto/x509/x509_vfy.c:1076:5: 1074. X509 **pissuer, int *pcrl_score) 1075. { 1076. > X509 *crl_issuer = NULL; 1077. X509_NAME *cnm = X509_CRL_get_issuer(crl); 1078. int cidx = ctx->error_depth; crypto/x509/x509_vfy.c:1077:5: 1075. { 1076. X509 *crl_issuer = NULL; 1077. > X509_NAME *cnm = X509_CRL_get_issuer(crl); 1078. int cidx = ctx->error_depth; 1079. int i; crypto/x509/x509cset.c:155:1: start of procedure X509_CRL_get_issuer() 153. } 154. 155. > X509_NAME *X509_CRL_get_issuer(X509_CRL *crl) 156. { 157. return crl->crl.issuer; crypto/x509/x509cset.c:157:5: 155. X509_NAME *X509_CRL_get_issuer(X509_CRL *crl) 156. { 157. > return crl->crl.issuer; 158. } 159. crypto/x509/x509cset.c:158:1: return from a call to X509_CRL_get_issuer 156. { 157. return crl->crl.issuer; 158. > } 159. 160. STACK_OF(X509_EXTENSION) *X509_CRL_get0_extensions(X509_CRL *crl) crypto/x509/x509_vfy.c:1078:5: 1076. X509 *crl_issuer = NULL; 1077. X509_NAME *cnm = X509_CRL_get_issuer(crl); 1078. > int cidx = ctx->error_depth; 1079. int i; 1080. crypto/x509/x509_vfy.c:1081:9: 1079. int i; 1080. 1081. > if (cidx != sk_X509_num(ctx->chain) - 1) 1082. cidx++; 1083. include/openssl/x509.h:169:1: start of procedure sk_X509_num() 167. typedef struct x509_cinf_st X509_CINF; 168. 169. > DEFINE_STACK_OF(X509) 170. 171. /* This is used for a table of trust checking functions */ crypto/stack/stack.c:316:1: start of procedure sk_num() 314. } 315. 316. > int sk_num(const _STACK *st) 317. { 318. if (st == NULL) crypto/stack/stack.c:318:9: Taking true branch 316. int sk_num(const _STACK *st) 317. { 318. if (st == NULL) ^ 319. return -1; 320. return st->num; crypto/stack/stack.c:319:9: 317. { 318. if (st == NULL) 319. > return -1; 320. return st->num; 321. } crypto/stack/stack.c:321:1: return from a call to sk_num 319. return -1; 320. return st->num; 321. > } 322. 323. void *sk_value(const _STACK *st, int i) include/openssl/x509.h:169:1: return from a call to sk_X509_num 167. typedef struct x509_cinf_st X509_CINF; 168. 169. > DEFINE_STACK_OF(X509) 170. 171. /* This is used for a table of trust checking functions */ crypto/x509/x509_vfy.c:1081:9: Taking true branch 1079. int i; 1080. 1081. if (cidx != sk_X509_num(ctx->chain) - 1) ^ 1082. cidx++; 1083. crypto/x509/x509_vfy.c:1082:9: 1080. 1081. if (cidx != sk_X509_num(ctx->chain) - 1) 1082. > cidx++; 1083. 1084. crl_issuer = sk_X509_value(ctx->chain, cidx); crypto/x509/x509_vfy.c:1084:5: 1082. cidx++; 1083. 1084. > crl_issuer = sk_X509_value(ctx->chain, cidx); 1085. 1086. if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) { include/openssl/x509.h:169:1: start of procedure sk_X509_value() 167. typedef struct x509_cinf_st X509_CINF; 168. 169. > DEFINE_STACK_OF(X509) 170. 171. /* This is used for a table of trust checking functions */ crypto/stack/stack.c:323:1: start of procedure sk_value() 321. } 322. 323. > void *sk_value(const _STACK *st, int i) 324. { 325. if (!st || (i < 0) || (i >= st->num)) crypto/stack/stack.c:325:10: Taking true branch 323. void *sk_value(const _STACK *st, int i) 324. { 325. if (!st || (i < 0) || (i >= st->num)) ^ 326. return NULL; 327. return st->data[i]; crypto/stack/stack.c:326:9: 324. { 325. if (!st || (i < 0) || (i >= st->num)) 326. > return NULL; 327. return st->data[i]; 328. } crypto/stack/stack.c:328:1: return from a call to sk_value 326. return NULL; 327. return st->data[i]; 328. > } 329. 330. void *sk_set(_STACK *st, int i, void *value) include/openssl/x509.h:169:1: return from a call to sk_X509_value 167. typedef struct x509_cinf_st X509_CINF; 168. 169. > DEFINE_STACK_OF(X509) 170. 171. /* This is used for a table of trust checking functions */ crypto/x509/x509_vfy.c:1086:9: 1084. crl_issuer = sk_X509_value(ctx->chain, cidx); 1085. 1086. > if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) { 1087. if (*pcrl_score & CRL_SCORE_ISSUER_NAME) { 1088. *pcrl_score |= CRL_SCORE_AKID | CRL_SCORE_ISSUER_CERT; crypto/x509v3/v3_purp.c:813:1: start of procedure X509_check_akid() 811. } 812. 813. > int X509_check_akid(X509 *issuer, AUTHORITY_KEYID *akid) 814. { 815. crypto/x509v3/v3_purp.c:816:10: Taking false branch 814. { 815. 816. if (!akid) ^ 817. return X509_V_OK; 818. crypto/x509v3/v3_purp.c:820:9: Taking false branch 818. 819. /* Check key ids (if present) */ 820. if (akid->keyid && issuer->skid && ^ 821. ASN1_OCTET_STRING_cmp(akid->keyid, issuer->skid)) 822. return X509_V_ERR_AKID_SKID_MISMATCH; crypto/x509v3/v3_purp.c:824:9: Taking false branch 822. return X509_V_ERR_AKID_SKID_MISMATCH; 823. /* Check serial number */ 824. if (akid->serial && ^ 825. ASN1_INTEGER_cmp(X509_get_serialNumber(issuer), akid->serial)) 826. return X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH; crypto/x509v3/v3_purp.c:828:9: Taking false branch 826. return X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH; 827. /* Check issuer name */ 828. if (akid->issuer) { ^ 829. /* 830. * Ugh, for some peculiar reason AKID includes SEQUENCE OF crypto/x509v3/v3_purp.c:849:5: 847. return X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH; 848. } 849. > return X509_V_OK; 850. } 851. crypto/x509v3/v3_purp.c:850:1: return from a call to X509_check_akid 848. } 849. return X509_V_OK; 850. > } 851. 852. uint32_t X509_get_extension_flags(X509 *x) crypto/x509/x509_vfy.c:1086:9: Taking true branch 1084. crl_issuer = sk_X509_value(ctx->chain, cidx); 1085. 1086. if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) { ^ 1087. if (*pcrl_score & CRL_SCORE_ISSUER_NAME) { 1088. *pcrl_score |= CRL_SCORE_AKID | CRL_SCORE_ISSUER_CERT; crypto/x509/x509_vfy.c:1087:13: Taking false branch 1085. 1086. if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) { 1087. if (*pcrl_score & CRL_SCORE_ISSUER_NAME) { ^ 1088. *pcrl_score |= CRL_SCORE_AKID | CRL_SCORE_ISSUER_CERT; 1089. *pissuer = crl_issuer; crypto/x509/x509_vfy.c:1094:10: 1092. } 1093. 1094. > for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++) { 1095. crl_issuer = sk_X509_value(ctx->chain, cidx); 1096. if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm)) crypto/x509/x509_vfy.c:1094:18: 1092. } 1093. 1094. > for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++) { 1095. crl_issuer = sk_X509_value(ctx->chain, cidx); 1096. if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm)) include/openssl/x509.h:169:1: start of procedure sk_X509_num() 167. typedef struct x509_cinf_st X509_CINF; 168. 169. > DEFINE_STACK_OF(X509) 170. 171. /* This is used for a table of trust checking functions */ crypto/stack/stack.c:316:1: start of procedure sk_num() 314. } 315. 316. > int sk_num(const _STACK *st) 317. { 318. if (st == NULL) crypto/stack/stack.c:318:9: Taking true branch 316. int sk_num(const _STACK *st) 317. { 318. if (st == NULL) ^ 319. return -1; 320. return st->num; crypto/stack/stack.c:319:9: 317. { 318. if (st == NULL) 319. > return -1; 320. return st->num; 321. } crypto/stack/stack.c:321:1: return from a call to sk_num 319. return -1; 320. return st->num; 321. > } 322. 323. void *sk_value(const _STACK *st, int i) include/openssl/x509.h:169:1: return from a call to sk_X509_num 167. typedef struct x509_cinf_st X509_CINF; 168. 169. > DEFINE_STACK_OF(X509) 170. 171. /* This is used for a table of trust checking functions */ crypto/x509/x509_vfy.c:1094:18: Loop condition is true. Entering loop body 1092. } 1093. 1094. for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++) { ^ 1095. crl_issuer = sk_X509_value(ctx->chain, cidx); 1096. if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm)) crypto/x509/x509_vfy.c:1095:9: 1093. 1094. for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++) { 1095. > crl_issuer = sk_X509_value(ctx->chain, cidx); 1096. if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm)) 1097. continue; include/openssl/x509.h:169:1: start of procedure sk_X509_value() 167. typedef struct x509_cinf_st X509_CINF; 168. 169. > DEFINE_STACK_OF(X509) 170. 171. /* This is used for a table of trust checking functions */ crypto/stack/stack.c:323:1: start of procedure sk_value() 321. } 322. 323. > void *sk_value(const _STACK *st, int i) 324. { 325. if (!st || (i < 0) || (i >= st->num)) crypto/stack/stack.c:325:10: Taking true branch 323. void *sk_value(const _STACK *st, int i) 324. { 325. if (!st || (i < 0) || (i >= st->num)) ^ 326. return NULL; 327. return st->data[i]; crypto/stack/stack.c:326:9: 324. { 325. if (!st || (i < 0) || (i >= st->num)) 326. > return NULL; 327. return st->data[i]; 328. } crypto/stack/stack.c:328:1: return from a call to sk_value 326. return NULL; 327. return st->data[i]; 328. > } 329. 330. void *sk_set(_STACK *st, int i, void *value) include/openssl/x509.h:169:1: return from a call to sk_X509_value 167. typedef struct x509_cinf_st X509_CINF; 168. 169. > DEFINE_STACK_OF(X509) 170. 171. /* This is used for a table of trust checking functions */ crypto/x509/x509_vfy.c:1096:13: 1094. for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++) { 1095. crl_issuer = sk_X509_value(ctx->chain, cidx); 1096. > if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm)) 1097. continue; 1098. if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) { crypto/x509/x509_cmp.c:148:1: start of procedure X509_get_subject_name() 146. #endif 147. 148. > X509_NAME *X509_get_subject_name(X509 *a) 149. { 150. return (a->cert_info.subject); crypto/x509/x509_cmp.c:150:5: 148. X509_NAME *X509_get_subject_name(X509 *a) 149. { 150. > return (a->cert_info.subject); 151. } 152.
https://github.com/openssl/openssl/blob/0daccd4dc1f1ac62181738a91714f35472e50f3c/crypto/x509/x509_vfy.c/#L1096
d2a_code_trace_data_45072
int RAND_status(void) { const RAND_METHOD *meth = RAND_get_rand_method(); if (meth->status != NULL) return meth->status(); return 0; } crypto/rand/rand_lib.c:665: error: NULL_DEREFERENCE pointer `meth` last assigned on line 663 could be null and is dereferenced at line 665, column 9. Showing all 14 steps of the trace crypto/rand/rand_lib.c:661:1: start of procedure RAND_status() 659. #endif 660. 661. > int RAND_status(void) 662. { 663. const RAND_METHOD *meth = RAND_get_rand_method(); crypto/rand/rand_lib.c:663:5: 661. int RAND_status(void) 662. { 663. > const RAND_METHOD *meth = RAND_get_rand_method(); 664. 665. if (meth->status != NULL) crypto/rand/rand_lib.c:548:1: start of procedure RAND_get_rand_method() 546. } 547. 548. > const RAND_METHOD *RAND_get_rand_method(void) 549. { 550. const RAND_METHOD *tmp_meth = NULL; crypto/rand/rand_lib.c:550:5: 548. const RAND_METHOD *RAND_get_rand_method(void) 549. { 550. > const RAND_METHOD *tmp_meth = NULL; 551. 552. if (!RUN_ONCE(&rand_init, do_rand_init)) crypto/rand/rand_lib.c:552:10: 550. const RAND_METHOD *tmp_meth = NULL; 551. 552. > if (!RUN_ONCE(&rand_init, do_rand_init)) 553. return NULL; 554. crypto/threads_pthread.c:105:1: start of procedure CRYPTO_THREAD_run_once() 103. } 104. 105. > int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void)) 106. { 107. if (pthread_once(once, init) != 0) crypto/threads_pthread.c:107:9: Taking true branch 105. int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void)) 106. { 107. if (pthread_once(once, init) != 0) ^ 108. return 0; 109. crypto/threads_pthread.c:108:9: 106. { 107. if (pthread_once(once, init) != 0) 108. > return 0; 109. 110. return 1; crypto/threads_pthread.c:111:1: return from a call to CRYPTO_THREAD_run_once 109. 110. return 1; 111. > } 112. 113. int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *)) crypto/rand/rand_lib.c:552:10: Condition is false 550. const RAND_METHOD *tmp_meth = NULL; 551. 552. if (!RUN_ONCE(&rand_init, do_rand_init)) ^ 553. return NULL; 554. crypto/rand/rand_lib.c:552:10: Taking true branch 550. const RAND_METHOD *tmp_meth = NULL; 551. 552. if (!RUN_ONCE(&rand_init, do_rand_init)) ^ 553. return NULL; 554. crypto/rand/rand_lib.c:553:9: 551. 552. if (!RUN_ONCE(&rand_init, do_rand_init)) 553. > return NULL; 554. 555. CRYPTO_THREAD_write_lock(rand_meth_lock); crypto/rand/rand_lib.c:576:1: return from a call to RAND_get_rand_method 574. CRYPTO_THREAD_unlock(rand_meth_lock); 575. return tmp_meth; 576. > } 577. 578. #ifndef OPENSSL_NO_ENGINE crypto/rand/rand_lib.c:665:9: 663. const RAND_METHOD *meth = RAND_get_rand_method(); 664. 665. > if (meth->status != NULL) 666. return meth->status(); 667. return 0;
https://github.com/openssl/openssl/blob/e0b625f9db00509af9004b7907d44b78f332754a/crypto/rand/rand_lib.c/#L665
d2a_code_trace_data_45073
BIGNUM *SRP_Calc_server_key(BIGNUM *A, BIGNUM *v, BIGNUM *u, BIGNUM *b, BIGNUM *N) { BIGNUM *tmp = NULL, *S = NULL; BN_CTX *bn_ctx; if (u == NULL || A == NULL || v == NULL || b == NULL || N == NULL) return NULL; if ((bn_ctx = BN_CTX_new()) == NULL || (tmp = BN_new()) == NULL || (S = BN_new()) == NULL) goto err; if (!BN_mod_exp(tmp, v, u, N, bn_ctx)) goto err; if (!BN_mod_mul(tmp, A, tmp, N, bn_ctx)) goto err; if (!BN_mod_exp(S, tmp, b, N, bn_ctx)) goto err; err: BN_CTX_free(bn_ctx); BN_clear_free(tmp); return S; } crypto/srp/srp_lib.c:171: error: MEMORY_LEAK memory dynamically allocated by call to `BN_new()` at line 158, column 16 is not reachable after line 171, column 5. Showing all 125 steps of the trace crypto/srp/srp_lib.c:148:1: start of procedure SRP_Calc_server_key() 146. } 147. 148. > BIGNUM *SRP_Calc_server_key(BIGNUM *A, BIGNUM *v, BIGNUM *u, BIGNUM *b, 149. BIGNUM *N) 150. { crypto/srp/srp_lib.c:151:5: 149. BIGNUM *N) 150. { 151. > BIGNUM *tmp = NULL, *S = NULL; 152. BN_CTX *bn_ctx; 153. crypto/srp/srp_lib.c:154:9: Taking false branch 152. BN_CTX *bn_ctx; 153. 154. if (u == NULL || A == NULL || v == NULL || b == NULL || N == NULL) ^ 155. return NULL; 156. crypto/srp/srp_lib.c:154:22: Taking false branch 152. BN_CTX *bn_ctx; 153. 154. if (u == NULL || A == NULL || v == NULL || b == NULL || N == NULL) ^ 155. return NULL; 156. crypto/srp/srp_lib.c:154:35: Taking false branch 152. BN_CTX *bn_ctx; 153. 154. if (u == NULL || A == NULL || v == NULL || b == NULL || N == NULL) ^ 155. return NULL; 156. crypto/srp/srp_lib.c:154:48: Taking false branch 152. BN_CTX *bn_ctx; 153. 154. if (u == NULL || A == NULL || v == NULL || b == NULL || N == NULL) ^ 155. return NULL; 156. crypto/srp/srp_lib.c:154:61: Taking false branch 152. BN_CTX *bn_ctx; 153. 154. if (u == NULL || A == NULL || v == NULL || b == NULL || N == NULL) ^ 155. return NULL; 156. crypto/srp/srp_lib.c:157:9: 155. return NULL; 156. 157. > if ((bn_ctx = BN_CTX_new()) == NULL || 158. (tmp = BN_new()) == NULL || (S = BN_new()) == NULL) 159. goto err; crypto/bn/bn_ctx.c:189:1: start of procedure BN_CTX_new() 187. 188. 189. > BN_CTX *BN_CTX_new(void) 190. { 191. BN_CTX *ret; crypto/bn/bn_ctx.c:193:9: 191. BN_CTX *ret; 192. 193. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 194. BNerr(BN_F_BN_CTX_NEW, ERR_R_MALLOC_FAILURE); 195. 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_ctx.c:193:9: Taking false branch 191. BN_CTX *ret; 192. 193. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 194. BNerr(BN_F_BN_CTX_NEW, ERR_R_MALLOC_FAILURE); 195. return NULL; crypto/bn/bn_ctx.c:198:5: 196. } 197. /* Initialise the structure */ 198. > BN_POOL_init(&ret->pool); 199. BN_STACK_init(&ret->stack); 200. return ret; crypto/bn/bn_ctx.c:335:1: start of procedure BN_POOL_init() 333. /***********/ 334. 335. > static void BN_POOL_init(BN_POOL *p) 336. { 337. p->head = p->current = p->tail = NULL; crypto/bn/bn_ctx.c:337:5: 335. static void BN_POOL_init(BN_POOL *p) 336. { 337. > p->head = p->current = p->tail = NULL; 338. p->used = p->size = 0; 339. } crypto/bn/bn_ctx.c:338:5: 336. { 337. p->head = p->current = p->tail = NULL; 338. > p->used = p->size = 0; 339. } 340. crypto/bn/bn_ctx.c:339:1: return from a call to BN_POOL_init 337. p->head = p->current = p->tail = NULL; 338. p->used = p->size = 0; 339. > } 340. 341. static void BN_POOL_finish(BN_POOL *p) crypto/bn/bn_ctx.c:199:5: 197. /* Initialise the structure */ 198. BN_POOL_init(&ret->pool); 199. > BN_STACK_init(&ret->stack); 200. return ret; 201. } crypto/bn/bn_ctx.c:294:1: start of procedure BN_STACK_init() 292. /************/ 293. 294. > static void BN_STACK_init(BN_STACK *st) 295. { 296. st->indexes = NULL; crypto/bn/bn_ctx.c:296:5: 294. static void BN_STACK_init(BN_STACK *st) 295. { 296. > st->indexes = NULL; 297. st->depth = st->size = 0; 298. } crypto/bn/bn_ctx.c:297:5: 295. { 296. st->indexes = NULL; 297. > st->depth = st->size = 0; 298. } 299. crypto/bn/bn_ctx.c:298:1: return from a call to BN_STACK_init 296. st->indexes = NULL; 297. st->depth = st->size = 0; 298. > } 299. 300. static void BN_STACK_finish(BN_STACK *st) crypto/bn/bn_ctx.c:200:5: 198. BN_POOL_init(&ret->pool); 199. BN_STACK_init(&ret->stack); 200. > return ret; 201. } 202. crypto/bn/bn_ctx.c:201:1: return from a call to BN_CTX_new 199. BN_STACK_init(&ret->stack); 200. return ret; 201. > } 202. 203. BN_CTX *BN_CTX_secure_new(void) crypto/srp/srp_lib.c:157:9: Taking false branch 155. return NULL; 156. 157. if ((bn_ctx = BN_CTX_new()) == NULL || ^ 158. (tmp = BN_new()) == NULL || (S = BN_new()) == NULL) 159. goto err; crypto/srp/srp_lib.c:158:9: 156. 157. if ((bn_ctx = BN_CTX_new()) == NULL || 158. > (tmp = BN_new()) == NULL || (S = BN_new()) == NULL) 159. goto err; 160. 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/srp/srp_lib.c:158:9: Taking false branch 156. 157. if ((bn_ctx = BN_CTX_new()) == NULL || 158. (tmp = BN_new()) == NULL || (S = BN_new()) == NULL) ^ 159. goto err; 160. crypto/srp/srp_lib.c:158:37: 156. 157. if ((bn_ctx = BN_CTX_new()) == NULL || 158. > (tmp = BN_new()) == NULL || (S = BN_new()) == NULL) 159. goto err; 160. 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/srp/srp_lib.c:158:37: Taking false branch 156. 157. if ((bn_ctx = BN_CTX_new()) == NULL || 158. (tmp = BN_new()) == NULL || (S = BN_new()) == NULL) ^ 159. goto err; 160. crypto/srp/srp_lib.c:163:10: Taking true branch 161. /* S = (A*v**u) ** b */ 162. 163. if (!BN_mod_exp(tmp, v, u, N, bn_ctx)) ^ 164. goto err; 165. if (!BN_mod_mul(tmp, A, tmp, N, bn_ctx)) crypto/srp/srp_lib.c:169:2: 167. if (!BN_mod_exp(S, tmp, b, N, bn_ctx)) 168. goto err; 169. > err: 170. BN_CTX_free(bn_ctx); 171. BN_clear_free(tmp); crypto/srp/srp_lib.c:170:5: 168. goto err; 169. err: 170. > BN_CTX_free(bn_ctx); 171. BN_clear_free(tmp); 172. return S; crypto/bn/bn_ctx.c:212:1: start of procedure BN_CTX_free() 210. } 211. 212. > void BN_CTX_free(BN_CTX *ctx) 213. { 214. if (ctx == NULL) crypto/bn/bn_ctx.c:214:9: Taking false branch 212. void BN_CTX_free(BN_CTX *ctx) 213. { 214. if (ctx == NULL) ^ 215. return; 216. #ifdef BN_CTX_DEBUG crypto/bn/bn_ctx.c:231:5: 229. } 230. #endif 231. > BN_STACK_finish(&ctx->stack); 232. BN_POOL_finish(&ctx->pool); 233. OPENSSL_free(ctx); crypto/bn/bn_ctx.c:300:1: start of procedure BN_STACK_finish() 298. } 299. 300. > static void BN_STACK_finish(BN_STACK *st) 301. { 302. OPENSSL_free(st->indexes); crypto/bn/bn_ctx.c:302:5: 300. static void BN_STACK_finish(BN_STACK *st) 301. { 302. > OPENSSL_free(st->indexes); 303. st->indexes = NULL; 304. } crypto/mem.c:234:1: start of procedure CRYPTO_free() 232. } 233. 234. > void CRYPTO_free(void *str) 235. { 236. #ifndef OPENSSL_NO_CRYPTO_MDEBUG crypto/mem.c:245:5: 243. } 244. #else 245. > free(str); 246. #endif 247. } crypto/mem.c:247:1: return from a call to CRYPTO_free 245. free(str); 246. #endif 247. > } 248. 249. void CRYPTO_clear_free(void *str, size_t num) crypto/bn/bn_ctx.c:303:5: 301. { 302. OPENSSL_free(st->indexes); 303. > st->indexes = NULL; 304. } 305. crypto/bn/bn_ctx.c:304:1: return from a call to BN_STACK_finish 302. OPENSSL_free(st->indexes); 303. st->indexes = NULL; 304. > } 305. 306. crypto/bn/bn_ctx.c:232:5: 230. #endif 231. BN_STACK_finish(&ctx->stack); 232. > BN_POOL_finish(&ctx->pool); 233. OPENSSL_free(ctx); 234. } crypto/bn/bn_ctx.c:341:1: start of procedure BN_POOL_finish() 339. } 340. 341. > static void BN_POOL_finish(BN_POOL *p) 342. { 343. unsigned int loop; crypto/bn/bn_ctx.c:346:12: Loop condition is false. Leaving loop 344. BIGNUM *bn; 345. 346. while (p->head) { ^ 347. for (loop = 0, bn = p->head->vals; loop++ < BN_CTX_POOL_SIZE; bn++) 348. if (bn->d) crypto/bn/bn_ctx.c:354:1: return from a call to BN_POOL_finish 352. p->head = p->current; 353. } 354. > } 355. 356. crypto/bn/bn_ctx.c:233:5: 231. BN_STACK_finish(&ctx->stack); 232. BN_POOL_finish(&ctx->pool); 233. > OPENSSL_free(ctx); 234. } 235. crypto/mem.c:234:1: start of procedure CRYPTO_free() 232. } 233. 234. > void CRYPTO_free(void *str) 235. { 236. #ifndef OPENSSL_NO_CRYPTO_MDEBUG crypto/mem.c:245:5: 243. } 244. #else 245. > free(str); 246. #endif 247. } crypto/mem.c:247:1: return from a call to CRYPTO_free 245. free(str); 246. #endif 247. > } 248. 249. void CRYPTO_clear_free(void *str, size_t num) crypto/bn/bn_ctx.c:234:1: return from a call to BN_CTX_free 232. BN_POOL_finish(&ctx->pool); 233. OPENSSL_free(ctx); 234. > } 235. 236. void BN_CTX_start(BN_CTX *ctx) crypto/srp/srp_lib.c:171:5: 169. err: 170. BN_CTX_free(bn_ctx); 171. > BN_clear_free(tmp); 172. return S; 173. } crypto/bn/bn_lib.c:234:1: start of procedure BN_clear_free() 232. 233. 234. > void BN_clear_free(BIGNUM *a) 235. { 236. int i; crypto/bn/bn_lib.c:238:9: Taking false branch 236. int i; 237. 238. if (a == NULL) ^ 239. return; 240. bn_check_top(a); crypto/bn/bn_lib.c:241:9: Taking true branch 239. return; 240. bn_check_top(a); 241. if (a->d != NULL) { ^ 242. OPENSSL_cleanse(a->d, a->dmax * sizeof(a->d[0])); 243. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) crypto/bn/bn_lib.c:242:9: Skipping OPENSSL_cleanse(): method has no implementation 240. bn_check_top(a); 241. if (a->d != NULL) { 242. OPENSSL_cleanse(a->d, a->dmax * sizeof(a->d[0])); ^ 243. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 244. bn_free_d(a); crypto/bn/bn_lib.c:243:14: 241. if (a->d != NULL) { 242. OPENSSL_cleanse(a->d, a->dmax * sizeof(a->d[0])); 243. > if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 244. bn_free_d(a); 245. } 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:243:14: Taking false branch 241. if (a->d != NULL) { 242. OPENSSL_cleanse(a->d, a->dmax * sizeof(a->d[0])); 243. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) ^ 244. bn_free_d(a); 245. } crypto/bn/bn_lib.c:246:5: 244. bn_free_d(a); 245. } 246. > i = BN_get_flags(a, BN_FLG_MALLOCED); 247. OPENSSL_cleanse(a, sizeof(*a)); 248. if (i) 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:247:5: Skipping OPENSSL_cleanse(): method has no implementation 245. } 246. i = BN_get_flags(a, BN_FLG_MALLOCED); 247. OPENSSL_cleanse(a, sizeof(*a)); ^ 248. if (i) 249. OPENSSL_free(a); crypto/bn/bn_lib.c:248:9: Taking false branch 246. i = BN_get_flags(a, BN_FLG_MALLOCED); 247. OPENSSL_cleanse(a, sizeof(*a)); 248. if (i) ^ 249. OPENSSL_free(a); 250. } crypto/bn/bn_lib.c:248:5: 246. i = BN_get_flags(a, BN_FLG_MALLOCED); 247. OPENSSL_cleanse(a, sizeof(*a)); 248. > if (i) 249. OPENSSL_free(a); 250. } crypto/bn/bn_lib.c:250:1: return from a call to BN_clear_free 248. if (i) 249. OPENSSL_free(a); 250. > } 251. 252. void BN_free(BIGNUM *a)
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/crypto/srp/srp_lib.c/#L171
d2a_code_trace_data_45074
static ossl_inline void packet_forward(PACKET *pkt, size_t len) { pkt->curr += len; pkt->remaining -= len; } test/packettest.c:191: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 247):unsigned64 by call to `PACKET_forward`. Showing all 14 steps of the trace test/packettest.c:184:10: Call 182. PACKET pkt; 183. 184. if (!TEST_true(PACKET_buf_init(&pkt, smbuf, BUF_LEN)) ^ 185. || !TEST_true(PACKET_copy_bytes(&pkt, bytes, 4)) 186. || !TEST_char_eq(bytes[0], 2) 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:185:17: Call 183. 184. if (!TEST_true(PACKET_buf_init(&pkt, smbuf, BUF_LEN)) 185. || !TEST_true(PACKET_copy_bytes(&pkt, bytes, 4)) ^ 186. || !TEST_char_eq(bytes[0], 2) 187. || !TEST_char_eq(bytes[1], 4) ssl/packet_locl.h:379:8: Parameter `pkt->remaining` 377. * The caller is responsible for ensuring that |data| can hold |len| bytes. 378. */ 379. __owur static ossl_inline int PACKET_copy_bytes(PACKET *pkt, ^ 380. unsigned char *data, size_t len) 381. { ssl/packet_locl.h:382:10: Call 380. unsigned char *data, size_t len) 381. { 382. if (!PACKET_peek_copy_bytes(pkt, data, len)) ^ 383. return 0; 384. ssl/packet_locl.h:363:8: Parameter `len` 361. 362. /* Peek ahead at |len| bytes from |pkt| and copy them to |data| */ 363. __owur static ossl_inline int PACKET_peek_copy_bytes(const PACKET *pkt, ^ 364. unsigned char *data, 365. size_t len) test/packettest.c:191:17: Call 189. || !TEST_char_eq(bytes[3], 8) 190. || !TEST_size_t_eq(PACKET_remaining(&pkt), BUF_LEN - 4) 191. || !TEST_true(PACKET_forward(&pkt, BUF_LEN - 8)) ^ 192. || !TEST_true(PACKET_copy_bytes(&pkt, bytes, 4)) 193. || !TEST_uchar_eq(bytes[0], 0xf8) 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] - 247):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_45075
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:136: error: Integer Overflow L2 ([1, +oo] - 14):unsigned32 by call to `bitstream_read`. libavcodec/tak.c:136:34: Call 134. 135. if (ti->flags & TAK_FRAME_FLAG_IS_LAST) { 136. ti->last_frame_samples = bitstream_read(bc, TAK_FRAME_HEADER_SAMPLE_COUNT_BITS) + 1; ^ 137. bitstream_skip(bc, 2); 138. } else { 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] - 14):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_45076
static void apply_window_mp3_c(MPA_INT *synth_buf, MPA_INT *window, int *dither_state, OUT_INT *samples, int incr) { register const MPA_INT *w, *w2, *p; int j; OUT_INT *samples2; #if CONFIG_FLOAT float sum, sum2; #elif FRAC_BITS <= 15 int sum, sum2; #else int64_t sum, sum2; #endif memcpy(synth_buf + 512, synth_buf, 32 * sizeof(*synth_buf)); samples2 = samples + 31 * incr; w = window; w2 = window + 31; sum = *dither_state; p = synth_buf + 16; SUM8(MACS, sum, w, p); p = synth_buf + 48; SUM8(MLSS, sum, w + 32, p); *samples = round_sample(&sum); samples += incr; w++; for(j=1;j<16;j++) { sum2 = 0; p = synth_buf + 16 + j; SUM8P2(sum, MACS, sum2, MLSS, w, w2, p); p = synth_buf + 48 - j; SUM8P2(sum, MLSS, sum2, MLSS, w + 32, w2 + 32, p); *samples = round_sample(&sum); samples += incr; sum += sum2; *samples2 = round_sample(&sum); samples2 -= incr; w++; w2--; } p = synth_buf + 32; SUM8(MLSS, sum, w + 32, p); *samples = round_sample(&sum); *dither_state= sum; } libavcodec/mpc.c:54: error: Buffer Overrun L2 Offset: [96+min(0, `c->synth_buf_offset[*]`), 97+max(511, `c->synth_buf_offset[*]`)] (⇐ [32+min(0, `c->synth_buf_offset[*]`), 33+max(511, `c->synth_buf_offset[*]`)] + 64) Size: 2 by call to `ff_mpa_synth_filter`. libavcodec/mpc.c:45:1: Parameter `c->synth_buf[*]` 43. * Process decoded Musepack data and produce PCM 44. */ 45. static void mpc_synth(MPCContext *c, int16_t *out) ^ 46. { 47. int dither_state = 0; libavcodec/mpc.c:54:13: Call 52. samples_ptr = samples + ch; 53. for(i = 0; i < SAMPLES_PER_BAND; i++) { 54. ff_mpa_synth_filter(c->synth_buf[ch], &(c->synth_buf_offset[ch]), ^ 55. ff_mpa_synth_window, &dither_state, 56. samples_ptr, 2, libavcodec/mpegaudiodec.c:705:1: Parameter `*synth_buf_ptr` 703. /* XXX: optimize by avoiding ring buffer usage */ 704. #if !CONFIG_FLOAT 705. void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset, ^ 706. MPA_INT *window, int *dither_state, 707. OUT_INT *samples, int incr, libavcodec/mpegaudiodec.c:718:5: Assignment 716. 717. offset = *synth_buf_offset; 718. synth_buf = synth_buf_ptr + offset; ^ 719. 720. #if FRAC_BITS <= 15 libavcodec/mpegaudiodec.c:731:5: Call 729. #endif 730. 731. apply_window_mp3_c(synth_buf, window, dither_state, samples, incr); ^ 732. 733. offset = (offset - 32) & 511; libavcodec/mpegaudiodec.c:646:1: <Length trace> 644. } 645. 646. static void apply_window_mp3_c(MPA_INT *synth_buf, MPA_INT *window, ^ 647. int *dither_state, OUT_INT *samples, int incr) 648. { libavcodec/mpegaudiodec.c:646:1: Parameter `*synth_buf` 644. } 645. 646. static void apply_window_mp3_c(MPA_INT *synth_buf, MPA_INT *window, ^ 647. int *dither_state, OUT_INT *samples, int incr) 648. { libavcodec/mpegaudiodec.c:694:5: Assignment 692. } 693. 694. p = synth_buf + 32; ^ 695. SUM8(MLSS, sum, w + 32, p); 696. *samples = round_sample(&sum); libavcodec/mpegaudiodec.c:695:5: Array access: Offset: [96+min(0, c->synth_buf_offset[*]), 97+max(511, c->synth_buf_offset[*])] (⇐ [32+min(0, c->synth_buf_offset[*]), 33+max(511, c->synth_buf_offset[*])] + 64) Size: 2 by call to `ff_mpa_synth_filter` 693. 694. p = synth_buf + 32; 695. SUM8(MLSS, sum, w + 32, p); ^ 696. *samples = round_sample(&sum); 697. *dither_state= sum;
https://github.com/libav/libav/blob/63e8d9760f23a4edf81e9ae58c4f6d3baa6ff4dd/libavcodec/mpegaudiodec.c/#L695
d2a_code_trace_data_45077
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:4161: error: Null Dereference pointer `today` last assigned on line 4159 could be null and is dereferenced at line 4161, column 69. ffmpeg.c:4155:1: start of procedure opt_vstats() 4153. } 4154. 4155. static void opt_vstats (void) ^ 4156. { 4157. char filename[40]; ffmpeg.c:4158:5: 4156. { 4157. char filename[40]; 4158. time_t today2 = time(NULL); ^ 4159. struct tm *today = localtime(&today2); 4160. ffmpeg.c:4159:5: 4157. char filename[40]; 4158. time_t today2 = time(NULL); 4159. struct tm *today = localtime(&today2); ^ 4160. 4161. snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min, ffmpeg.c:4161:5: 4159. struct tm *today = localtime(&today2); 4160. 4161. snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min, ^ 4162. today->tm_sec); 4163. opt_vstats_file(filename);
https://github.com/libav/libav/blob/b568d6d94bda607e4ebb35be68181a8c2a9f5c50/ffmpeg.c/#L4161
d2a_code_trace_data_45078
static void ngx_http_limit_conn_cleanup(void *data) { ngx_http_limit_conn_cleanup_t *lccln = data; ngx_slab_pool_t *shpool; ngx_rbtree_node_t *node; ngx_http_limit_conn_ctx_t *ctx; ngx_http_limit_conn_node_t *lc; ctx = lccln->shm_zone->data; shpool = (ngx_slab_pool_t *) lccln->shm_zone->shm.addr; node = lccln->node; lc = (ngx_http_limit_conn_node_t *) &node->color; ngx_shmtx_lock(&shpool->mutex); ngx_log_debug2(NGX_LOG_DEBUG_HTTP, lccln->shm_zone->shm.log, 0, "limit conn cleanup: %08XD %d", node->key, lc->conn); lc->conn--; if (lc->conn == 0) { ngx_rbtree_delete(ctx->rbtree, node); ngx_slab_free_locked(shpool, node); } ngx_shmtx_unlock(&shpool->mutex); } src/http/modules/ngx_http_limit_conn_module.c:363: error: Integer Overflow L2 ([0, +oo] - 1):unsigned16. src/http/modules/ngx_http_limit_conn_module.c:358:5: <LHS trace> 356. lc = (ngx_http_limit_conn_node_t *) &node->color; 357. 358. ngx_shmtx_lock(&shpool->mutex); ^ 359. 360. ngx_log_debug2(NGX_LOG_DEBUG_HTTP, lccln->shm_zone->shm.log, 0, src/http/modules/ngx_http_limit_conn_module.c:358:5: Call 356. lc = (ngx_http_limit_conn_node_t *) &node->color; 357. 358. ngx_shmtx_lock(&shpool->mutex); ^ 359. 360. ngx_log_debug2(NGX_LOG_DEBUG_HTTP, lccln->shm_zone->shm.log, 0, src/core/ngx_shmtx.c:69:1: Parameter `mtx->spin` 67. 68. 69. void ^ 70. ngx_shmtx_lock(ngx_shmtx_t *mtx) 71. { src/http/modules/ngx_http_limit_conn_module.c:363:5: Binary operation: ([0, +oo] - 1):unsigned16 361. "limit conn cleanup: %08XD %d", node->key, lc->conn); 362. 363. lc->conn--; ^ 364. 365. if (lc->conn == 0) {
https://github.com/nginx/nginx/blob/54ab41f27bc7e6cb09694c6e6f1fbc9a41034d1a/src/http/modules/ngx_http_limit_conn_module.c/#L363
d2a_code_trace_data_45079
static int bnrand(BNRAND_FLAG flag, BIGNUM *rnd, int bits, int top, int bottom, BN_CTX *ctx) { unsigned char *buf = NULL; int b, ret = 0, bit, bytes, mask; OPENSSL_CTX *libctx = bn_get_lib_ctx(ctx); 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; } b = flag == NORMAL ? rand_bytes_ex(libctx, buf, bytes) : rand_priv_bytes_ex(libctx, buf, bytes); if (b <= 0) goto err; if (flag == TESTING) { int i; unsigned char c; for (i = 0; i < bytes; i++) { if (rand_bytes_ex(libctx, &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:1947: error: BUFFER_OVERRUN_L3 Offset: [-1, 8] Size: [1, 9] by call to `BN_rand`. Showing all 12 steps of the trace test/bntest.c:1947:17: Call 1945. || !TEST_true(BN_rand(bn, 1, -1 /* top */ , 1 /* bottom */ )) 1946. || !TEST_BN_eq_one(bn) 1947. || !TEST_true(BN_rand(bn, 2, 1 /* top */ , 0 /* bottom */ )) ^ 1948. || !TEST_BN_eq_word(bn, 3)) 1949. goto err; crypto/bn/bn_rand.c:106:1: Parameter `bits` 104. return bnrand(NORMAL, rnd, bits, top, bottom, ctx); 105. } 106. > int BN_rand(BIGNUM *rnd, int bits, int top, int bottom) 107. { 108. return bnrand(NORMAL, rnd, bits, top, bottom, NULL); crypto/bn/bn_rand.c:108:12: Call 106. int BN_rand(BIGNUM *rnd, int bits, int top, int bottom) 107. { 108. return bnrand(NORMAL, rnd, bits, top, bottom, NULL); ^ 109. } 110. crypto/bn/bn_rand.c:62:14: <Offset trace> 60. unsigned char c; 61. 62. for (i = 0; i < bytes; i++) { ^ 63. if (rand_bytes_ex(libctx, &c, 1) <= 0) 64. goto err; crypto/bn/bn_rand.c:62:14: Assignment 60. unsigned char c; 61. 62. for (i = 0; i < bytes; i++) { ^ 63. if (rand_bytes_ex(libctx, &c, 1) <= 0) 64. goto err; crypto/bn/bn_rand.c:23:1: <Length trace> 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:23:1: Parameter `bits` 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:39:5: Assignment 37. goto toosmall; 38. 39. bytes = (bits + 7) / 8; ^ 40. bit = (bits - 1) % 8; 41. mask = 0xff << (bit + 1); crypto/bn/bn_rand.c:43:11: Call 41. mask = 0xff << (bit + 1); 42. 43. buf = OPENSSL_malloc(bytes); ^ 44. if (buf == NULL) { 45. BNerr(BN_F_BNRAND, ERR_R_MALLOC_FAILURE); crypto/mem.c:201:9: Assignment 199. 200. if (num == 0) 201. return NULL; ^ 202. 203. FAILTEST(); crypto/bn/bn_rand.c:43:5: Assignment 41. mask = 0xff << (bit + 1); 42. 43. buf = OPENSSL_malloc(bytes); ^ 44. if (buf == NULL) { 45. BNerr(BN_F_BNRAND, ERR_R_MALLOC_FAILURE); crypto/bn/bn_rand.c:88:9: Array access: Offset: [-1, 8] Size: [1, 9] by call to `BN_rand` 86. buf[0] &= ~mask; 87. if (bottom) /* set bottom bit if requested */ 88. buf[bytes - 1] |= 1; ^ 89. if (!BN_bin2bn(buf, bytes, rnd)) 90. goto err;
https://github.com/openssl/openssl/blob/bd01733fdd9a5a0acdc72cf5c6601d37e8ddd801/crypto/bn/bn_rand.c/#L88
d2a_code_trace_data_45080
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/dh/dh_key.c:188: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_MONT_CTX_set_locked`. Showing all 47 steps of the trace crypto/dh/dh_key.c:177:5: Call 175. if (ctx == NULL) 176. goto err; 177. BN_CTX_start(ctx); ^ 178. tmp = BN_CTX_get(ctx); 179. if (tmp == NULL) crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/dh/dh_key.c:188:16: Call 186. 187. if (dh->flags & DH_FLAG_CACHE_MONT_P) { 188. mont = BN_MONT_CTX_set_locked(&dh->method_mont_p, ^ 189. dh->lock, dh->p, ctx); 190. BN_set_flags(dh->priv_key, BN_FLG_CONSTTIME); crypto/bn/bn_mont.c:428:1: Parameter `ctx->stack.depth` 426. } 427. 428. > BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, CRYPTO_RWLOCK *lock, 429. const BIGNUM *mod, BN_CTX *ctx) 430. { crypto/bn/bn_mont.c:450:10: Call 448. if (ret == NULL) 449. return NULL; 450. if (!BN_MONT_CTX_set(ret, mod, ctx)) { ^ 451. BN_MONT_CTX_free(ret); 452. return NULL; crypto/bn/bn_mont.c:263:1: Parameter `ctx->stack.depth` 261. } 262. 263. > int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) 264. { 265. int i, ret = 0; crypto/bn/bn_mont.c:271:5: Call 269. return 0; 270. 271. BN_CTX_start(ctx); ^ 272. if ((Ri = BN_CTX_get(ctx)) == NULL) 273. goto err; crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_mont.c:272:15: Call 270. 271. BN_CTX_start(ctx); 272. if ((Ri = BN_CTX_get(ctx)) == NULL) ^ 273. goto err; 274. R = &(mont->RR); /* grab RR as a temp */ crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_mont.c:351:19: Call 349. if (BN_is_one(&tmod)) 350. BN_zero(Ri); 351. else if ((BN_mod_inverse(Ri, R, &tmod, ctx)) == NULL) ^ 352. goto err; 353. if (!BN_lshift(Ri, Ri, BN_BITS2)) crypto/bn/bn_gcd.c:124:1: Parameter `ctx->stack.depth` 122. BN_CTX *ctx); 123. 124. > BIGNUM *BN_mod_inverse(BIGNUM *in, 125. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx) 126. { crypto/bn/bn_gcd.c:129:10: Call 127. BIGNUM *rv; 128. int noinv; 129. rv = int_bn_mod_inverse(in, a, n, ctx, &noinv); ^ 130. if (noinv) 131. BNerr(BN_F_BN_MOD_INVERSE, BN_R_NO_INVERSE); crypto/bn/bn_gcd.c:135:1: Parameter `ctx->stack.depth` 133. } 134. 135. > BIGNUM *int_bn_mod_inverse(BIGNUM *in, 136. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx, 137. int *pnoinv) crypto/bn/bn_gcd.c:155:16: Call 153. if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0) 154. || (BN_get_flags(n, BN_FLG_CONSTTIME) != 0)) { 155. return BN_mod_inverse_no_branch(in, a, n, ctx); ^ 156. } 157. crypto/bn/bn_gcd.c:458:1: Parameter `ctx->stack.depth` 456. * not contain branches that may leak sensitive information. 457. */ 458. > static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in, 459. const BIGNUM *a, const BIGNUM *n, 460. BN_CTX *ctx) crypto/bn/bn_gcd.c:469:5: Call 467. bn_check_top(n); 468. 469. BN_CTX_start(ctx); ^ 470. A = BN_CTX_get(ctx); 471. B = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_gcd.c:470:9: Call 468. 469. BN_CTX_start(ctx); 470. A = BN_CTX_get(ctx); ^ 471. B = BN_CTX_get(ctx); 472. X = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:471:9: Call 469. BN_CTX_start(ctx); 470. A = BN_CTX_get(ctx); 471. B = BN_CTX_get(ctx); ^ 472. X = BN_CTX_get(ctx); 473. D = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:472:9: Call 470. A = BN_CTX_get(ctx); 471. B = BN_CTX_get(ctx); 472. X = BN_CTX_get(ctx); ^ 473. D = BN_CTX_get(ctx); 474. M = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:473:9: Call 471. B = BN_CTX_get(ctx); 472. X = BN_CTX_get(ctx); 473. D = BN_CTX_get(ctx); ^ 474. M = BN_CTX_get(ctx); 475. Y = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:474:9: Call 472. X = BN_CTX_get(ctx); 473. D = BN_CTX_get(ctx); 474. M = BN_CTX_get(ctx); ^ 475. Y = BN_CTX_get(ctx); 476. T = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:475:9: Call 473. D = BN_CTX_get(ctx); 474. M = BN_CTX_get(ctx); 475. Y = BN_CTX_get(ctx); ^ 476. T = BN_CTX_get(ctx); 477. if (T == NULL) crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:476:9: Call 474. M = BN_CTX_get(ctx); 475. Y = BN_CTX_get(ctx); 476. T = BN_CTX_get(ctx); ^ 477. if (T == NULL) 478. goto err; crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:504:18: Call 502. bn_init(&local_B); 503. BN_with_flags(&local_B, B, BN_FLG_CONSTTIME); 504. if (!BN_nnmod(B, &local_B, A, ctx)) ^ 505. goto err; 506. /* Ensure local_B goes out of scope before any further use of B */ crypto/bn/bn_mod.c:13:1: Parameter `ctx->stack.depth` 11. #include "bn_lcl.h" 12. 13. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx) 14. { 15. /* crypto/bn/bn_mod.c:20:11: Call 18. */ 19. 20. if (!(BN_mod(r, m, d, ctx))) ^ 21. return 0; 22. if (!r->neg) crypto/bn/bn_div.c:209:1: Parameter `ctx->stack.depth` 207. * If 'dv' or 'rm' is NULL, the respective value is not returned. 208. */ 209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 210. BN_CTX *ctx) 211. { crypto/bn/bn_div.c:229:11: Call 227. } 228. 229. ret = bn_div_fixed_top(dv, rm, num, divisor, ctx); ^ 230. 231. if (ret) { crypto/bn/bn_div.c:280:5: Call 278. bn_check_top(rm); 279. 280. BN_CTX_start(ctx); ^ 281. res = (dv == NULL) ? BN_CTX_get(ctx) : dv; 282. tmp = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:171:1: Parameter `*ctx->stack.indexes` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_div.c:450:5: Call 448. if (rm != NULL) 449. bn_rshift_fixed_top(rm, snum, norm_shift); 450. BN_CTX_end(ctx); ^ 451. return 1; 452. err: crypto/bn/bn_ctx.c:185:1: Parameter `*ctx->stack.indexes` 183. } 184. 185. > void BN_CTX_end(BN_CTX *ctx) 186. { 187. CTXDBG("ENTER BN_CTX_end()", ctx); crypto/bn/bn_ctx.c:191:27: Call 189. ctx->err_stack--; 190. else { 191. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 192. /* Does this stack frame have anything to release? */ 193. if (fp < ctx->used) crypto/bn/bn_ctx.c:266:1: <Offset trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `st->depth` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: <Length trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `*st->indexes` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:268:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_MONT_CTX_set_locked` 266. static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; ^ 269. } 270.
https://github.com/openssl/openssl/blob/18e1e302452e6dea4500b6f981cee7e151294dea/crypto/bn/bn_ctx.c/#L268
d2a_code_trace_data_45081
DH *ssl_get_auto_dh(SSL *s) { int dh_secbits = 80; if (s->cert->dh_tmp_auto == 2) return DH_get_1024_160(); if (s->s3->tmp.new_cipher->algorithm_auth & (SSL_aNULL | SSL_aPSK)) { if (s->s3->tmp.new_cipher->strength_bits == 256) dh_secbits = 128; else dh_secbits = 80; } else { CERT_PKEY *cpk = ssl_get_server_send_pkey(s); dh_secbits = EVP_PKEY_security_bits(cpk->privatekey); } if (dh_secbits >= 128) { DH *dhp = DH_new(); BIGNUM *p, *g; if (dhp == NULL) return NULL; g = BN_new(); if (g != NULL) BN_set_word(g, 2); if (dh_secbits >= 192) p = BN_get_rfc3526_prime_8192(NULL); else p = BN_get_rfc3526_prime_3072(NULL); if (p == NULL || g == NULL || !DH_set0_pqg(dhp, p, NULL, g)) { DH_free(dhp); BN_free(p); BN_free(g); return NULL; } return dhp; } if (dh_secbits >= 112) return DH_get_2048_224(); return DH_get_1024_160(); } ssl/t1_lib.c:4091: error: NULL_DEREFERENCE pointer `cpk` last assigned on line 4090 could be null and is dereferenced at line 4091, column 45. Showing all 30 steps of the trace ssl/t1_lib.c:4079:1: start of procedure ssl_get_auto_dh() 4077. 4078. #ifndef OPENSSL_NO_DH 4079. > DH *ssl_get_auto_dh(SSL *s) 4080. { 4081. int dh_secbits = 80; ssl/t1_lib.c:4081:5: 4079. DH *ssl_get_auto_dh(SSL *s) 4080. { 4081. > int dh_secbits = 80; 4082. if (s->cert->dh_tmp_auto == 2) 4083. return DH_get_1024_160(); ssl/t1_lib.c:4082:9: Taking false branch 4080. { 4081. int dh_secbits = 80; 4082. if (s->cert->dh_tmp_auto == 2) ^ 4083. return DH_get_1024_160(); 4084. if (s->s3->tmp.new_cipher->algorithm_auth & (SSL_aNULL | SSL_aPSK)) { ssl/t1_lib.c:4084:9: Taking false branch 4082. if (s->cert->dh_tmp_auto == 2) 4083. return DH_get_1024_160(); 4084. if (s->s3->tmp.new_cipher->algorithm_auth & (SSL_aNULL | SSL_aPSK)) { ^ 4085. if (s->s3->tmp.new_cipher->strength_bits == 256) 4086. dh_secbits = 128; ssl/t1_lib.c:4090:9: 4088. dh_secbits = 80; 4089. } else { 4090. > CERT_PKEY *cpk = ssl_get_server_send_pkey(s); 4091. dh_secbits = EVP_PKEY_security_bits(cpk->privatekey); 4092. } ssl/ssl_lib.c:2773:1: start of procedure ssl_get_server_send_pkey() 2771. } 2772. 2773. > CERT_PKEY *ssl_get_server_send_pkey(SSL *s) 2774. { 2775. CERT *c; ssl/ssl_lib.c:2778:5: 2776. int i; 2777. 2778. > c = s->cert; 2779. if (!s->s3 || !s->s3->tmp.new_cipher) 2780. return NULL; ssl/ssl_lib.c:2779:10: Taking false branch 2777. 2778. c = s->cert; 2779. if (!s->s3 || !s->s3->tmp.new_cipher) ^ 2780. return NULL; 2781. ssl_set_masks(s); ssl/ssl_lib.c:2779:20: Taking false branch 2777. 2778. c = s->cert; 2779. if (!s->s3 || !s->s3->tmp.new_cipher) ^ 2780. return NULL; 2781. ssl_set_masks(s); ssl/ssl_lib.c:2781:5: Skipping ssl_set_masks(): empty list of specs 2779. if (!s->s3 || !s->s3->tmp.new_cipher) 2780. return NULL; 2781. ssl_set_masks(s); ^ 2782. 2783. i = ssl_get_server_cert_index(s); ssl/ssl_lib.c:2783:5: 2781. ssl_set_masks(s); 2782. 2783. > i = ssl_get_server_cert_index(s); 2784. 2785. /* This may or may not be an error. */ ssl/ssl_lib.c:2752:1: start of procedure ssl_get_server_cert_index() 2750. #endif 2751. 2752. > static int ssl_get_server_cert_index(const SSL *s) 2753. { 2754. int idx; ssl/ssl_lib.c:2755:5: 2753. { 2754. int idx; 2755. > idx = ssl_cipher_get_cert_index(s->s3->tmp.new_cipher); 2756. if (idx == SSL_PKEY_RSA_ENC && !s->cert->pkeys[SSL_PKEY_RSA_ENC].x509) 2757. idx = SSL_PKEY_RSA_SIGN; ssl/ssl_ciph.c:1979:1: start of procedure ssl_cipher_get_cert_index() 1977. 1978. /* For a cipher return the index corresponding to the certificate type */ 1979. > int ssl_cipher_get_cert_index(const SSL_CIPHER *c) 1980. { 1981. uint32_t alg_a; ssl/ssl_ciph.c:1983:5: 1981. uint32_t alg_a; 1982. 1983. > alg_a = c->algorithm_auth; 1984. 1985. if (alg_a & SSL_aECDSA) ssl/ssl_ciph.c:1985:9: Taking false branch 1983. alg_a = c->algorithm_auth; 1984. 1985. if (alg_a & SSL_aECDSA) ^ 1986. return SSL_PKEY_ECC; 1987. else if (alg_a & SSL_aDSS) ssl/ssl_ciph.c:1987:14: Taking false branch 1985. if (alg_a & SSL_aECDSA) 1986. return SSL_PKEY_ECC; 1987. else if (alg_a & SSL_aDSS) ^ 1988. return SSL_PKEY_DSA_SIGN; 1989. else if (alg_a & SSL_aRSA) ssl/ssl_ciph.c:1989:14: Taking true branch 1987. else if (alg_a & SSL_aDSS) 1988. return SSL_PKEY_DSA_SIGN; 1989. else if (alg_a & SSL_aRSA) ^ 1990. return SSL_PKEY_RSA_ENC; 1991. else if (alg_a & SSL_aGOST12) ssl/ssl_ciph.c:1990:9: 1988. return SSL_PKEY_DSA_SIGN; 1989. else if (alg_a & SSL_aRSA) 1990. > return SSL_PKEY_RSA_ENC; 1991. else if (alg_a & SSL_aGOST12) 1992. return SSL_PKEY_GOST_EC; ssl/ssl_ciph.c:1997:1: return from a call to ssl_cipher_get_cert_index 1995. 1996. return -1; 1997. > } 1998. 1999. const SSL_CIPHER *ssl_get_cipher_by_char(SSL *ssl, const unsigned char *ptr) ssl/ssl_lib.c:2756:9: Taking true branch 2754. int idx; 2755. idx = ssl_cipher_get_cert_index(s->s3->tmp.new_cipher); 2756. if (idx == SSL_PKEY_RSA_ENC && !s->cert->pkeys[SSL_PKEY_RSA_ENC].x509) ^ 2757. idx = SSL_PKEY_RSA_SIGN; 2758. if (idx == SSL_PKEY_GOST_EC) { ssl/ssl_lib.c:2756:37: Taking false branch 2754. int idx; 2755. idx = ssl_cipher_get_cert_index(s->s3->tmp.new_cipher); 2756. if (idx == SSL_PKEY_RSA_ENC && !s->cert->pkeys[SSL_PKEY_RSA_ENC].x509) ^ 2757. idx = SSL_PKEY_RSA_SIGN; 2758. if (idx == SSL_PKEY_GOST_EC) { ssl/ssl_lib.c:2758:9: Taking false branch 2756. if (idx == SSL_PKEY_RSA_ENC && !s->cert->pkeys[SSL_PKEY_RSA_ENC].x509) 2757. idx = SSL_PKEY_RSA_SIGN; 2758. if (idx == SSL_PKEY_GOST_EC) { ^ 2759. if (s->cert->pkeys[SSL_PKEY_GOST12_512].x509) 2760. idx = SSL_PKEY_GOST12_512; ssl/ssl_lib.c:2768:9: Taking false branch 2766. idx = -1; 2767. } 2768. if (idx == -1) ^ 2769. SSLerr(SSL_F_SSL_GET_SERVER_CERT_INDEX, ERR_R_INTERNAL_ERROR); 2770. return idx; ssl/ssl_lib.c:2770:5: 2768. if (idx == -1) 2769. SSLerr(SSL_F_SSL_GET_SERVER_CERT_INDEX, ERR_R_INTERNAL_ERROR); 2770. > return idx; 2771. } 2772. ssl/ssl_lib.c:2771:1: return from a call to ssl_get_server_cert_index 2769. SSLerr(SSL_F_SSL_GET_SERVER_CERT_INDEX, ERR_R_INTERNAL_ERROR); 2770. return idx; 2771. > } 2772. 2773. CERT_PKEY *ssl_get_server_send_pkey(SSL *s) ssl/ssl_lib.c:2786:9: Taking true branch 2784. 2785. /* This may or may not be an error. */ 2786. if (i < 0) ^ 2787. return NULL; 2788. ssl/ssl_lib.c:2787:9: 2785. /* This may or may not be an error. */ 2786. if (i < 0) 2787. > return NULL; 2788. 2789. /* May be NULL. */ ssl/ssl_lib.c:2791:1: return from a call to ssl_get_server_send_pkey 2789. /* May be NULL. */ 2790. return &c->pkeys[i]; 2791. > } 2792. 2793. EVP_PKEY *ssl_get_sign_pkey(SSL *s, const SSL_CIPHER *cipher, ssl/t1_lib.c:4091:9: 4089. } else { 4090. CERT_PKEY *cpk = ssl_get_server_send_pkey(s); 4091. > dh_secbits = EVP_PKEY_security_bits(cpk->privatekey); 4092. } 4093.
https://github.com/openssl/openssl/blob/2ac7753c107e71bfdcaa08b18eb4e6683292be57/ssl/t1_lib.c/#L4091
d2a_code_trace_data_45082
int X509_STORE_add_cert(X509_STORE *ctx, X509 *x) { X509_OBJECT *obj; int ret = 1; if (x == NULL) return 0; obj = OPENSSL_malloc(sizeof(*obj)); if (obj == NULL) { X509err(X509_F_X509_STORE_ADD_CERT, ERR_R_MALLOC_FAILURE); return 0; } obj->type = X509_LU_X509; obj->data.x509 = x; CRYPTO_w_lock(CRYPTO_LOCK_X509_STORE); X509_OBJECT_up_ref_count(obj); if (X509_OBJECT_retrieve_match(ctx->objs, obj)) { X509_OBJECT_free_contents(obj); OPENSSL_free(obj); X509err(X509_F_X509_STORE_ADD_CERT, X509_R_CERT_ALREADY_IN_HASH_TABLE); ret = 0; } else sk_X509_OBJECT_push(ctx->objs, obj); CRYPTO_w_unlock(CRYPTO_LOCK_X509_STORE); return ret; } crypto/x509/x509_lu.c:354: error: MEMORY_LEAK memory dynamically allocated by call to `CRYPTO_malloc()` at line 335, column 11 is not reachable after line 354, column 9. Showing all 61 steps of the trace crypto/x509/x509_lu.c:328:1: start of procedure X509_STORE_add_cert() 326. } 327. 328. > int X509_STORE_add_cert(X509_STORE *ctx, X509 *x) 329. { 330. X509_OBJECT *obj; crypto/x509/x509_lu.c:331:5: 329. { 330. X509_OBJECT *obj; 331. > int ret = 1; 332. 333. if (x == NULL) crypto/x509/x509_lu.c:333:9: Taking false branch 331. int ret = 1; 332. 333. if (x == NULL) ^ 334. return 0; 335. obj = OPENSSL_malloc(sizeof(*obj)); crypto/x509/x509_lu.c:335:5: 333. if (x == NULL) 334. return 0; 335. > obj = OPENSSL_malloc(sizeof(*obj)); 336. if (obj == NULL) { 337. X509err(X509_F_X509_STORE_ADD_CERT, ERR_R_MALLOC_FAILURE); 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/x509/x509_lu.c:336:9: Taking false branch 334. return 0; 335. obj = OPENSSL_malloc(sizeof(*obj)); 336. if (obj == NULL) { ^ 337. X509err(X509_F_X509_STORE_ADD_CERT, ERR_R_MALLOC_FAILURE); 338. return 0; crypto/x509/x509_lu.c:340:5: 338. return 0; 339. } 340. > obj->type = X509_LU_X509; 341. obj->data.x509 = x; 342. crypto/x509/x509_lu.c:341:5: 339. } 340. obj->type = X509_LU_X509; 341. > obj->data.x509 = x; 342. 343. CRYPTO_w_lock(CRYPTO_LOCK_X509_STORE); crypto/x509/x509_lu.c:343:5: 341. obj->data.x509 = x; 342. 343. > CRYPTO_w_lock(CRYPTO_LOCK_X509_STORE); 344. 345. X509_OBJECT_up_ref_count(obj); 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 true branch 450. CRYPTO_destroy_dynlockid(type); 451. } 452. } else if (locking_callback != NULL) ^ 453. locking_callback(mode, type, file, line); 454. } crypto/lock.c:453:9: Skipping __function_pointer__(): unresolved function pointer 451. } 452. } else if (locking_callback != NULL) 453. locking_callback(mode, type, file, line); ^ 454. } 455. 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/x509/x509_lu.c:345:5: 343. CRYPTO_w_lock(CRYPTO_LOCK_X509_STORE); 344. 345. > X509_OBJECT_up_ref_count(obj); 346. 347. if (X509_OBJECT_retrieve_match(ctx->objs, obj)) { crypto/x509/x509_lu.c:393:1: start of procedure X509_OBJECT_up_ref_count() 391. } 392. 393. > void X509_OBJECT_up_ref_count(X509_OBJECT *a) 394. { 395. switch (a->type) { crypto/x509/x509_lu.c:395:5: 393. void X509_OBJECT_up_ref_count(X509_OBJECT *a) 394. { 395. > switch (a->type) { 396. default: 397. break; crypto/x509/x509_lu.c:398:5: Switch condition is true. Entering switch case 396. default: 397. break; 398. case X509_LU_X509: ^ 399. X509_up_ref(a->data.x509); 400. break; crypto/x509/x509_lu.c:399:9: 397. break; 398. case X509_LU_X509: 399. > X509_up_ref(a->data.x509); 400. break; 401. case X509_LU_CRL: crypto/x509/x509_set.c:150:1: start of procedure X509_up_ref() 148. } 149. 150. > void X509_up_ref(X509 *x) 151. { 152. CRYPTO_add(&x->references, 1, CRYPTO_LOCK_X509); crypto/x509/x509_set.c:152:5: 150. void X509_up_ref(X509 *x) 151. { 152. > CRYPTO_add(&x->references, 1, CRYPTO_LOCK_X509); 153. } 154. 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 true branch 459. int ret = 0; 460. 461. if (add_lock_callback != NULL) { ^ 462. #ifdef LOCK_DEBUG 463. int before = *pointer; crypto/lock.c:466:9: Skipping __function_pointer__(): unresolved function pointer 464. #endif 465. 466. ret = add_lock_callback(pointer, amount, type, file, line); ^ 467. #ifdef LOCK_DEBUG 468. { 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/x509/x509_set.c:153:1: return from a call to X509_up_ref 151. { 152. CRYPTO_add(&x->references, 1, CRYPTO_LOCK_X509); 153. > } 154. 155. long X509_get_version(X509 *x) crypto/x509/x509_lu.c:405:1: return from a call to X509_OBJECT_up_ref_count 403. break; 404. } 405. > } 406. 407. void X509_OBJECT_free_contents(X509_OBJECT *a) crypto/x509/x509_lu.c:347:9: Taking false branch 345. X509_OBJECT_up_ref_count(obj); 346. 347. if (X509_OBJECT_retrieve_match(ctx->objs, obj)) { ^ 348. X509_OBJECT_free_contents(obj); 349. OPENSSL_free(obj); crypto/x509/x509_lu.c:354:9: 352. ret = 0; 353. } else 354. > sk_X509_OBJECT_push(ctx->objs, obj); 355. 356. CRYPTO_w_unlock(CRYPTO_LOCK_X509_STORE); include/openssl/x509_vfy.h:124:1: start of procedure sk_X509_OBJECT_push() 122. 123. DEFINE_STACK_OF(X509_LOOKUP) 124. > DEFINE_STACK_OF(X509_OBJECT) 125. 126. /* This is a static that defines the function interface */ crypto/stack/stack.c:259:1: start of procedure sk_push() 257. } 258. 259. > int sk_push(_STACK *st, void *data) 260. { 261. return (sk_insert(st, data, st->num)); crypto/stack/stack.c:261:5: 259. int sk_push(_STACK *st, void *data) 260. { 261. > return (sk_insert(st, data, st->num)); 262. } 263. crypto/stack/stack.c:167:1: start of procedure sk_insert() 165. } 166. 167. > int sk_insert(_STACK *st, void *data, int loc) 168. { 169. char **s; crypto/stack/stack.c:171:9: Taking false branch 169. char **s; 170. 171. if (st == NULL) ^ 172. return 0; 173. if (st->num_alloc <= st->num + 1) { crypto/stack/stack.c:173:9: Taking true branch 171. if (st == NULL) 172. return 0; 173. if (st->num_alloc <= st->num + 1) { ^ 174. s = OPENSSL_realloc((char *)st->data, 175. (unsigned int)sizeof(char *) * st->num_alloc * 2); crypto/stack/stack.c:174:9: 172. return 0; 173. if (st->num_alloc <= st->num + 1) { 174. > s = OPENSSL_realloc((char *)st->data, 175. (unsigned int)sizeof(char *) * st->num_alloc * 2); 176. if (s == NULL) crypto/mem.c:166:1: start of procedure CRYPTO_realloc() 164. } 165. 166. > void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) 167. { 168. if (str == NULL) crypto/mem.c:168:9: Taking true branch 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) 167. { 168. if (str == NULL) ^ 169. return CRYPTO_malloc(num, file, line); 170. crypto/mem.c:169:9: 167. { 168. if (str == NULL) 169. > return CRYPTO_malloc(num, file, line); 170. 171. if (num == 0) { crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking true branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:125:9: 123. 124. if (num <= 0) 125. > return NULL; 126. 127. allow_customize = 0; crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:191:1: return from a call to CRYPTO_realloc 189. return realloc(str, num); 190. 191. > } 192. 193. void *CRYPTO_clear_realloc(void *str, size_t old_len, size_t num, crypto/stack/stack.c:176:13: Taking true branch 174. s = OPENSSL_realloc((char *)st->data, 175. (unsigned int)sizeof(char *) * st->num_alloc * 2); 176. if (s == NULL) ^ 177. return (0); 178. st->data = s; crypto/stack/stack.c:177:13: 175. (unsigned int)sizeof(char *) * st->num_alloc * 2); 176. if (s == NULL) 177. > return (0); 178. st->data = s; 179. st->num_alloc *= 2; crypto/stack/stack.c:191:1: return from a call to sk_insert 189. st->sorted = 0; 190. return (st->num); 191. > } 192. 193. void *sk_delete_ptr(_STACK *st, void *p) crypto/stack/stack.c:262:1: return from a call to sk_push 260. { 261. return (sk_insert(st, data, st->num)); 262. > } 263. 264. int sk_unshift(_STACK *st, void *data) include/openssl/x509_vfy.h:124:1: return from a call to sk_X509_OBJECT_push 122. 123. DEFINE_STACK_OF(X509_LOOKUP) 124. > DEFINE_STACK_OF(X509_OBJECT) 125. 126. /* This is a static that defines the function interface */
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/crypto/x509/x509_lu.c/#L354
d2a_code_trace_data_45083
static int rtsp_read_announce(AVFormatContext *s) { RTSPState *rt = s->priv_data; RTSPMessageHeader request = { 0 }; char sdp[4096]; int ret; ret = rtsp_read_request(s, &request, "ANNOUNCE"); if (ret) return ret; rt->seq++; if (strcmp(request.content_type, "application/sdp")) { av_log(s, AV_LOG_ERROR, "Unexpected content type %s\n", request.content_type); rtsp_send_reply(s, RTSP_STATUS_SERVICE, NULL, request.seq); return AVERROR_OPTION_NOT_FOUND; } if (request.content_length && request.content_length < sizeof(sdp) - 1) { if (ffurl_read_complete(rt->rtsp_hd, sdp, request.content_length) < request.content_length) { av_log(s, AV_LOG_ERROR, "Unable to get complete SDP Description in ANNOUNCE\n"); rtsp_send_reply(s, RTSP_STATUS_INTERNAL, NULL, request.seq); return AVERROR(EIO); } sdp[request.content_length] = '\0'; av_log(s, AV_LOG_VERBOSE, "SDP: %s\n", sdp); ret = ff_sdp_parse(s, sdp); if (ret) return ret; rtsp_send_reply(s, RTSP_STATUS_OK, NULL, request.seq); return 0; } av_log(s, AV_LOG_ERROR, "Content-Length header value exceeds sdp allocated buffer (4KB)\n"); rtsp_send_reply(s, RTSP_STATUS_INTERNAL, "Content-Length exceeds buffer size", request.seq); return AVERROR(EIO); } libavformat/rtspdec.c:183: error: Null Dereference pointer `null` is dereferenced by call to `rtsp_send_reply()` at line 183, column 9. libavformat/rtspdec.c:169:1: start of procedure rtsp_read_announce() 167. } 168. 169. static int rtsp_read_announce(AVFormatContext *s) ^ 170. { 171. RTSPState *rt = s->priv_data; libavformat/rtspdec.c:171:5: 169. static int rtsp_read_announce(AVFormatContext *s) 170. { 171. RTSPState *rt = s->priv_data; ^ 172. RTSPMessageHeader request = { 0 }; 173. char sdp[4096]; libavformat/rtspdec.c:172:5: 170. { 171. RTSPState *rt = s->priv_data; 172. RTSPMessageHeader request = { 0 }; ^ 173. char sdp[4096]; 174. int ret; libavformat/rtspdec.c:176:5: Skipping rtsp_read_request(): empty list of specs 174. int ret; 175. 176. ret = rtsp_read_request(s, &request, "ANNOUNCE"); ^ 177. if (ret) 178. return ret; libavformat/rtspdec.c:177:9: Taking false branch 175. 176. ret = rtsp_read_request(s, &request, "ANNOUNCE"); 177. if (ret) ^ 178. return ret; 179. rt->seq++; libavformat/rtspdec.c:179:5: 177. if (ret) 178. return ret; 179. rt->seq++; ^ 180. if (strcmp(request.content_type, "application/sdp")) { 181. av_log(s, AV_LOG_ERROR, "Unexpected content type %s\n", libavformat/rtspdec.c:180:9: Taking true branch 178. return ret; 179. rt->seq++; 180. if (strcmp(request.content_type, "application/sdp")) { ^ 181. av_log(s, AV_LOG_ERROR, "Unexpected content type %s\n", 182. request.content_type); libavformat/rtspdec.c:181:9: Skipping av_log(): empty list of specs 179. rt->seq++; 180. if (strcmp(request.content_type, "application/sdp")) { 181. av_log(s, AV_LOG_ERROR, "Unexpected content type %s\n", ^ 182. request.content_type); 183. rtsp_send_reply(s, RTSP_STATUS_SERVICE, NULL, request.seq); libavformat/rtspdec.c:183:9: 181. av_log(s, AV_LOG_ERROR, "Unexpected content type %s\n", 182. request.content_type); 183. rtsp_send_reply(s, RTSP_STATUS_SERVICE, NULL, request.seq); ^ 184. return AVERROR_OPTION_NOT_FOUND; 185. } libavformat/rtspdec.c:94:1: start of procedure rtsp_send_reply() 92. } 93. 94. static int rtsp_send_reply(AVFormatContext *s, enum RTSPStatusCode code, ^ 95. const char *extracontent, uint16_t seq) 96. { libavformat/rtspdec.c:97:5: 95. const char *extracontent, uint16_t seq) 96. { 97. RTSPState *rt = s->priv_data; ^ 98. char message[4096]; 99. int index = 0; libavformat/rtspdec.c:99:5: 97. RTSPState *rt = s->priv_data; 98. char message[4096]; 99. int index = 0; ^ 100. while (status_messages[index].code) { 101. if (status_messages[index].code == code) { libavformat/rtspdec.c:100:12: Loop condition is true. Entering loop body 98. char message[4096]; 99. int index = 0; 100. while (status_messages[index].code) { ^ 101. if (status_messages[index].code == code) { 102. snprintf(message, sizeof(message), "RTSP/1.0 %d %s\r\n", libavformat/rtspdec.c:101:13: Taking false branch 99. int index = 0; 100. while (status_messages[index].code) { 101. if (status_messages[index].code == code) { ^ 102. snprintf(message, sizeof(message), "RTSP/1.0 %d %s\r\n", 103. code, status_messages[index].message); libavformat/rtspdec.c:106:9: 104. break; 105. } 106. index++; ^ 107. } 108. if (!status_messages[index].code) libavformat/rtspdec.c:100:12: Loop condition is true. Entering loop body 98. char message[4096]; 99. int index = 0; 100. while (status_messages[index].code) { ^ 101. if (status_messages[index].code == code) { 102. snprintf(message, sizeof(message), "RTSP/1.0 %d %s\r\n", libavformat/rtspdec.c:101:13: Taking false branch 99. int index = 0; 100. while (status_messages[index].code) { 101. if (status_messages[index].code == code) { ^ 102. snprintf(message, sizeof(message), "RTSP/1.0 %d %s\r\n", 103. code, status_messages[index].message); libavformat/rtspdec.c:106:9: 104. break; 105. } 106. index++; ^ 107. } 108. if (!status_messages[index].code) libavformat/rtspdec.c:100:12: Loop condition is true. Entering loop body 98. char message[4096]; 99. int index = 0; 100. while (status_messages[index].code) { ^ 101. if (status_messages[index].code == code) { 102. snprintf(message, sizeof(message), "RTSP/1.0 %d %s\r\n", libavformat/rtspdec.c:101:13: Taking false branch 99. int index = 0; 100. while (status_messages[index].code) { 101. if (status_messages[index].code == code) { ^ 102. snprintf(message, sizeof(message), "RTSP/1.0 %d %s\r\n", 103. code, status_messages[index].message); libavformat/rtspdec.c:106:9: 104. break; 105. } 106. index++; ^ 107. } 108. if (!status_messages[index].code) libavformat/rtspdec.c:100:12: Loop condition is false. Leaving loop 98. char message[4096]; 99. int index = 0; 100. while (status_messages[index].code) { ^ 101. if (status_messages[index].code == code) { 102. snprintf(message, sizeof(message), "RTSP/1.0 %d %s\r\n", libavformat/rtspdec.c:108:10: Taking true branch 106. index++; 107. } 108. if (!status_messages[index].code) ^ 109. return AVERROR(EINVAL); 110. av_strlcatf(message, sizeof(message), "CSeq: %d\r\n", seq); libavformat/rtspdec.c:109:9: 107. } 108. if (!status_messages[index].code) 109. return AVERROR(EINVAL); ^ 110. av_strlcatf(message, sizeof(message), "CSeq: %d\r\n", seq); 111. av_strlcatf(message, sizeof(message), "Server: %s\r\n", LIBAVFORMAT_IDENT); libavformat/rtspdec.c:119:1: return from a call to rtsp_send_reply 117. 118. return 0; 119. } ^ 120. 121. static inline int check_sessionid(AVFormatContext *s,
https://github.com/libav/libav/blob/0aa907cfb1bbc647ee4b6da62fac5c89d7b4d318/libavformat/rtspdec.c/#L183
d2a_code_trace_data_45084
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/ssl_lib.c:5140: error: BUFFER_OVERRUN_S2 Offset: [`prefix->strlen` + 2, +oo] Size: [1, 2⋅`parameter_2_len` + 2⋅`parameter_1_len` + `prefix->strlen` + 3]. Showing all 7 steps of the trace 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:6: Assignment 5132. cursor += 2; 5133. } 5134. *cursor++ = ' '; ^ 5135. 5136. for (i = 0; i < parameter_2_len; i++) { ssl/ssl_lib.c:5140:5: Array access: Offset: [prefix->strlen + 2, +oo] Size: [1, 2⋅parameter_2_len + 2⋅parameter_1_len + prefix->strlen + 3] 5138. cursor += 2; 5139. } 5140. *cursor = '\0'; ^ 5141. 5142. ssl->ctx->keylog_callback(ssl, (const char *)out);
https://github.com/openssl/openssl/blob/fb9c3ff565aa11b08646e0f9f28fc082ed365cbd/ssl/ssl_lib.c/#L5140
d2a_code_trace_data_45085
static int sbr_make_f_master(AACContext *ac, SpectralBandReplication *sbr, SpectrumParameters *spectrum) { unsigned int temp, max_qmf_subbands; unsigned int start_min, stop_min; int k; const int8_t *sbr_offset_ptr; int16_t stop_dk[13]; if (sbr->sample_rate < 32000) { temp = 3000; } else if (sbr->sample_rate < 64000) { temp = 4000; } else temp = 5000; start_min = ((temp << 7) + (sbr->sample_rate >> 1)) / sbr->sample_rate; stop_min = ((temp << 8) + (sbr->sample_rate >> 1)) / sbr->sample_rate; switch (sbr->sample_rate) { case 16000: sbr_offset_ptr = sbr_offset[0]; break; case 22050: sbr_offset_ptr = sbr_offset[1]; break; case 24000: sbr_offset_ptr = sbr_offset[2]; break; case 32000: sbr_offset_ptr = sbr_offset[3]; break; case 44100: case 48000: case 64000: sbr_offset_ptr = sbr_offset[4]; break; case 88200: case 96000: case 128000: case 176400: case 192000: sbr_offset_ptr = sbr_offset[5]; break; default: av_log(ac->avccontext, AV_LOG_ERROR, "Unsupported sample rate for SBR: %d\n", sbr->sample_rate); return -1; } sbr->k[0] = start_min + sbr_offset_ptr[spectrum->bs_start_freq]; if (spectrum->bs_stop_freq < 14) { sbr->k[2] = stop_min; make_bands(stop_dk, stop_min, 64, 13); qsort(stop_dk, 13, sizeof(stop_dk[0]), qsort_comparison_function_int16); for (k = 0; k < spectrum->bs_stop_freq; k++) sbr->k[2] += stop_dk[k]; } else if (spectrum->bs_stop_freq == 14) { sbr->k[2] = 2*sbr->k[0]; } else if (spectrum->bs_stop_freq == 15) { sbr->k[2] = 3*sbr->k[0]; } else { av_log(ac->avccontext, AV_LOG_ERROR, "Invalid bs_stop_freq: %d\n", spectrum->bs_stop_freq); return -1; } sbr->k[2] = FFMIN(64, sbr->k[2]); if (sbr->sample_rate <= 32000) { max_qmf_subbands = 48; } else if (sbr->sample_rate == 44100) { max_qmf_subbands = 35; } else if (sbr->sample_rate >= 48000) max_qmf_subbands = 32; if (sbr->k[2] - sbr->k[0] > max_qmf_subbands) { av_log(ac->avccontext, AV_LOG_ERROR, "Invalid bitstream, too many QMF subbands: %d\n", sbr->k[2] - sbr->k[0]); return -1; } if (!spectrum->bs_freq_scale) { unsigned int dk; int k2diff; dk = spectrum->bs_alter_scale + 1; sbr->n_master = ((sbr->k[2] - sbr->k[0] + (dk&2)) >> dk) << 1; if (check_n_master(ac->avccontext, sbr->n_master, sbr->spectrum_params.bs_xover_band)) return -1; for (k = 1; k <= sbr->n_master; k++) sbr->f_master[k] = dk; k2diff = sbr->k[2] - sbr->k[0] - sbr->n_master * dk; if (k2diff < 0) { sbr->f_master[1]--; sbr->f_master[2]-= (k2diff < 1); } else if (k2diff) { sbr->f_master[sbr->n_master]++; } sbr->f_master[0] = sbr->k[0]; for (k = 1; k <= sbr->n_master; k++) sbr->f_master[k] += sbr->f_master[k - 1]; } else { int half_bands = 7 - spectrum->bs_freq_scale; int two_regions, num_bands_0; int vdk0_max, vdk1_min; int16_t vk0[49]; if (49 * sbr->k[2] > 110 * sbr->k[0]) { two_regions = 1; sbr->k[1] = 2 * sbr->k[0]; } else { two_regions = 0; sbr->k[1] = sbr->k[2]; } num_bands_0 = lrintf(half_bands * log2f(sbr->k[1] / (float)sbr->k[0])) * 2; if (num_bands_0 <= 0) { av_log(ac->avccontext, AV_LOG_ERROR, "Invalid num_bands_0: %d\n", num_bands_0); return -1; } vk0[0] = 0; make_bands(vk0+1, sbr->k[0], sbr->k[1], num_bands_0); qsort(vk0 + 1, num_bands_0, sizeof(vk0[1]), qsort_comparison_function_int16); vdk0_max = vk0[num_bands_0]; vk0[0] = sbr->k[0]; for (k = 1; k <= num_bands_0; k++) { if (vk0[k] <= 0) { av_log(ac->avccontext, AV_LOG_ERROR, "Invalid vDk0[%d]: %d\n", k, vk0[k]); return -1; } vk0[k] += vk0[k-1]; } if (two_regions) { int16_t vk1[49]; float invwarp = spectrum->bs_alter_scale ? 0.76923076923076923077f : 1.0f; int num_bands_1 = lrintf(half_bands * invwarp * log2f(sbr->k[2] / (float)sbr->k[1])) * 2; make_bands(vk1+1, sbr->k[1], sbr->k[2], num_bands_1); vdk1_min = array_min_int16(vk1 + 1, num_bands_1); if (vdk1_min < vdk0_max) { int change; qsort(vk1 + 1, num_bands_1, sizeof(vk1[1]), qsort_comparison_function_int16); change = FFMIN(vdk0_max - vk1[1], (vk1[num_bands_1] - vk1[1]) >> 1); vk1[1] += change; vk1[num_bands_1] -= change; } qsort(vk1 + 1, num_bands_1, sizeof(vk1[1]), qsort_comparison_function_int16); vk1[0] = sbr->k[1]; for (k = 1; k <= num_bands_1; k++) { if (vk1[k] <= 0) { av_log(ac->avccontext, AV_LOG_ERROR, "Invalid vDk1[%d]: %d\n", k, vk1[k]); return -1; } vk1[k] += vk1[k-1]; } sbr->n_master = num_bands_0 + num_bands_1; if (check_n_master(ac->avccontext, sbr->n_master, sbr->spectrum_params.bs_xover_band)) return -1; memcpy(&sbr->f_master[0], vk0, (num_bands_0 + 1) * sizeof(sbr->f_master[0])); memcpy(&sbr->f_master[num_bands_0 + 1], vk1 + 1, num_bands_1 * sizeof(sbr->f_master[0])); } else { sbr->n_master = num_bands_0; if (check_n_master(ac->avccontext, sbr->n_master, sbr->spectrum_params.bs_xover_band)) return -1; memcpy(sbr->f_master, vk0, (num_bands_0 + 1) * sizeof(sbr->f_master[0])); } } return 0; } libavcodec/aac.c:2041: error: Integer Overflow L2 ([0, +oo] - 1):unsigned16 by call to `decode_extension_payload`. libavcodec/aac.c:2017:19: Call 2015. 2016. case TYPE_DSE: 2017. err = skip_data_stream_element(ac, &gb); ^ 2018. break; 2019. libavcodec/aac.c:600:1: Parameter `*ac->avccontext` 598. * Skip data_stream_element; reference: table 4.10. 599. */ 600. static int skip_data_stream_element(AACContext *ac, GetBitContext *gb) ^ 601. { 602. int byte_align = get_bits1(gb); libavcodec/aac.c:2041:28: Call 2039. } 2040. while (elem_id > 0) 2041. elem_id -= decode_extension_payload(ac, &gb, elem_id, che_prev, elem_type_prev); ^ 2042. err = 0; /* FIXME */ 2043. break; libavcodec/aac.c:1644:1: Parameter `che->sbr.f_master[*]` 1642. * @return Returns number of bytes consumed 1643. */ 1644. static int decode_extension_payload(AACContext *ac, GetBitContext *gb, int cnt, ^ 1645. ChannelElement *che, enum RawDataBlockType elem_type) 1646. { libavcodec/aac.c:1667:15: Call 1665. ac->m4ac.sbr = 1; 1666. } 1667. res = ff_decode_sbr_extension(ac, &che->sbr, gb, crc_flag, cnt, elem_type); ^ 1668. break; 1669. case EXT_DYNAMIC_RANGE: libavcodec/aacsbr.c:1050:1: Parameter `sbr->f_master[*]` 1048. * @return Returns number of bytes consumed from the TYPE_FIL element. 1049. */ 1050. int ff_decode_sbr_extension(AACContext *ac, SpectralBandReplication *sbr, ^ 1051. GetBitContext *gb_host, int crc, int cnt, int id_aac) 1052. { libavcodec/aacsbr.c:1079:9: Call 1077. 1078. if (sbr->reset) 1079. sbr_reset(ac, sbr); ^ 1080. 1081. if (sbr->start) libavcodec/aacsbr.c:1029:1: Parameter `sbr->f_master[*]` 1027. } 1028. 1029. static void sbr_reset(AACContext *ac, SpectralBandReplication *sbr) ^ 1030. { 1031. int err; libavcodec/aacsbr.c:1032:11: Call 1030. { 1031. int err; 1032. err = sbr_make_f_master(ac, sbr, &sbr->spectrum_params); ^ 1033. if (err >= 0) 1034. err = sbr_make_f_derived(ac, sbr); libavcodec/aacsbr.c:313:1: <LHS trace> 311. 312. /// Master Frequency Band Table (14496-3 sp04 p194) 313. static int sbr_make_f_master(AACContext *ac, SpectralBandReplication *sbr, ^ 314. SpectrumParameters *spectrum) 315. { libavcodec/aacsbr.c:313:1: Parameter `sbr->f_master[*]` 311. 312. /// Master Frequency Band Table (14496-3 sp04 p194) 313. static int sbr_make_f_master(AACContext *ac, SpectralBandReplication *sbr, ^ 314. SpectrumParameters *spectrum) 315. { libavcodec/aacsbr.c:404:13: Binary operation: ([0, +oo] - 1):unsigned16 by call to `decode_extension_payload` 402. k2diff = sbr->k[2] - sbr->k[0] - sbr->n_master * dk; 403. if (k2diff < 0) { 404. sbr->f_master[1]--; ^ 405. sbr->f_master[2]-= (k2diff < 1); 406. } else if (k2diff) {
https://github.com/libav/libav/blob/76561924cf3d9789653dc72d696f119862616891/libavcodec/aacsbr.c/#L404
d2a_code_trace_data_45086
static inline int encode_line(FFV1Context *s, int w, int_fast16_t *sample[2], int plane_index, int bits){ PlaneContext * const p= &s->plane[plane_index]; RangeCoder * const c= &s->c; int x; int run_index= s->run_index; int run_count=0; int run_mode=0; if(s->ac){ if(c->bytestream_end - c->bytestream < w*20){ av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n"); return -1; } }else{ if(s->pb.buf_end - s->pb.buf - (put_bits_count(&s->pb)>>3) < w*4){ av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n"); return -1; } } for(x=0; x<w; x++){ int diff, context; context= get_context(s, sample[0]+x, sample[1]+x, sample[2]+x); diff= sample[0][x] - predict(sample[0]+x, sample[1]+x); if(context < 0){ context = -context; diff= -diff; } diff= fold(diff, bits); if(s->ac){ put_symbol(c, p->state[context], diff, 1); }else{ if(context == 0) run_mode=1; if(run_mode){ if(diff){ while(run_count >= 1<<log2_run[run_index]){ run_count -= 1<<log2_run[run_index]; run_index++; put_bits(&s->pb, 1, 1); } put_bits(&s->pb, 1 + log2_run[run_index], run_count); if(run_index) run_index--; run_count=0; run_mode=0; if(diff>0) diff--; }else{ run_count++; } } if(run_mode == 0) put_vlc_symbol(&s->pb, &p->vlc_state[context], diff, bits); } } if(run_mode){ while(run_count >= 1<<log2_run[run_index]){ run_count -= 1<<log2_run[run_index]; run_index++; put_bits(&s->pb, 1, 1); } if(run_count) put_bits(&s->pb, 1, 1); } s->run_index= run_index; return 0; } libavcodec/ffv1.c:493: error: Buffer Overrun L2 Offset: [2, 4] (⇐ [0, 2] + 2) Size: 3 by call to `encode_line`. libavcodec/ffv1.c:462:60: Array declaration 460. int x, y, p, i; 461. const int ring_size= s->avctx->context_model ? 3 : 2; 462. int_fast16_t sample_buffer[3][ring_size][w+6], *sample[3][ring_size]; ^ 463. s->run_index=0; 464. libavcodec/ffv1.c:493:13: Call 491. sample[p][0][-1]= sample[p][1][0 ]; 492. sample[p][1][ w]= sample[p][1][w-1]; 493. encode_line(s, w, sample[p], FFMIN(p, 1), 9); ^ 494. } 495. } libavcodec/ffv1.c:358:1: <Length trace> 356. 357. #ifdef CONFIG_ENCODERS 358. static inline int encode_line(FFV1Context *s, int w, int_fast16_t *sample[2], int plane_index, int bits){ ^ 359. PlaneContext * const p= &s->plane[plane_index]; 360. RangeCoder * const c= &s->c; libavcodec/ffv1.c:358:1: Parameter `*sample` 356. 357. #ifdef CONFIG_ENCODERS 358. static inline int encode_line(FFV1Context *s, int w, int_fast16_t *sample[2], int plane_index, int bits){ ^ 359. PlaneContext * const p= &s->plane[plane_index]; 360. RangeCoder * const c= &s->c; libavcodec/ffv1.c:381:59: Array access: Offset: [2, 4] (⇐ [0, 2] + 2) Size: 3 by call to `encode_line` 379. int diff, context; 380. 381. context= get_context(s, sample[0]+x, sample[1]+x, sample[2]+x); ^ 382. diff= sample[0][x] - predict(sample[0]+x, sample[1]+x); 383.
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/ffv1.c/#L381
d2a_code_trace_data_45087
static int do_file(const char *filename, const char *fullpath, enum Hash h) { STACK_OF (X509_INFO) *inf; X509_INFO *x; X509_NAME *name = NULL; BIO *b; const char *ext; unsigned char digest[EVP_MAX_MD_SIZE]; int i, type, ret = -1; if ((ext = strrchr(filename, '.')) == NULL) return 0; for (i = 0; i < (int)OSSL_NELEM(extensions); i++) { if (strcasecmp(extensions[i], ext + 1) == 0) break; } if (i >= (int)OSSL_NELEM(extensions)) return -1; if ((b = BIO_new_file(fullpath, "r")) == NULL) return -1; inf = PEM_X509_INFO_read_bio(b, NULL, NULL, NULL); BIO_free(b); if (inf == NULL) return -1; if (sk_X509_INFO_num(inf) != 1) { BIO_printf(bio_err, "%s: skipping %s," "it does not contain exactly one certificate or CRL\n", opt_getprog(), filename); goto end; } x = sk_X509_INFO_value(inf, 0); if (x->x509) { type = TYPE_CERT; name = X509_get_subject_name(x->x509); X509_digest(x->x509, evpmd, digest, NULL); } else if (x->crl) { type = TYPE_CRL; name = X509_CRL_get_issuer(x->crl); X509_CRL_digest(x->crl, evpmd, digest, NULL); } if (name) { if ((h == HASH_NEW) || (h == HASH_BOTH)) add_entry(type, X509_NAME_hash(name), filename, digest, 1, ~0); if ((h == HASH_OLD) || (h == HASH_BOTH)) add_entry(type, X509_NAME_hash_old(name), filename, digest, 1, ~0); } end: sk_X509_INFO_pop_free(inf, X509_INFO_free); return ret; } apps/rehash.c:268: error: UNINITIALIZED_VALUE The value read from type was never initialized. Showing all 1 steps of the trace apps/rehash.c:268:13: 266. add_entry(type, X509_NAME_hash(name), filename, digest, 1, ~0); 267. if ((h == HASH_OLD) || (h == HASH_BOTH)) 268. > add_entry(type, X509_NAME_hash_old(name), filename, digest, 1, ~0); 269. } 270.
https://github.com/openssl/openssl/blob/aec27d4d5210234560deab85c97bd453535f66ae/apps/rehash.c/#L268
d2a_code_trace_data_45088
DECLAREContigPutFunc(put2bitcmaptile) { uint32** PALmap = img->PALmap; (void) x; (void) y; fromskew /= 4; while (h-- > 0) { uint32* bw; UNROLL4(w, bw = PALmap[*pp++], *cp++ = *bw++); cp += toskew; pp += fromskew; } } libtiff/tif_getimage.c:1112: error: Integer Overflow L2 ([0, `h`] - 1):unsigned32. libtiff/tif_getimage.c:1106:1: <LHS trace> 1104. * 2-bit palette => colormap/RGB 1105. */ 1106. DECLAREContigPutFunc(put2bitcmaptile) ^ 1107. { 1108. uint32** PALmap = img->PALmap; libtiff/tif_getimage.c:1106:1: Parameter `h` 1104. * 2-bit palette => colormap/RGB 1105. */ 1106. DECLAREContigPutFunc(put2bitcmaptile) ^ 1107. { 1108. uint32** PALmap = img->PALmap; libtiff/tif_getimage.c:1112:12: Binary operation: ([0, h] - 1):unsigned32 1110. (void) x; (void) y; 1111. fromskew /= 4; 1112. while (h-- > 0) { ^ 1113. uint32* bw; 1114. UNROLL4(w, bw = PALmap[*pp++], *cp++ = *bw++);
https://gitlab.com/libtiff/libtiff/blob/771a4ea0a98c7a218c9f3add9a05e08d29625758/libtiff/tif_getimage.c/#L1112
d2a_code_trace_data_45089
int tls1_set_sigalgs(CERT *c, const int *psig_nids, size_t salglen, int client) { uint16_t *sigalgs, *sptr; size_t i; if (salglen & 1) return 0; sigalgs = OPENSSL_malloc((salglen / 2) * sizeof(*sigalgs)); if (sigalgs == NULL) return 0; for (i = 0, sptr = sigalgs; i < salglen; i += 2) { size_t j; const SIGALG_LOOKUP *curr; int md_id = *psig_nids++; int sig_id = *psig_nids++; for (j = 0, curr = sigalg_lookup_tbl; j < OSSL_NELEM(sigalg_lookup_tbl); j++, curr++) { if (curr->hash == md_id && curr->sig == sig_id) { *sptr++ = curr->sigalg; break; } } if (j == OSSL_NELEM(sigalg_lookup_tbl)) goto err; } if (client) { OPENSSL_free(c->client_sigalgs); c->client_sigalgs = sigalgs; c->client_sigalgslen = salglen / 2; } else { OPENSSL_free(c->conf_sigalgs); c->conf_sigalgs = sigalgs; c->conf_sigalgslen = salglen / 2; } return 1; err: OPENSSL_free(sigalgs); return 0; } ssl/t1_lib.c:1802: error: BUFFER_OVERRUN_L1 Offset: [0, +oo] Size: 0 by call to `tls1_set_sigalgs`. Showing all 9 steps of the trace ssl/t1_lib.c:1797:5: Assignment 1795. { 1796. sig_cb_st sig; 1797. sig.sigalgcnt = 0; ^ 1798. if (!CONF_parse_list(str, ':', 1, sig_cb, &sig)) 1799. return 0; ssl/t1_lib.c:1802:12: Call 1800. if (c == NULL) 1801. return 1; 1802. return tls1_set_sigalgs(c, sig.sigalgs, sig.sigalgcnt, client); ^ 1803. } 1804. ssl/t1_lib.c:1805:1: <Length trace> 1803. } 1804. 1805. > int tls1_set_sigalgs(CERT *c, const int *psig_nids, size_t salglen, int client) 1806. { 1807. uint16_t *sigalgs, *sptr; ssl/t1_lib.c:1805:1: Parameter `salglen` 1803. } 1804. 1805. > int tls1_set_sigalgs(CERT *c, const int *psig_nids, size_t salglen, int client) 1806. { 1807. uint16_t *sigalgs, *sptr; ssl/t1_lib.c:1812:15: Call 1810. if (salglen & 1) 1811. return 0; 1812. sigalgs = OPENSSL_malloc((salglen / 2) * sizeof(*sigalgs)); ^ 1813. if (sigalgs == NULL) 1814. return 0; crypto/mem.c:166:9: Assignment 164. 165. if (num <= 0) 166. return NULL; ^ 167. 168. FAILTEST(); ssl/t1_lib.c:1812:5: Assignment 1810. if (salglen & 1) 1811. return 0; 1812. sigalgs = OPENSSL_malloc((salglen / 2) * sizeof(*sigalgs)); ^ 1813. if (sigalgs == NULL) 1814. return 0; ssl/t1_lib.c:1815:17: Assignment 1813. if (sigalgs == NULL) 1814. return 0; 1815. for (i = 0, sptr = sigalgs; i < salglen; i += 2) { ^ 1816. size_t j; 1817. const SIGALG_LOOKUP *curr; ssl/t1_lib.c:1824:17: Array access: Offset: [0, +oo] Size: 0 by call to `tls1_set_sigalgs` 1822. j++, curr++) { 1823. if (curr->hash == md_id && curr->sig == sig_id) { 1824. *sptr++ = curr->sigalg; ^ 1825. break; 1826. }
https://github.com/openssl/openssl/blob/cdf516d988807671bfda18bad135b26c3fac8888/ssl/t1_lib.c/#L1824
d2a_code_trace_data_45090
static int epzs_motion_search4(MpegEncContext * s, int *mx_ptr, int *my_ptr, int P[10][2], int src_index, int ref_index, int16_t (*last_mv)[2], int ref_mv_scale) { MotionEstContext * const c= &s->me; int best[2]={0, 0}; int d, dmin; int map_generation; const int penalty_factor= c->penalty_factor; const int size=1; const int h=8; const int ref_mv_stride= s->mb_stride; const int ref_mv_xy= s->mb_x + s->mb_y *ref_mv_stride; me_cmp_func cmpf, chroma_cmpf; LOAD_COMMON int flags= c->flags; LOAD_COMMON2 cmpf= s->dsp.me_cmp[size]; chroma_cmpf= s->dsp.me_cmp[size+1]; map_generation= update_map_generation(c); dmin = 1000000; if (s->first_slice_line) { CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift) CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16) CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift) }else{ CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift) CHECK_MV(P_MEDIAN[0]>>shift, P_MEDIAN[1]>>shift) CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift) CHECK_MV(P_TOP[0]>>shift, P_TOP[1]>>shift) CHECK_MV(P_TOPRIGHT[0]>>shift, P_TOPRIGHT[1]>>shift) CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16) } if(dmin>64*4){ CHECK_CLIPPED_MV((last_mv[ref_mv_xy+1][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy+1][1]*ref_mv_scale + (1<<15))>>16) if(s->mb_y+1<s->end_mb_y) CHECK_CLIPPED_MV((last_mv[ref_mv_xy+ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy+ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16) } dmin= diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags); *mx_ptr= best[0]; *my_ptr= best[1]; return dmin; } libavcodec/motion_est_template.c:1166: error: Uninitialized Value The value read from ymin was never initialized. libavcodec/motion_est_template.c:1166:9: 1164. CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift) 1165. //FIXME try some early stop 1166. CHECK_MV(P_MEDIAN[0]>>shift, P_MEDIAN[1]>>shift) ^ 1167. CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift) 1168. CHECK_MV(P_TOP[0]>>shift, P_TOP[1]>>shift)
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1166
d2a_code_trace_data_45091
static int tls_curve_allowed(SSL *s, const unsigned char *curve, int op) { const tls_curve_info *cinfo; if (curve[0]) return 1; if ((curve[1] < 1) || ((size_t)curve[1] > sizeof(nid_list) / sizeof(nid_list[0]))) return 0; cinfo = &nid_list[curve[1] - 1]; # ifdef OPENSSL_NO_EC2M if (cinfo->flags & TLS_CURVE_CHAR2) return 0; # endif return ssl_security(s, op, cinfo->secbits, cinfo->nid, (void *)curve); } ssl/d1_clnt.c:424: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: 28 by call to `ssl3_get_key_exchange`. Showing all 11 steps of the trace ssl/d1_clnt.c:162:1: Parameter `*s->init_msg` 160. dtls1_get_client_method, DTLSv1_2_enc_data) 161. 162. > int dtls1_connect(SSL *s) 163. { 164. BUF_MEM *buf = NULL; ssl/d1_clnt.c:424:19: Call 422. case SSL3_ST_CR_KEY_EXCH_A: 423. case SSL3_ST_CR_KEY_EXCH_B: 424. ret = ssl3_get_key_exchange(s); ^ 425. if (ret <= 0) 426. goto end; ssl/s3_clnt.c:1318:1: Parameter `*s->init_msg` 1316. } 1317. 1318. > int ssl3_get_key_exchange(SSL *s) 1319. { 1320. #ifndef OPENSSL_NO_RSA ssl/s3_clnt.c:1768:14: Call 1766. * invalid curve. ECParameters is 3 bytes. 1767. */ 1768. if (!tls1_check_curve(s, p, 3)) { ^ 1769. SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_WRONG_CURVE); 1770. goto f_err; ssl/t1_lib.c:273:1: Array declaration 271. }; 272. 273. > static const unsigned char eccurves_default[] = { 274. 0, 14, /* sect571r1 (14) */ 275. 0, 13, /* sect571k1 (13) */ ssl/t1_lib.c:484:20: Call 482. for (i = 0; i < num_curves; i++, curves += 2) { 483. if (p[1] == curves[0] && p[2] == curves[1]) 484. return tls_curve_allowed(s, p + 1, SSL_SECOP_CURVE_CHECK); ^ 485. } 486. return 0; ssl/t1_lib.c:442:1: <Offset trace> 440. 441. /* See if curve is allowed by security callback */ 442. > static int tls_curve_allowed(SSL *s, const unsigned char *curve, int op) 443. { 444. const tls_curve_info *cinfo; ssl/t1_lib.c:442:1: Parameter `*curve` 440. 441. /* See if curve is allowed by security callback */ 442. > static int tls_curve_allowed(SSL *s, const unsigned char *curve, int op) 443. { 444. const tls_curve_info *cinfo; ssl/t1_lib.c:236:1: <Length trace> 234. # define TLS_CURVE_PRIME 0x0 235. 236. > static const tls_curve_info nid_list[] = { 237. {NID_sect163k1, 80, TLS_CURVE_CHAR2}, /* sect163k1 (1) */ 238. {NID_sect163r1, 80, TLS_CURVE_CHAR2}, /* sect163r1 (2) */ ssl/t1_lib.c:236:1: Array declaration 234. # define TLS_CURVE_PRIME 0x0 235. 236. > static const tls_curve_info nid_list[] = { 237. {NID_sect163k1, 80, TLS_CURVE_CHAR2}, /* sect163k1 (1) */ 238. {NID_sect163r1, 80, TLS_CURVE_CHAR2}, /* sect163r1 (2) */ ssl/t1_lib.c:450:5: Array access: Offset: [-1, +oo] Size: 28 by call to `ssl3_get_key_exchange` 448. sizeof(nid_list) / sizeof(nid_list[0]))) 449. return 0; 450. cinfo = &nid_list[curve[1] - 1]; ^ 451. # ifdef OPENSSL_NO_EC2M 452. if (cinfo->flags & TLS_CURVE_CHAR2)
https://github.com/openssl/openssl/blob/9c46f4b9cd4912b61cb546c48b678488d7f26ed6/ssl/t1_lib.c/#L450
d2a_code_trace_data_45092
void *lh_delete(_LHASH *lh, const void *data) { unsigned long hash; LHASH_NODE *nn, **rn; void *ret; lh->error = 0; rn = getrn(lh, data, &hash); if (*rn == NULL) { lh->num_no_delete++; return (NULL); } else { nn = *rn; *rn = nn->next; ret = nn->data; OPENSSL_free(nn); lh->num_delete++; } lh->num_items--; if ((lh->num_nodes > MIN_NODES) && (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes))) contract(lh); return (ret); } ssl/s3_clnt.c:1275: error: INTEGER_OVERFLOW_L2 ([0, max(0, `s->ctx->sessions->num_items`)] - 1):unsigned64 by call to `ssl3_send_alert`. Showing all 11 steps of the trace ssl/s3_clnt.c:927:1: Parameter `s->ctx->sessions->num_items` 925. } 926. 927. > int ssl3_get_server_hello(SSL *s) 928. { 929. STACK_OF(SSL_CIPHER) *sk; ssl/s3_clnt.c:1275:5: Call 1273. return (1); 1274. f_err: 1275. ssl3_send_alert(s, SSL3_AL_FATAL, al); ^ 1276. err: 1277. s->state = SSL_ST_ERR; ssl/s3_msg.c:166:1: Parameter `s->ctx->sessions->num_items` 164. } 165. 166. > int ssl3_send_alert(SSL *s, int level, int desc) 167. { 168. /* Map tls/ssl alert value to correct one */ ssl/s3_msg.c:177:9: Call 175. /* If a fatal one, remove from cache */ 176. if ((level == SSL3_AL_FATAL) && (s->session != NULL)) 177. SSL_CTX_remove_session(s->ctx, s->session); ^ 178. 179. s->s3->alert_dispatch = 1; ssl/ssl_sess.c:776:1: Parameter `ctx->sessions->num_items` 774. } 775. 776. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 777. { 778. return remove_session_lock(ctx, c, 1); ssl/ssl_sess.c:778:12: Call 776. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 777. { 778. return remove_session_lock(ctx, c, 1); ^ 779. } 780. ssl/ssl_sess.c:781:1: Parameter `ctx->sessions->num_items` 779. } 780. 781. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck) 782. { 783. SSL_SESSION *r; ssl/ssl_sess.c:791:17: Call 789. if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) == c) { 790. ret = 1; 791. r = lh_SSL_SESSION_delete(ctx->sessions, c); ^ 792. SSL_SESSION_list_remove(ctx, c); 793. } crypto/lhash/lhash.c:189:1: <LHS trace> 187. } 188. 189. > void *lh_delete(_LHASH *lh, const void *data) 190. { 191. unsigned long hash; crypto/lhash/lhash.c:189:1: Parameter `lh->num_items` 187. } 188. 189. > void *lh_delete(_LHASH *lh, const void *data) 190. { 191. unsigned long hash; crypto/lhash/lhash.c:209:5: Binary operation: ([0, max(0, s->ctx->sessions->num_items)] - 1):unsigned64 by call to `ssl3_send_alert` 207. } 208. 209. lh->num_items--; ^ 210. if ((lh->num_nodes > MIN_NODES) && 211. (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
https://github.com/openssl/openssl/blob/f8e0a5573820bd7318782d4954c6643ff7e58102/crypto/lhash/lhash.c/#L209
d2a_code_trace_data_45093
static int createCroppedImage(struct image_data *image, struct crop_mask *crop, unsigned char **read_buff_ptr, unsigned char **crop_buff_ptr) { tsize_t cropsize; unsigned char *read_buff = NULL; unsigned char *crop_buff = NULL; unsigned char *new_buff = NULL; static tsize_t prev_cropsize = 0; read_buff = *read_buff_ptr; crop_buff = read_buff; *crop_buff_ptr = read_buff; crop->combined_width = image->width; crop->combined_length = image->length; cropsize = crop->bufftotal; crop_buff = *crop_buff_ptr; if (!crop_buff) { crop_buff = (unsigned char *)_TIFFmalloc(cropsize); *crop_buff_ptr = crop_buff; _TIFFmemset(crop_buff, 0, cropsize); prev_cropsize = cropsize; } else { if (prev_cropsize < cropsize) { new_buff = _TIFFrealloc(crop_buff, cropsize); if (!new_buff) { free (crop_buff); crop_buff = (unsigned char *)_TIFFmalloc(cropsize); } else crop_buff = new_buff; _TIFFmemset(crop_buff, 0, cropsize); } } if (!crop_buff) { TIFFError("createCroppedImage", "Unable to allocate/reallocate crop buffer"); return (-1); } *crop_buff_ptr = crop_buff; if (crop->crop_mode & CROP_INVERT) { switch (crop->photometric) { case PHOTOMETRIC_MINISWHITE: case PHOTOMETRIC_MINISBLACK: image->photometric = crop->photometric; break; case INVERT_DATA_ONLY: case INVERT_DATA_AND_TAG: if (invertImage(image->photometric, image->spp, image->bps, crop->combined_width, crop->combined_length, crop_buff)) { TIFFError("createCroppedImage", "Failed to invert colorspace for image or cropped selection"); return (-1); } if (crop->photometric == INVERT_DATA_AND_TAG) { switch (image->photometric) { case PHOTOMETRIC_MINISWHITE: image->photometric = PHOTOMETRIC_MINISBLACK; break; case PHOTOMETRIC_MINISBLACK: image->photometric = PHOTOMETRIC_MINISWHITE; break; default: break; } } break; default: break; } } if (crop->crop_mode & CROP_MIRROR) { if (mirrorImage(image->spp, image->bps, crop->mirror, crop->combined_width, crop->combined_length, crop_buff)) { TIFFError("createCroppedImage", "Failed to mirror image or cropped selection %s", (crop->rotation == MIRROR_HORIZ) ? "horizontally" : "vertically"); return (-1); } } if (crop->crop_mode & CROP_ROTATE) { if (rotateImage(crop->rotation, image, &crop->combined_width, &crop->combined_length, crop_buff_ptr)) { TIFFError("createCroppedImage", "Failed to rotate image or cropped selection by %d degrees", crop->rotation); return (-1); } } if (crop_buff == read_buff) *read_buff_ptr = NULL; return (0); } tools/tiffcrop.c:7466: error: Null Dereference pointer `crop_buff` last assigned on line 7464 could be null and is dereferenced by call to `_TIFFmemset()` at line 7466, column 5. tools/tiffcrop.c:7442:1: start of procedure createCroppedImage() 7440. * the most optimized path when no Zones or Regions are required. 7441. */ 7442. static int ^ 7443. createCroppedImage(struct image_data *image, struct crop_mask *crop, 7444. unsigned char **read_buff_ptr, unsigned char **crop_buff_ptr) tools/tiffcrop.c:7447:3: 7445. { 7446. tsize_t cropsize; 7447. unsigned char *read_buff = NULL; ^ 7448. unsigned char *crop_buff = NULL; 7449. unsigned char *new_buff = NULL; tools/tiffcrop.c:7448:3: 7446. tsize_t cropsize; 7447. unsigned char *read_buff = NULL; 7448. unsigned char *crop_buff = NULL; ^ 7449. unsigned char *new_buff = NULL; 7450. static tsize_t prev_cropsize = 0; tools/tiffcrop.c:7449:3: 7447. unsigned char *read_buff = NULL; 7448. unsigned char *crop_buff = NULL; 7449. unsigned char *new_buff = NULL; ^ 7450. static tsize_t prev_cropsize = 0; 7451. tools/tiffcrop.c:7450:3: 7448. unsigned char *crop_buff = NULL; 7449. unsigned char *new_buff = NULL; 7450. static tsize_t prev_cropsize = 0; ^ 7451. 7452. read_buff = *read_buff_ptr; tools/tiffcrop.c:7452:3: 7450. static tsize_t prev_cropsize = 0; 7451. 7452. read_buff = *read_buff_ptr; ^ 7453. 7454. /* process full image, no crop buffer needed */ tools/tiffcrop.c:7455:3: 7453. 7454. /* process full image, no crop buffer needed */ 7455. crop_buff = read_buff; ^ 7456. *crop_buff_ptr = read_buff; 7457. crop->combined_width = image->width; tools/tiffcrop.c:7456:3: 7454. /* process full image, no crop buffer needed */ 7455. crop_buff = read_buff; 7456. *crop_buff_ptr = read_buff; ^ 7457. crop->combined_width = image->width; 7458. crop->combined_length = image->length; tools/tiffcrop.c:7457:3: 7455. crop_buff = read_buff; 7456. *crop_buff_ptr = read_buff; 7457. crop->combined_width = image->width; ^ 7458. crop->combined_length = image->length; 7459. tools/tiffcrop.c:7458:3: 7456. *crop_buff_ptr = read_buff; 7457. crop->combined_width = image->width; 7458. crop->combined_length = image->length; ^ 7459. 7460. cropsize = crop->bufftotal; tools/tiffcrop.c:7460:3: 7458. crop->combined_length = image->length; 7459. 7460. cropsize = crop->bufftotal; ^ 7461. crop_buff = *crop_buff_ptr; 7462. if (!crop_buff) tools/tiffcrop.c:7461:3: 7459. 7460. cropsize = crop->bufftotal; 7461. crop_buff = *crop_buff_ptr; ^ 7462. if (!crop_buff) 7463. { tools/tiffcrop.c:7462:8: Taking true branch 7460. cropsize = crop->bufftotal; 7461. crop_buff = *crop_buff_ptr; 7462. if (!crop_buff) ^ 7463. { 7464. crop_buff = (unsigned char *)_TIFFmalloc(cropsize); tools/tiffcrop.c:7464:5: 7462. if (!crop_buff) 7463. { 7464. crop_buff = (unsigned char *)_TIFFmalloc(cropsize); ^ 7465. *crop_buff_ptr = crop_buff; 7466. _TIFFmemset(crop_buff, 0, cropsize); 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/tiffcrop.c:7465:5: 7463. { 7464. crop_buff = (unsigned char *)_TIFFmalloc(cropsize); 7465. *crop_buff_ptr = crop_buff; ^ 7466. _TIFFmemset(crop_buff, 0, cropsize); 7467. prev_cropsize = cropsize; tools/tiffcrop.c:7466:5: 7464. crop_buff = (unsigned char *)_TIFFmalloc(cropsize); 7465. *crop_buff_ptr = crop_buff; 7466. _TIFFmemset(crop_buff, 0, cropsize); ^ 7467. prev_cropsize = cropsize; 7468. } libtiff/tif_unix.c:271:1: start of procedure _TIFFmemset() 269. } 270. 271. void ^ 272. _TIFFmemset(void* p, int v, tmsize_t c) 273. { libtiff/tif_unix.c:274:2: 272. _TIFFmemset(void* p, int v, tmsize_t c) 273. { 274. memset(p, v, (size_t) c); ^ 275. } 276. libtiff/tif_unix.c:275:1: return from a call to _TIFFmemset 273. { 274. memset(p, v, (size_t) c); 275. } ^ 276. 277. void
https://gitlab.com/libtiff/libtiff/blob/b69a1998bedfabc32cd541408bffdef05bd01e45/tools/tiffcrop.c/#L7466
d2a_code_trace_data_45094
static int opt_streamid(const char *opt, const char *arg) { int idx; char *p; char idx_str[16]; strncpy(idx_str, arg, sizeof(idx_str)); idx_str[sizeof(idx_str)-1] = '\0'; p = strchr(idx_str, ':'); if (!p) { fprintf(stderr, "Invalid value '%s' for option '%s', required syntax is 'index:value'\n", arg, opt); ffmpeg_exit(1); } *p++ = '\0'; idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1); streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1); streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX); return 0; } ffmpeg.c:3696: error: Null Dereference pointer `p` last assigned on line 3696 could be null and is dereferenced at line 3696, column 5. ffmpeg.c:3681:1: start of procedure opt_streamid() 3679. 3680. /* arg format is "output-stream-index:streamid-value". */ 3681. static int opt_streamid(const char *opt, const char *arg) ^ 3682. { 3683. int idx; ffmpeg.c:3687:5: 3685. char idx_str[16]; 3686. 3687. strncpy(idx_str, arg, sizeof(idx_str)); ^ 3688. idx_str[sizeof(idx_str)-1] = '\0'; 3689. p = strchr(idx_str, ':'); ffmpeg.c:3688:5: 3686. 3687. strncpy(idx_str, arg, sizeof(idx_str)); 3688. idx_str[sizeof(idx_str)-1] = '\0'; ^ 3689. p = strchr(idx_str, ':'); 3690. if (!p) { ffmpeg.c:3689:5: 3687. strncpy(idx_str, arg, sizeof(idx_str)); 3688. idx_str[sizeof(idx_str)-1] = '\0'; 3689. p = strchr(idx_str, ':'); ^ 3690. if (!p) { 3691. fprintf(stderr, ffmpeg.c:3690:10: Taking true branch 3688. idx_str[sizeof(idx_str)-1] = '\0'; 3689. p = strchr(idx_str, ':'); 3690. if (!p) { ^ 3691. fprintf(stderr, 3692. "Invalid value '%s' for option '%s', required syntax is 'index:value'\n", ffmpeg.c:3691:9: 3689. p = strchr(idx_str, ':'); 3690. if (!p) { 3691. fprintf(stderr, ^ 3692. "Invalid value '%s' for option '%s', required syntax is 'index:value'\n", 3693. arg, opt); ffmpeg.c:3694:9: Skipping ffmpeg_exit(): empty list of specs 3692. "Invalid value '%s' for option '%s', required syntax is 'index:value'\n", 3693. arg, opt); 3694. ffmpeg_exit(1); ^ 3695. } 3696. *p++ = '\0'; ffmpeg.c:3696:5: 3694. ffmpeg_exit(1); 3695. } 3696. *p++ = '\0'; ^ 3697. idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1); 3698. streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1);
https://github.com/libav/libav/blob/87e4d9b252bc6fa3b982f7050013069c9dc3e05b/ffmpeg.c/#L3696
d2a_code_trace_data_45095
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/alsdec.c:1426: error: Integer Overflow L2 ([-2, +oo] - 1):unsigned32 by call to `read_block`. libavcodec/alsdec.c:1402:9: Call 1400. bd.prev_raw_samples = ctx->prev_raw_samples; 1401. 1402. get_block_sizes(ctx, div_blocks, &bs_info); ^ 1403. 1404. for (b = 0; b < ctx->num_blocks; b++) { libavcodec/alsdec.c:504:1: Parameter `ctx->bc.bits_left` 502. * actual number of samples. 503. */ 504. static void get_block_sizes(ALSDecContext *ctx, unsigned int *div_blocks, ^ 505. uint32_t *bs_info) 506. { libavcodec/alsdec.c:1426:28: Call 1424. bd.raw_other = NULL; 1425. 1426. if ((ret = read_block(ctx, &bd)) < 0) ^ 1427. return ret; 1428. if ((ret = read_channel_data(ctx, ctx->chan_data[c], c)) < 0) libavcodec/alsdec.c:968:1: Parameter `ctx->bc.bits_left` 966. /** Read the block data. 967. */ 968. static int read_block(ALSDecContext *ctx, ALSBlockData *bd) ^ 969. { 970. int ret = 0; libavcodec/alsdec.c:975:9: Call 973. *bd->shift_lsbs = 0; 974. // read block type flag and read the samples accordingly 975. if (bitstream_read_bit(bc)) { ^ 976. ret = read_var_block_data(ctx, bd); 977. } else { libavcodec/bitstream.h:145:1: Parameter `bc->bits_left` 143. 144. /* Return one bit from the buffer. */ 145. static inline unsigned bitstream_read_bit(BitstreamContext *bc) ^ 146. { 147. if (!bc->bits_left) libavcodec/bitstream.h:150:12: Call 148. refill_64(bc); 149. 150. return get_val(bc, 1); ^ 151. } 152. libavcodec/bitstream.h:130:1: Parameter `n` 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:139:5: Assignment 137. bc->bits <<= n; 138. #endif 139. bc->bits_left -= n; ^ 140. 141. return ret; libavcodec/alsdec.c:976:15: Call 974. // read block type flag and read the samples accordingly 975. if (bitstream_read_bit(bc)) { 976. ret = read_var_block_data(ctx, bd); ^ 977. } else { 978. read_const_block_data(ctx, bd); libavcodec/alsdec.c:596:1: Parameter `ctx->bc.bits_left` 594. /** Read the block data for a non-constant block 595. */ 596. static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd) ^ 597. { 598. ALSSpecificConfig *sconf = &ctx->sconf; libavcodec/alsdec.c:616:23: Call 614. 615. *bd->opt_order = 1; 616. bd->js_blocks = bitstream_read_bit(bc); ^ 617. 618. opt_order = *bd->opt_order; libavcodec/bitstream.h:145:1: Parameter `bc->bits_left` 143. 144. /* Return one bit from the buffer. */ 145. static inline unsigned bitstream_read_bit(BitstreamContext *bc) ^ 146. { 147. if (!bc->bits_left) libavcodec/bitstream.h:150:12: Call 148. refill_64(bc); 149. 150. return get_val(bc, 1); ^ 151. } 152. libavcodec/bitstream.h:130:1: Parameter `n` 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:139:5: Assignment 137. bc->bits <<= n; 138. #endif 139. bc->bits_left -= n; ^ 140. 141. return ret; libavcodec/alsdec.c:627:35: Call 625. log2_sub_blocks = bitstream_read(bc, 2); 626. else 627. log2_sub_blocks = 2 * bitstream_read_bit(bc); ^ 628. } 629. libavcodec/bitstream.h:145:1: Parameter `bc->bits_left` 143. 144. /* Return one bit from the buffer. */ 145. static inline unsigned bitstream_read_bit(BitstreamContext *bc) ^ 146. { 147. if (!bc->bits_left) libavcodec/bitstream.h:150:12: Call 148. refill_64(bc); 149. 150. return get_val(bc, 1); ^ 151. } 152. libavcodec/bitstream.h:130:1: <LHS trace> 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:130:1: Parameter `bc->bits_left` 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:130:1: <RHS trace> 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:130:1: Parameter `n` 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:139:5: Binary operation: ([-2, +oo] - 1):unsigned32 by call to `read_block` 137. bc->bits <<= n; 138. #endif 139. bc->bits_left -= n; ^ 140. 141. return ret;
https://github.com/libav/libav/blob/7ff018c1cb43a5fe5ee2049d325cdd785852067a/libavcodec/bitstream.h/#L139
d2a_code_trace_data_45096
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/dsa/dsa_ossl.c:405: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `BN_mod_exp2_mont`. Showing all 47 steps of the trace crypto/dsa/dsa_ossl.c:376:10: Call 374. * Calculate W = inv(S) mod Q save W in u2 375. */ 376. if ((BN_mod_inverse(u2, sig->s, dsa->q, ctx)) == NULL) ^ 377. goto err; 378. crypto/bn/bn_gcd.c:231:10: Call 229. BIGNUM *rv; 230. int noinv; 231. rv = int_bn_mod_inverse(in, a, n, ctx, &noinv); ^ 232. if (noinv) 233. BNerr(BN_F_BN_MOD_INVERSE, BN_R_NO_INVERSE); crypto/bn/bn_gcd.c:237:1: Parameter `ctx->stack.depth` 235. } 236. 237. > BIGNUM *int_bn_mod_inverse(BIGNUM *in, 238. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx, 239. int *pnoinv) crypto/bn/bn_gcd.c:256:5: Call 254. bn_check_top(n); 255. 256. BN_CTX_start(ctx); ^ 257. A = BN_CTX_get(ctx); 258. B = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:236:1: Parameter `ctx->stack.depth` 234. } 235. 236. > void BN_CTX_start(BN_CTX *ctx) 237. { 238. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_gcd.c:548:5: Call 546. if ((ret == NULL) && (in == NULL)) 547. BN_free(R); 548. BN_CTX_end(ctx); ^ 549. bn_check_top(ret); 550. return (ret); crypto/bn/bn_ctx.c:250:1: Parameter `ctx->stack.depth` 248. } 249. 250. > void BN_CTX_end(BN_CTX *ctx) 251. { 252. CTXDBG_ENTRY("BN_CTX_end", ctx); crypto/dsa/dsa_ossl.c:391:10: Call 389. 390. /* u1 = M * w mod q */ 391. if (!BN_mod_mul(u1, u1, u2, dsa->q, ctx)) ^ 392. goto err; 393. crypto/bn/bn_mod.c:179:1: Parameter `ctx->stack.depth` 177. 178. /* slow but works */ 179. > int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, 180. BN_CTX *ctx) 181. { crypto/bn/bn_mod.c:189:5: Call 187. bn_check_top(m); 188. 189. BN_CTX_start(ctx); ^ 190. if ((t = BN_CTX_get(ctx)) == NULL) 191. goto err; crypto/bn/bn_ctx.c:236:1: Parameter `ctx->stack.depth` 234. } 235. 236. > void BN_CTX_start(BN_CTX *ctx) 237. { 238. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_mod.c:204:5: Call 202. ret = 1; 203. err: 204. BN_CTX_end(ctx); ^ 205. return (ret); 206. } crypto/bn/bn_ctx.c:250:1: Parameter `ctx->stack.depth` 248. } 249. 250. > void BN_CTX_end(BN_CTX *ctx) 251. { 252. CTXDBG_ENTRY("BN_CTX_end", ctx); crypto/dsa/dsa_ossl.c:395:10: Call 393. 394. /* u2 = r * w mod q */ 395. if (!BN_mod_mul(u2, sig->r, u2, dsa->q, ctx)) ^ 396. goto err; 397. crypto/bn/bn_mod.c:179:1: Parameter `ctx->stack.depth` 177. 178. /* slow but works */ 179. > int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, 180. BN_CTX *ctx) 181. { crypto/bn/bn_mod.c:189:5: Call 187. bn_check_top(m); 188. 189. BN_CTX_start(ctx); ^ 190. if ((t = BN_CTX_get(ctx)) == NULL) 191. goto err; crypto/bn/bn_ctx.c:236:1: Parameter `ctx->stack.depth` 234. } 235. 236. > void BN_CTX_start(BN_CTX *ctx) 237. { 238. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_mod.c:204:5: Call 202. ret = 1; 203. err: 204. BN_CTX_end(ctx); ^ 205. return (ret); 206. } crypto/bn/bn_ctx.c:250:1: Parameter `ctx->stack.depth` 248. } 249. 250. > void BN_CTX_end(BN_CTX *ctx) 251. { 252. CTXDBG_ENTRY("BN_CTX_end", ctx); crypto/dsa/dsa_ossl.c:405:5: Call 403. } 404. 405. DSA_MOD_EXP(goto err, dsa, t1, dsa->g, u1, dsa->pub_key, u2, dsa->p, ctx, ^ 406. mont); 407. /* BN_copy(&u1,&t1); */ crypto/bn/bn_exp2.c:118:1: Parameter `ctx->stack.depth` 116. #define TABLE_SIZE 32 117. 118. > int BN_mod_exp2_mont(BIGNUM *rr, const BIGNUM *a1, const BIGNUM *p1, 119. const BIGNUM *a2, const BIGNUM *p2, const BIGNUM *m, 120. BN_CTX *ctx, BN_MONT_CTX *in_mont) crypto/bn/bn_exp2.c:150:5: Call 148. bits = (bits1 > bits2) ? bits1 : bits2; 149. 150. BN_CTX_start(ctx); ^ 151. d = BN_CTX_get(ctx); 152. r = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:236:1: Parameter `ctx->stack.depth` 234. } 235. 236. > void BN_CTX_start(BN_CTX *ctx) 237. { 238. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_exp2.c:163:14: Call 161. if ((mont = BN_MONT_CTX_new()) == NULL) 162. goto err; 163. if (!BN_MONT_CTX_set(mont, m, ctx)) ^ 164. goto err; 165. } crypto/bn/bn_mont.c:349:1: Parameter `ctx->stack.depth` 347. } 348. 349. > int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) 350. { 351. int ret = 0; crypto/bn/bn_mont.c:357:5: Call 355. return 0; 356. 357. BN_CTX_start(ctx); ^ 358. if ((Ri = BN_CTX_get(ctx)) == NULL) 359. goto err; crypto/bn/bn_ctx.c:236:1: Parameter `ctx->stack.depth` 234. } 235. 236. > void BN_CTX_start(BN_CTX *ctx) 237. { 238. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_mont.c:428:14: Call 426. tmod.top = buf[0] != 0 ? 1 : 0; 427. /* Ri = R^-1 mod N */ 428. if ((BN_mod_inverse(Ri, R, &tmod, ctx)) == NULL) ^ 429. goto err; 430. if (!BN_lshift(Ri, Ri, BN_BITS2)) crypto/bn/bn_gcd.c:226:1: Parameter `ctx->stack.depth` 224. BN_CTX *ctx); 225. 226. > BIGNUM *BN_mod_inverse(BIGNUM *in, 227. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx) 228. { crypto/bn/bn_gcd.c:231:10: Call 229. BIGNUM *rv; 230. int noinv; 231. rv = int_bn_mod_inverse(in, a, n, ctx, &noinv); ^ 232. if (noinv) 233. BNerr(BN_F_BN_MOD_INVERSE, BN_R_NO_INVERSE); crypto/bn/bn_gcd.c:237:1: Parameter `ctx->stack.depth` 235. } 236. 237. > BIGNUM *int_bn_mod_inverse(BIGNUM *in, 238. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx, 239. int *pnoinv) crypto/bn/bn_gcd.c:250:16: Call 248. if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0) 249. || (BN_get_flags(n, BN_FLG_CONSTTIME) != 0)) { 250. return BN_mod_inverse_no_branch(in, a, n, ctx); ^ 251. } 252. crypto/bn/bn_gcd.c:557:1: Parameter `ctx->stack.depth` 555. * not contain branches that may leak sensitive information. 556. */ 557. > static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in, 558. const BIGNUM *a, const BIGNUM *n, 559. BN_CTX *ctx) crypto/bn/bn_gcd.c:568:5: Call 566. bn_check_top(n); 567. 568. BN_CTX_start(ctx); ^ 569. A = BN_CTX_get(ctx); 570. B = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:236:1: Parameter `ctx->stack.depth` 234. } 235. 236. > void BN_CTX_start(BN_CTX *ctx) 237. { 238. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_gcd.c:603:18: Call 601. BN_init(&local_B); 602. BN_with_flags(&local_B, B, BN_FLG_CONSTTIME); 603. if (!BN_nnmod(B, &local_B, A, ctx)) ^ 604. goto err; 605. /* Ensure local_B goes out of scope before any further use of B */ crypto/bn/bn_mod.c:119:1: Parameter `ctx->stack.depth` 117. #include "bn_lcl.h" 118. 119. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx) 120. { 121. /* crypto/bn/bn_mod.c:126:11: Call 124. */ 125. 126. if (!(BN_mod(r, m, d, ctx))) ^ 127. return 0; 128. if (!r->neg) crypto/bn/bn_div.c:189:1: Parameter `ctx->stack.depth` 187. * If 'dv' or 'rm' is NULL, the respective value is not returned. 188. */ 189. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 190. BN_CTX *ctx) 191. { crypto/bn/bn_div.c:242:5: Call 240. } 241. 242. BN_CTX_start(ctx); ^ 243. tmp = BN_CTX_get(ctx); 244. snum = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:236:1: Parameter `ctx->stack.depth` 234. } 235. 236. > void BN_CTX_start(BN_CTX *ctx) 237. { 238. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_div.c:469:5: Call 467. if (no_branch) 468. bn_correct_top(res); 469. BN_CTX_end(ctx); ^ 470. return (1); 471. err: crypto/bn/bn_ctx.c:250:1: Parameter `ctx->stack.depth` 248. } 249. 250. > void BN_CTX_end(BN_CTX *ctx) 251. { 252. CTXDBG_ENTRY("BN_CTX_end", ctx); crypto/bn/bn_ctx.c:256:27: Call 254. ctx->err_stack--; 255. else { 256. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 257. /* Does this stack frame have anything to release? */ 258. if (fp < ctx->used) crypto/bn/bn_ctx.c:326:1: <LHS trace> 324. } 325. 326. > static unsigned int BN_STACK_pop(BN_STACK *st) 327. { 328. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:326:1: Parameter `st->depth` 324. } 325. 326. > static unsigned int BN_STACK_pop(BN_STACK *st) 327. { 328. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:328:12: Binary operation: ([0, +oo] - 1):unsigned32 by call to `BN_mod_exp2_mont` 326. static unsigned int BN_STACK_pop(BN_STACK *st) 327. { 328. return st->indexes[--(st->depth)]; ^ 329. } 330.
https://github.com/openssl/openssl/blob/e113c9c59dcb419dd00525cec431edb854a6c897/crypto/bn/bn_ctx.c/#L328
d2a_code_trace_data_45097
static void update_last_header_values(SnowContext *s){ int plane_index; if(!s->keyframe){ for(plane_index=0; plane_index<2; plane_index++){ Plane *p= &s->plane[plane_index]; p->last_diag_mc= p->diag_mc; p->last_htaps = p->htaps; memcpy(p->last_hcoeff, p->hcoeff, sizeof(p->hcoeff)); } } s->last_spatial_decomposition_type = s->spatial_decomposition_type; s->last_qlog = s->qlog; s->last_qbias = s->qbias; s->last_mv_scale = s->mv_scale; s->last_block_max_depth = s->block_max_depth; s->last_spatial_decomposition_count = s->spatial_decomposition_count; } libavcodec/snow.c:3525: error: Buffer Overrun L3 Offset added: 4 Size: [0, +oo]. libavcodec/snow.c:3517:1: <Length trace> 3515. } 3516. 3517. static void update_last_header_values(SnowContext *s){ ^ 3518. int plane_index; 3519. libavcodec/snow.c:3517:1: Parameter `s->plane[*].hcoeff[*]` 3515. } 3516. 3517. static void update_last_header_values(SnowContext *s){ ^ 3518. int plane_index; 3519. libavcodec/snow.c:3525:13: Array access: Offset added: 4 Size: [0, +oo] 3523. p->last_diag_mc= p->diag_mc; 3524. p->last_htaps = p->htaps; 3525. memcpy(p->last_hcoeff, p->hcoeff, sizeof(p->hcoeff)); ^ 3526. } 3527. }
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/snow.c/#L3525
d2a_code_trace_data_45098
uint32_t ngx_utf8_decode(u_char **p, size_t n) { size_t len; uint32_t u, i, valid; u = **p; if (u > 0xf0) { u &= 0x07; valid = 0xffff; len = 3; } else if (u > 0xe0) { u &= 0x0f; valid = 0x7ff; len = 2; } else if (u > 0xc0) { u &= 0x1f; valid = 0x7f; len = 1; } else { (*p)++; return 0xffffffff; } if (n - 1 < len) { return 0xfffffffe; } (*p)++; while (len) { i = *(*p)++; if (i < 0x80) { return 0xffffffff; } u = (u << 6) | (i & 0x3f); len--; } if (u > valid) { return u; } return 0xffffffff; } src/http/modules/ngx_http_charset_filter_module.c:1281: error: Integer Overflow L2 ([0, +oo] - 1):unsigned64 by call to `ngx_utf8_decode`. src/http/modules/ngx_http_charset_filter_module.c:1263:14: Assignment 1261. *p++ = (u_char) (value[1].len / 2); 1262. 1263. for (i = 0; i < value[1].len; i += 2) { ^ 1264. dst = ngx_hextoi(&value[1].data[i], 2); 1265. if (dst == NGX_ERROR || dst > 255) { src/http/modules/ngx_http_charset_filter_module.c:1274:9: Assignment 1272. } 1273. 1274. i /= 2; ^ 1275. 1276. ctx->charset->length += i; src/http/modules/ngx_http_charset_filter_module.c:1281:13: Call 1279. p = &table->src2dst[src * NGX_UTF_LEN] + 1; 1280. 1281. n = ngx_utf8_decode(&p, i); ^ 1282. 1283. if (n > 0xffff) { src/core/ngx_string.c:1081:1: <LHS trace> 1079. */ 1080. 1081. uint32_t ^ 1082. ngx_utf8_decode(u_char **p, size_t n) 1083. { src/core/ngx_string.c:1081:1: Parameter `n` 1079. */ 1080. 1081. uint32_t ^ 1082. ngx_utf8_decode(u_char **p, size_t n) 1083. { src/core/ngx_string.c:1112:9: Binary operation: ([0, +oo] - 1):unsigned64 by call to `ngx_utf8_decode` 1110. } 1111. 1112. if (n - 1 < len) { ^ 1113. return 0xfffffffe; 1114. }
https://github.com/nginx/nginx/blob/e4ecddfdb0d2ffc872658e36028971ad9a873726/src/core/ngx_string.c/#L1112
d2a_code_trace_data_45099
static void copy_parameter_set(void **to, void **from, int count, int size) { int i; for (i = 0; i < count; i++) { if (to[i] && !from[i]) av_freep(&to[i]); else if (from[i] && !to[i]) to[i] = av_malloc(size); if (from[i]) memcpy(to[i], from[i], size); } } libavcodec/h264.c:1118: error: Null Dereference pointer `*to[i]` last assigned on line 1115 could be null and is dereferenced by call to `memcpy()` at line 1118, column 13. libavcodec/h264.c:1107:1: start of procedure copy_parameter_set() 1105. } 1106. 1107. static void copy_parameter_set(void **to, void **from, int count, int size) ^ 1108. { 1109. int i; libavcodec/h264.c:1111:10: 1109. int i; 1110. 1111. for (i = 0; i < count; i++) { ^ 1112. if (to[i] && !from[i]) 1113. av_freep(&to[i]); libavcodec/h264.c:1111:17: Loop condition is true. Entering loop body 1109. int i; 1110. 1111. for (i = 0; i < count; i++) { ^ 1112. if (to[i] && !from[i]) 1113. av_freep(&to[i]); libavcodec/h264.c:1112:13: Taking false branch 1110. 1111. for (i = 0; i < count; i++) { 1112. if (to[i] && !from[i]) ^ 1113. av_freep(&to[i]); 1114. else if (from[i] && !to[i]) libavcodec/h264.c:1114:18: Taking true branch 1112. if (to[i] && !from[i]) 1113. av_freep(&to[i]); 1114. else if (from[i] && !to[i]) ^ 1115. to[i] = av_malloc(size); 1116. libavcodec/h264.c:1114:30: Taking true branch 1112. if (to[i] && !from[i]) 1113. av_freep(&to[i]); 1114. else if (from[i] && !to[i]) ^ 1115. to[i] = av_malloc(size); 1116. libavcodec/h264.c:1115:13: 1113. av_freep(&to[i]); 1114. else if (from[i] && !to[i]) 1115. to[i] = av_malloc(size); ^ 1116. 1117. if (from[i]) libavutil/mem.c:61:1: start of procedure av_malloc() 59. * linker will do it automatically. */ 60. 61. void *av_malloc(size_t size) ^ 62. { 63. void *ptr = NULL; libavutil/mem.c:63:5: 61. void *av_malloc(size_t size) 62. { 63. void *ptr = NULL; ^ 64. #if CONFIG_MEMALIGN_HACK 65. long diff; libavutil/mem.c:69:9: Taking true branch 67. 68. /* let's disallow possible ambiguous cases */ 69. if (size > (INT_MAX - 32) || !size) ^ 70. return NULL; 71. libavutil/mem.c:70:9: 68. /* let's disallow possible ambiguous cases */ 69. if (size > (INT_MAX - 32) || !size) 70. return NULL; ^ 71. 72. #if CONFIG_MEMALIGN_HACK libavutil/mem.c:114:1: return from a call to av_malloc 112. #endif 113. return ptr; 114. } ^ 115. 116. void *av_realloc(void *ptr, size_t size) libavcodec/h264.c:1117:13: Taking true branch 1115. to[i] = av_malloc(size); 1116. 1117. if (from[i]) ^ 1118. memcpy(to[i], from[i], size); 1119. } libavcodec/h264.c:1118:13: 1116. 1117. if (from[i]) 1118. memcpy(to[i], from[i], size); ^ 1119. } 1120. }
https://github.com/libav/libav/blob/977d4a3b8a2dbc2fb5e747c7072485016c9cdfaa/libavcodec/h264.c/#L1118
d2a_code_trace_data_45100
int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm) { char *v; int gmt = 0; int i; int y = 0, M = 0, d = 0, h = 0, m = 0, s = 0; char *f = NULL; int f_len = 0; i = tm->length; v = (char *)tm->data; if (i < 12) goto err; if (v[i - 1] == 'Z') gmt = 1; for (i = 0; i < 12; i++) if ((v[i] > '9') || (v[i] < '0')) goto err; y = (v[0] - '0') * 1000 + (v[1] - '0') * 100 + (v[2] - '0') * 10 + (v[3] - '0'); M = (v[4] - '0') * 10 + (v[5] - '0'); if ((M > 12) || (M < 1)) goto err; d = (v[6] - '0') * 10 + (v[7] - '0'); h = (v[8] - '0') * 10 + (v[9] - '0'); m = (v[10] - '0') * 10 + (v[11] - '0'); if (tm->length >= 14 && (v[12] >= '0') && (v[12] <= '9') && (v[13] >= '0') && (v[13] <= '9')) { s = (v[12] - '0') * 10 + (v[13] - '0'); if (tm->length >= 15 && v[14] == '.') { int l = tm->length; f = &v[14]; f_len = 1; while (14 + f_len < l && f[f_len] >= '0' && f[f_len] <= '9') ++f_len; } } if (BIO_printf(bp, "%s %2d %02d:%02d:%02d%.*s %d%s", mon[M - 1], d, h, m, s, f_len, f, y, (gmt) ? " GMT" : "") <= 0) return (0); else return (1); err: BIO_write(bp, "Bad time value", 14); return (0); } crypto/x509v3/v3_scts.c:158: error: BUFFER_OVERRUN_L3 Offset: [-529, +oo] Size: 12 by call to `ASN1_GENERALIZEDTIME_print`. Showing all 11 steps of the trace crypto/x509v3/v3_scts.c:148:5: Call 146. char genstr[20]; 147. gen = ASN1_GENERALIZEDTIME_new(); 148. ASN1_GENERALIZEDTIME_adj(gen, (time_t)0, ^ 149. (int)(timestamp / 86400000), 150. (timestamp % 86400000) / 1000); crypto/asn1/a_gentm.c:267:1: Parameter `*s->data` 265. } 266. 267. > ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s, 268. time_t t, int offset_day, 269. long offset_sec) crypto/x509v3/v3_scts.c:157:5: Call 155. BIO_snprintf(genstr, sizeof(genstr), "%.14s.%03dZ", 156. ASN1_STRING_data(gen), (unsigned int)(timestamp % 1000)); 157. ASN1_GENERALIZEDTIME_set_string(gen, genstr); ^ 158. ASN1_GENERALIZEDTIME_print(out, gen); 159. ASN1_GENERALIZEDTIME_free(gen); crypto/asn1/a_gentm.c:242:1: Parameter `*s->data` 240. } 241. 242. > int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str) 243. { 244. ASN1_GENERALIZEDTIME t; crypto/x509v3/v3_scts.c:158:5: Call 156. ASN1_STRING_data(gen), (unsigned int)(timestamp % 1000)); 157. ASN1_GENERALIZEDTIME_set_string(gen, genstr); 158. ASN1_GENERALIZEDTIME_print(out, gen); ^ 159. ASN1_GENERALIZEDTIME_free(gen); 160. } crypto/asn1/t_x509.c:407:1: <Offset trace> 405. }; 406. 407. > int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm) 408. { 409. char *v; crypto/asn1/t_x509.c:407:1: Parameter `*tm->data` 405. }; 406. 407. > int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm) 408. { 409. char *v; crypto/asn1/t_x509.c:428:5: Assignment 426. y = (v[0] - '0') * 1000 + (v[1] - '0') * 100 427. + (v[2] - '0') * 10 + (v[3] - '0'); 428. M = (v[4] - '0') * 10 + (v[5] - '0'); ^ 429. if ((M > 12) || (M < 1)) 430. goto err; crypto/asn1/t_x509.c:402:1: <Length trace> 400. } 401. 402. > static const char *mon[12] = { 403. "Jan", "Feb", "Mar", "Apr", "May", "Jun", 404. "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" crypto/asn1/t_x509.c:402:1: Array declaration 400. } 401. 402. > static const char *mon[12] = { 403. "Jan", "Feb", "Mar", "Apr", "May", "Jun", 404. "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" crypto/asn1/t_x509.c:449:20: Array access: Offset: [-529, +oo] Size: 12 by call to `ASN1_GENERALIZEDTIME_print` 447. 448. if (BIO_printf(bp, "%s %2d %02d:%02d:%02d%.*s %d%s", 449. mon[M - 1], d, h, m, s, f_len, f, y, ^ 450. (gmt) ? " GMT" : "") <= 0) 451. return (0);
https://github.com/openssl/openssl/blob/9c46f4b9cd4912b61cb546c48b678488d7f26ed6/crypto/asn1/t_x509.c/#L449
d2a_code_trace_data_45101
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:2637: error: NULL_DEREFERENCE pointer `cert` last assigned on line 2636 could be null and is dereferenced by call to `cert_self_signed()` at line 2637, column 14. Showing all 21 steps of the trace crypto/x509/x509_vfy.c:2631:1: start of procedure build_chain() 2629. } 2630. 2631. > static int build_chain(X509_STORE_CTX *ctx) 2632. { 2633. struct dane_st *dane = (struct dane_st *)ctx->dane; crypto/x509/x509_vfy.c:2633:5: 2631. static int build_chain(X509_STORE_CTX *ctx) 2632. { 2633. > struct dane_st *dane = (struct dane_st *)ctx->dane; 2634. int (*cb) (int, X509_STORE_CTX *) = ctx->verify_cb; 2635. int num = sk_X509_num(ctx->chain); crypto/x509/x509_vfy.c:2634:5: 2632. { 2633. struct dane_st *dane = (struct dane_st *)ctx->dane; 2634. > int (*cb) (int, X509_STORE_CTX *) = ctx->verify_cb; 2635. int num = sk_X509_num(ctx->chain); 2636. X509 *cert = sk_X509_value(ctx->chain, num - 1); crypto/x509/x509_vfy.c:2635:5: 2633. struct dane_st *dane = (struct dane_st *)ctx->dane; 2634. int (*cb) (int, X509_STORE_CTX *) = ctx->verify_cb; 2635. > int num = sk_X509_num(ctx->chain); 2636. X509 *cert = sk_X509_value(ctx->chain, num - 1); 2637. 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:2636:5: 2634. int (*cb) (int, X509_STORE_CTX *) = ctx->verify_cb; 2635. int num = sk_X509_num(ctx->chain); 2636. > X509 *cert = sk_X509_value(ctx->chain, num - 1); 2637. int ss = cert_self_signed(cert); 2638. 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:2637:5: 2635. int num = sk_X509_num(ctx->chain); 2636. X509 *cert = sk_X509_value(ctx->chain, num - 1); 2637. > int ss = cert_self_signed(cert); 2638. STACK_OF(X509) *sktmp = NULL; 2639. 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/928623825cc59e272e2031cd3f07c5b7bbd605d4/crypto/x509/x509_vfy.c/#L2637
d2a_code_trace_data_45102
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 -1; } SSL3_BUFFER_add_offset(&wb[currbuf], tmpwrit); SSL3_BUFFER_sub_left(&wb[currbuf], tmpwrit); } } ssl/record/rec_layer_d1.c:433: error: INTEGER_OVERFLOW_L2 ([0, max(1, `s->rlayer.numwpipes`)] - 1):unsigned64 by call to `dtls1_handle_timeout`. Showing all 17 steps of the trace ssl/record/rec_layer_d1.c:338:1: Parameter `s->rlayer.numwpipes` 336. * none of our business 337. */ 338. > int dtls1_read_bytes(SSL *s, int type, int *recvd_type, unsigned char *buf, 339. size_t len, int peek, size_t *readbytes) 340. { ssl/record/rec_layer_d1.c:433:9: Call 431. 432. /* Check for timeout */ 433. if (dtls1_handle_timeout(s) > 0) ^ 434. goto start; 435. ssl/d1_lib.c:365:1: Parameter `s->rlayer.numwpipes` 363. } 364. 365. > int dtls1_handle_timeout(SSL *s) 366. { 367. /* if no timer is expired, don't do anything */ ssl/d1_lib.c:389:12: Call 387. 388. dtls1_start_timer(s); 389. return dtls1_retransmit_buffered_messages(s); ^ 390. } 391. ssl/statem/statem_dtls.c:952:1: Parameter `s->rlayer.numwpipes` 950. } 951. 952. > int dtls1_retransmit_buffered_messages(SSL *s) 953. { 954. pqueue *sent = s->d1->sent_messages; ssl/statem/statem_dtls.c:964:13: Call 962. for (item = pqueue_next(&iter); item != NULL; item = pqueue_next(&iter)) { 963. frag = (hm_fragment *)item->data; 964. if (dtls1_retransmit_message(s, (unsigned short) ^ 965. dtls1_get_queue_priority 966. (frag->msg_header.seq, ssl/statem/statem_dtls.c:1038:1: Parameter `s->rlayer.numwpipes` 1036. } 1037. 1038. > int dtls1_retransmit_message(SSL *s, unsigned short seq, int *found) 1039. { 1040. int ret; ssl/statem/statem_dtls.c:1100:11: Call 1098. saved_retransmit_state.epoch); 1099. 1100. ret = dtls1_do_write(s, frag->msg_header.is_ccs ? ^ 1101. SSL3_RT_CHANGE_CIPHER_SPEC : SSL3_RT_HANDSHAKE); 1102. ssl/statem/statem_dtls.c:110:1: Parameter `s->rlayer.numwpipes` 108. * SSL3_RT_CHANGE_CIPHER_SPEC) 109. */ 110. > int dtls1_do_write(SSL *s, int type) 111. { 112. int ret; ssl/statem/statem_dtls.c:235:15: Call 233. } 234. 235. ret = dtls1_write_bytes(s, type, &s->init_buf->data[s->init_off], len, ^ 236. &written); 237. if (ret < 0) { ssl/record/rec_layer_d1.c:974:1: Parameter `s->rlayer.numwpipes` 972. * not all data has been sent or non-blocking IO. 973. */ 974. > int dtls1_write_bytes(SSL *s, int type, const void *buf, size_t len, 975. size_t *written) 976. { ssl/record/rec_layer_d1.c:981:9: Call 979. OPENSSL_assert(len <= SSL3_RT_MAX_PLAIN_LENGTH); 980. s->rwstate = SSL_NOTHING; 981. i = do_dtls1_write(s, type, buf, len, 0, written); ^ 982. return i; 983. } ssl/record/rec_layer_d1.c:985:1: Parameter `s->rlayer.numwpipes` 983. } 984. 985. > int do_dtls1_write(SSL *s, int type, const unsigned char *buf, 986. size_t len, int create_empty_fragment, size_t *written) 987. { ssl/record/rec_layer_d1.c:1181:12: Call 1179. 1180. /* we now just need to write the buffer */ 1181. return ssl3_write_pending(s, type, buf, len, written); ^ 1182. err: 1183. return -1; ssl/record/rec_layer_s3.c:905:1: <LHS trace> 903. * <0 Failure (may be retryable) 904. */ 905. > int ssl3_write_pending(SSL *s, int type, const unsigned char *buf, size_t len, 906. size_t *written) 907. { ssl/record/rec_layer_s3.c:905:1: Parameter `s->rlayer.numwpipes` 903. * <0 Failure (may be retryable) 904. */ 905. > int ssl3_write_pending(SSL *s, int type, const unsigned char *buf, size_t len, 906. size_t *written) 907. { ssl/record/rec_layer_s3.c:924:16: Binary operation: ([0, max(1, s->rlayer.numwpipes)] - 1):unsigned64 by call to `dtls1_handle_timeout` 922. /* Loop until we find a buffer we haven't written out yet */ 923. if (SSL3_BUFFER_get_left(&wb[currbuf]) == 0 924. && currbuf < s->rlayer.numwpipes - 1) { ^ 925. currbuf++; 926. continue;
https://github.com/openssl/openssl/blob/6438632420cee9821409221ef6717edc5ee408c1/ssl/record/rec_layer_s3.c/#L924
d2a_code_trace_data_45103
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_script.c:1423: error: Buffer Overrun L2 Offset: [0, 4048] Size: 2048 by call to `ngx_log_error_core`. src/http/ngx_http_script.c:1423:13: Call 1421. { 1422. if (of.err != NGX_ENOENT && of.err != NGX_ENOTDIR) { 1423. ngx_log_error(NGX_LOG_CRIT, r->connection->log, of.err, ^ 1424. ngx_file_info_n " \"%s\" failed", value->data); 1425. } src/core/ngx_log.c:67:1: Array declaration 65. #if (NGX_HAVE_VARIADIC_MACROS) 66. 67. void ^ 68. ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err, 69. const char *fmt, ...) src/core/ngx_log.c:88:5: Assignment 86. } 87. 88. last = errstr + NGX_MAX_ERROR_STR; ^ 89. 90. ngx_memcpy(errstr, ngx_cached_err_log_time.data, src/core/ngx_log.c:133:13: Call 131. ? " (%d: " : " (%Xd: ", err); 132. #else 133. p = ngx_snprintf(p, last - p, " (%d: ", err); ^ 134. #endif 135. src/core/ngx_string.c:109:1: Parameter `max` 107. 108. 109. u_char * ngx_cdecl ^ 110. ngx_snprintf(u_char *buf, size_t max, const char *fmt, ...) 111. { src/core/ngx_string.c:116:9: Call 114. 115. va_start(args, fmt); 116. p = ngx_vsnprintf(buf, max, fmt, args); ^ 117. va_end(args); 118. src/core/ngx_string.c:123:1: <Length trace> 121. 122. 123. u_char * ^ 124. ngx_vsnprintf(u_char *buf, size_t max, const char *fmt, va_list args) 125. { src/core/ngx_string.c:123:1: Parameter `*buf` 121. 122. 123. u_char * ^ 124. ngx_vsnprintf(u_char *buf, size_t max, const char *fmt, va_list args) 125. { src/core/ngx_string.c:244:25: Array access: Offset: [0, 4048] Size: 2048 by call to `ngx_log_error_core` 242. if (slen == (size_t) -1) { 243. while (*p && buf < last) { 244. *buf++ = *p++; ^ 245. } 246.
https://github.com/nginx/nginx/blob/e4ecddfdb0d2ffc872658e36028971ad9a873726/src/core/ngx_string.c/#L244
d2a_code_trace_data_45104
static int tls_construct_cke_rsa(SSL *s, WPACKET *pkt) { #ifndef OPENSSL_NO_RSA unsigned char *encdata = NULL; EVP_PKEY *pkey = NULL; EVP_PKEY_CTX *pctx = NULL; size_t enclen; unsigned char *pms = NULL; size_t pmslen = 0; if (s->session->peer == NULL) { SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR); return 0; } pkey = X509_get0_pubkey(s->session->peer); if (EVP_PKEY_get0_RSA(pkey) == NULL) { SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR); return 0; } pmslen = SSL_MAX_MASTER_KEY_LENGTH; pms = OPENSSL_malloc(pmslen); if (pms == NULL) { SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_MALLOC_FAILURE); return 0; } pms[0] = s->client_version >> 8; pms[1] = s->client_version & 0xff; if (RAND_bytes(pms + 2, (int)(pmslen - 2)) <= 0) { SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_MALLOC_FAILURE); goto err; } if (s->version > SSL3_VERSION && !WPACKET_start_sub_packet_u16(pkt)) { SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR); goto err; } pctx = EVP_PKEY_CTX_new(pkey, NULL); if (pctx == NULL || EVP_PKEY_encrypt_init(pctx) <= 0 || EVP_PKEY_encrypt(pctx, NULL, &enclen, pms, pmslen) <= 0) { SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_EVP_LIB); goto err; } if (!WPACKET_allocate_bytes(pkt, enclen, &encdata) || EVP_PKEY_encrypt(pctx, encdata, &enclen, pms, pmslen) <= 0) { SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_CONSTRUCT_CKE_RSA, SSL_R_BAD_RSA_ENCRYPT); goto err; } EVP_PKEY_CTX_free(pctx); pctx = NULL; if (s->version > SSL3_VERSION && !WPACKET_close(pkt)) { SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR); goto err; } if (!ssl_log_rsa_client_key_exchange(s, encdata, enclen, pms, pmslen)) { goto err; } s->s3.tmp.pms = pms; s->s3.tmp.pmslen = pmslen; return 1; err: OPENSSL_clear_free(pms, pmslen); EVP_PKEY_CTX_free(pctx); return 0; #else SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR); return 0; #endif } ssl/statem/statem_clnt.c:2979: error: NULL_DEREFERENCE pointer `pkey` last assigned on line 2978 could be null and is dereferenced by call to `EVP_PKEY_get0_RSA()` at line 2979, column 9. Showing all 21 steps of the trace ssl/statem/statem_clnt.c:2959:1: start of procedure tls_construct_cke_rsa() 2957. } 2958. 2959. > static int tls_construct_cke_rsa(SSL *s, WPACKET *pkt) 2960. { 2961. #ifndef OPENSSL_NO_RSA ssl/statem/statem_clnt.c:2962:5: 2960. { 2961. #ifndef OPENSSL_NO_RSA 2962. > unsigned char *encdata = NULL; 2963. EVP_PKEY *pkey = NULL; 2964. EVP_PKEY_CTX *pctx = NULL; ssl/statem/statem_clnt.c:2963:5: 2961. #ifndef OPENSSL_NO_RSA 2962. unsigned char *encdata = NULL; 2963. > EVP_PKEY *pkey = NULL; 2964. EVP_PKEY_CTX *pctx = NULL; 2965. size_t enclen; ssl/statem/statem_clnt.c:2964:5: 2962. unsigned char *encdata = NULL; 2963. EVP_PKEY *pkey = NULL; 2964. > EVP_PKEY_CTX *pctx = NULL; 2965. size_t enclen; 2966. unsigned char *pms = NULL; ssl/statem/statem_clnt.c:2966:5: 2964. EVP_PKEY_CTX *pctx = NULL; 2965. size_t enclen; 2966. > unsigned char *pms = NULL; 2967. size_t pmslen = 0; 2968. ssl/statem/statem_clnt.c:2967:5: 2965. size_t enclen; 2966. unsigned char *pms = NULL; 2967. > size_t pmslen = 0; 2968. 2969. if (s->session->peer == NULL) { ssl/statem/statem_clnt.c:2969:9: Taking false branch 2967. size_t pmslen = 0; 2968. 2969. if (s->session->peer == NULL) { ^ 2970. /* 2971. * We should always have a server certificate with SSL_kRSA. ssl/statem/statem_clnt.c:2978:5: 2976. } 2977. 2978. > pkey = X509_get0_pubkey(s->session->peer); 2979. if (EVP_PKEY_get0_RSA(pkey) == NULL) { 2980. SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_CONSTRUCT_CKE_RSA, crypto/x509/x509_cmp.c:264:1: start of procedure X509_get0_pubkey() 262. } 263. 264. > EVP_PKEY *X509_get0_pubkey(const X509 *x) 265. { 266. if (x == NULL) crypto/x509/x509_cmp.c:266:9: Taking false branch 264. EVP_PKEY *X509_get0_pubkey(const X509 *x) 265. { 266. if (x == NULL) ^ 267. return NULL; 268. return X509_PUBKEY_get0(x->cert_info.key); crypto/x509/x509_cmp.c:268:5: 266. if (x == NULL) 267. return NULL; 268. > return X509_PUBKEY_get0(x->cert_info.key); 269. } 270. crypto/x509/x_pubkey.c:142:1: start of procedure X509_PUBKEY_get0() 140. } 141. 142. > EVP_PKEY *X509_PUBKEY_get0(X509_PUBKEY *key) 143. { 144. EVP_PKEY *ret = NULL; crypto/x509/x_pubkey.c:144:5: 142. EVP_PKEY *X509_PUBKEY_get0(X509_PUBKEY *key) 143. { 144. > EVP_PKEY *ret = NULL; 145. 146. if (key == NULL || key->public_key == NULL) crypto/x509/x_pubkey.c:146:9: Taking false branch 144. EVP_PKEY *ret = NULL; 145. 146. if (key == NULL || key->public_key == NULL) ^ 147. return NULL; 148. crypto/x509/x_pubkey.c:146:24: Taking true branch 144. EVP_PKEY *ret = NULL; 145. 146. if (key == NULL || key->public_key == NULL) ^ 147. return NULL; 148. crypto/x509/x_pubkey.c:147:9: 145. 146. if (key == NULL || key->public_key == NULL) 147. > return NULL; 148. 149. if (key->pkey != NULL) crypto/x509/x_pubkey.c:168:1: return from a call to X509_PUBKEY_get0 166. 167. return NULL; 168. > } 169. 170. EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key) crypto/x509/x509_cmp.c:269:1: return from a call to X509_get0_pubkey 267. return NULL; 268. return X509_PUBKEY_get0(x->cert_info.key); 269. > } 270. 271. EVP_PKEY *X509_get_pubkey(X509 *x) ssl/statem/statem_clnt.c:2979:9: 2977. 2978. pkey = X509_get0_pubkey(s->session->peer); 2979. > if (EVP_PKEY_get0_RSA(pkey) == NULL) { 2980. SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_CONSTRUCT_CKE_RSA, 2981. ERR_R_INTERNAL_ERROR); crypto/evp/p_lib.c:468:1: start of procedure EVP_PKEY_get0_RSA() 466. } 467. 468. > RSA *EVP_PKEY_get0_RSA(const EVP_PKEY *pkey) 469. { 470. if (pkey->type != EVP_PKEY_RSA) { crypto/evp/p_lib.c:470:9: 468. RSA *EVP_PKEY_get0_RSA(const EVP_PKEY *pkey) 469. { 470. > if (pkey->type != EVP_PKEY_RSA) { 471. EVPerr(EVP_F_EVP_PKEY_GET0_RSA, EVP_R_EXPECTING_AN_RSA_KEY); 472. return NULL;
https://github.com/openssl/openssl/blob/c3612970465d0a13f2fc5b47bc28ca18516a699d/ssl/statem/statem_clnt.c/#L2979
d2a_code_trace_data_45105
static void imdct36(int *out, int *buf, int *in, int *win) { int i, j, t0, t1, t2, t3, s0, s1, s2, s3; int tmp[18], *tmp1, *in1; for(i=17;i>=1;i--) in[i] += in[i-1]; for(i=17;i>=3;i-=2) in[i] += in[i-2]; for(j=0;j<2;j++) { tmp1 = tmp + j; in1 = in + j; #if 0 int64_t t0, t1, t2, t3; t2 = in1[2*4] + in1[2*8] - in1[2*2]; t3 = (in1[2*0] + (int64_t)(in1[2*6]>>1))<<32; t1 = in1[2*0] - in1[2*6]; tmp1[ 6] = t1 - (t2>>1); tmp1[16] = t1 + t2; t0 = MUL64(2*(in1[2*2] + in1[2*4]), C2); t1 = MUL64( in1[2*4] - in1[2*8] , -2*C8); t2 = MUL64(2*(in1[2*2] + in1[2*8]), -C4); tmp1[10] = (t3 - t0 - t2) >> 32; tmp1[ 2] = (t3 + t0 + t1) >> 32; tmp1[14] = (t3 + t2 - t1) >> 32; tmp1[ 4] = MULH(2*(in1[2*5] + in1[2*7] - in1[2*1]), -C3); t2 = MUL64(2*(in1[2*1] + in1[2*5]), C1); t3 = MUL64( in1[2*5] - in1[2*7] , -2*C7); t0 = MUL64(2*in1[2*3], C3); t1 = MUL64(2*(in1[2*1] + in1[2*7]), -C5); tmp1[ 0] = (t2 + t3 + t0) >> 32; tmp1[12] = (t2 + t1 - t0) >> 32; tmp1[ 8] = (t3 - t1 - t0) >> 32; #else t2 = in1[2*4] + in1[2*8] - in1[2*2]; t3 = in1[2*0] + (in1[2*6]>>1); t1 = in1[2*0] - in1[2*6]; tmp1[ 6] = t1 - (t2>>1); tmp1[16] = t1 + t2; t0 = MULH(2*(in1[2*2] + in1[2*4]), C2); t1 = MULH( in1[2*4] - in1[2*8] , -2*C8); t2 = MULH(2*(in1[2*2] + in1[2*8]), -C4); tmp1[10] = t3 - t0 - t2; tmp1[ 2] = t3 + t0 + t1; tmp1[14] = t3 + t2 - t1; tmp1[ 4] = MULH(2*(in1[2*5] + in1[2*7] - in1[2*1]), -C3); t2 = MULH(2*(in1[2*1] + in1[2*5]), C1); t3 = MULH( in1[2*5] - in1[2*7] , -2*C7); t0 = MULH(2*in1[2*3], C3); t1 = MULH(2*(in1[2*1] + in1[2*7]), -C5); tmp1[ 0] = t2 + t3 + t0; tmp1[12] = t2 + t1 - t0; tmp1[ 8] = t3 - t1 - t0; #endif } i = 0; for(j=0;j<4;j++) { t0 = tmp[i]; t1 = tmp[i + 2]; s0 = t1 + t0; s2 = t1 - t0; t2 = tmp[i + 1]; t3 = tmp[i + 3]; s1 = MULH(2*(t3 + t2), icos36h[j]); s3 = MULL(t3 - t2, icos36[8 - j]); t0 = s0 + s1; t1 = s0 - s1; out[(9 + j)*SBLIMIT] = MULH(t1, win[9 + j]) + buf[9 + j]; out[(8 - j)*SBLIMIT] = MULH(t1, win[8 - j]) + buf[8 - j]; buf[9 + j] = MULH(t0, win[18 + 9 + j]); buf[8 - j] = MULH(t0, win[18 + 8 - j]); t0 = s2 + s3; t1 = s2 - s3; out[(9 + 8 - j)*SBLIMIT] = MULH(t1, win[9 + 8 - j]) + buf[9 + 8 - j]; out[( j)*SBLIMIT] = MULH(t1, win[ j]) + buf[ j]; buf[9 + 8 - j] = MULH(t0, win[18 + 9 + 8 - j]); buf[ + j] = MULH(t0, win[18 + j]); i += 4; } s0 = tmp[16]; s1 = MULH(2*tmp[17], icos36h[4]); t0 = s0 + s1; t1 = s0 - s1; out[(9 + 4)*SBLIMIT] = MULH(t1, win[9 + 4]) + buf[9 + 4]; out[(8 - 4)*SBLIMIT] = MULH(t1, win[8 - 4]) + buf[8 - 4]; buf[9 + 4] = MULH(t0, win[18 + 9 + 4]); buf[8 - 4] = MULH(t0, win[18 + 8 - 4]); } libavcodec/mpegaudiodec.c:1112: error: Uninitialized Value The value read from tmp[_] was never initialized. libavcodec/mpegaudiodec.c:1112:5: 1110. } 1111. 1112. s0 = tmp[16]; ^ 1113. s1 = MULH(2*tmp[17], icos36h[4]); 1114. t0 = s0 + s1;
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/mpegaudiodec.c/#L1112
d2a_code_trace_data_45106
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:3620: error: Null Dereference pointer `st` last assigned on line 3614 could be null and is dereferenced at line 3620, column 20. ffmpeg.c:3606:1: start of procedure new_subtitle_stream() 3604. } 3605. 3606. static void new_subtitle_stream(AVFormatContext *oc, int file_idx) ^ 3607. { 3608. AVStream *st; ffmpeg.c:3610:5: 3608. AVStream *st; 3609. AVOutputStream *ost; 3610. AVCodec *codec=NULL; ^ 3611. AVCodecContext *subtitle_enc; 3612. enum CodecID codec_id = CODEC_ID_NONE; ffmpeg.c:3612:5: 3610. AVCodec *codec=NULL; 3611. AVCodecContext *subtitle_enc; 3612. enum CodecID codec_id = CODEC_ID_NONE; ^ 3613. 3614. st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0); ffmpeg.c:3614:28: Condition is true 3612. enum CodecID codec_id = CODEC_ID_NONE; 3613. 3614. st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0); ^ 3615. if (!st) { 3616. fprintf(stderr, "Could not alloc stream\n"); ffmpeg.c:3614:5: 3612. enum CodecID codec_id = CODEC_ID_NONE; 3613. 3614. st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0); ^ 3615. if (!st) { 3616. fprintf(stderr, "Could not alloc stream\n"); libavformat/utils.c:2601:1: start of procedure av_new_stream() 2599. } 2600. 2601. AVStream *av_new_stream(AVFormatContext *s, int id) ^ 2602. { 2603. AVStream *st; libavformat/utils.c:2607:9: Taking true branch 2605. 2606. #if FF_API_MAX_STREAMS 2607. if (s->nb_streams >= MAX_STREAMS){ ^ 2608. av_log(s, AV_LOG_ERROR, "Too many streams\n"); 2609. return NULL; libavformat/utils.c:2608:9: Skipping av_log(): empty list of specs 2606. #if FF_API_MAX_STREAMS 2607. if (s->nb_streams >= MAX_STREAMS){ 2608. av_log(s, AV_LOG_ERROR, "Too many streams\n"); ^ 2609. return NULL; 2610. } libavformat/utils.c:2609:9: 2607. if (s->nb_streams >= MAX_STREAMS){ 2608. av_log(s, AV_LOG_ERROR, "Too many streams\n"); 2609. return NULL; ^ 2610. } 2611. #else libavformat/utils.c:2658:1: return from a call to av_new_stream 2656. s->streams[s->nb_streams++] = st; 2657. return st; 2658. } ^ 2659. 2660. AVProgram *av_new_program(AVFormatContext *ac, int id) ffmpeg.c:3615:10: Taking true branch 3613. 3614. st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0); 3615. if (!st) { ^ 3616. fprintf(stderr, "Could not alloc stream\n"); 3617. ffmpeg_exit(1); ffmpeg.c:3616:9: 3614. st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0); 3615. if (!st) { 3616. fprintf(stderr, "Could not alloc stream\n"); ^ 3617. ffmpeg_exit(1); 3618. } ffmpeg.c:3617:9: Skipping ffmpeg_exit(): empty list of specs 3615. if (!st) { 3616. fprintf(stderr, "Could not alloc stream\n"); 3617. ffmpeg_exit(1); ^ 3618. } 3619. ost = new_output_stream(oc, file_idx); ffmpeg.c:3619:5: Skipping new_output_stream(): empty list of specs 3617. ffmpeg_exit(1); 3618. } 3619. ost = new_output_stream(oc, file_idx); ^ 3620. subtitle_enc = st->codec; 3621. output_codecs = grow_array(output_codecs, sizeof(*output_codecs), &nb_output_codecs, nb_output_codecs + 1); ffmpeg.c:3620:5: 3618. } 3619. ost = new_output_stream(oc, file_idx); 3620. subtitle_enc = st->codec; ^ 3621. output_codecs = grow_array(output_codecs, sizeof(*output_codecs), &nb_output_codecs, nb_output_codecs + 1); 3622. if(!subtitle_stream_copy){
https://github.com/libav/libav/blob/87e4d9b252bc6fa3b982f7050013069c9dc3e05b/ffmpeg.c/#L3620
d2a_code_trace_data_45107
static int epzs_motion_search4(MpegEncContext * s, int *mx_ptr, int *my_ptr, int P[10][2], int src_index, int ref_index, int16_t (*last_mv)[2], int ref_mv_scale) { MotionEstContext * const c= &s->me; int best[2]={0, 0}; int d, dmin; int map_generation; const int penalty_factor= c->penalty_factor; const int size=1; const int h=8; const int ref_mv_stride= s->mb_stride; const int ref_mv_xy= s->mb_x + s->mb_y *ref_mv_stride; me_cmp_func cmpf, chroma_cmpf; LOAD_COMMON int flags= c->flags; LOAD_COMMON2 cmpf= s->dsp.me_cmp[size]; chroma_cmpf= s->dsp.me_cmp[size+1]; map_generation= update_map_generation(c); dmin = 1000000; if (s->first_slice_line) { CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift) CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16) CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift) }else{ CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift) CHECK_MV(P_MEDIAN[0]>>shift, P_MEDIAN[1]>>shift) CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift) CHECK_MV(P_TOP[0]>>shift, P_TOP[1]>>shift) CHECK_MV(P_TOPRIGHT[0]>>shift, P_TOPRIGHT[1]>>shift) CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16) } if(dmin>64*4){ CHECK_CLIPPED_MV((last_mv[ref_mv_xy+1][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy+1][1]*ref_mv_scale + (1<<15))>>16) if(s->mb_y+1<s->end_mb_y) CHECK_CLIPPED_MV((last_mv[ref_mv_xy+ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy+ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16) } dmin= diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags); *mx_ptr= best[0]; *my_ptr= best[1]; return dmin; } libavcodec/motion_est_template.c:1160: error: Uninitialized Value The value read from ymax was never initialized. libavcodec/motion_est_template.c:1160:9: 1158. if (s->first_slice_line) { 1159. CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift) 1160. CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16, ^ 1161. (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16) 1162. CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift)
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1160
d2a_code_trace_data_45108
int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) { assert(pkt->subs != NULL && len != 0); if (pkt->subs == NULL || len == 0) return 0; if (pkt->maxsize - pkt->written < len) return 0; if (pkt->staticbuf == NULL && (pkt->buf->length - pkt->written < len)) { size_t newlen; size_t reflen; reflen = (len > pkt->buf->length) ? len : pkt->buf->length; if (reflen > SIZE_MAX / 2) { newlen = SIZE_MAX; } else { newlen = reflen * 2; if (newlen < DEFAULT_BUF_SIZE) newlen = DEFAULT_BUF_SIZE; } if (BUF_MEM_grow(pkt->buf, newlen) == 0) return 0; } if (allocbytes != NULL) *allocbytes = WPACKET_get_curr(pkt); return 1; } ssl/statem/statem_srvr.c:3469: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [`pkt->written`, `pkt->written` + 4]):unsigned64 by call to `WPACKET_sub_memcpy__`. Showing all 14 steps of the trace ssl/statem/statem_srvr.c:3468:10: Call 3466. int tls_construct_cert_status_body(SSL *s, WPACKET *pkt) 3467. { 3468. if (!WPACKET_put_bytes_u8(pkt, s->ext.status_type) ^ 3469. || !WPACKET_sub_memcpy_u24(pkt, s->ext.ocsp.resp, 3470. s->ext.ocsp.resp_len)) { ssl/packet.c:289:1: Parameter `pkt->buf->length` 287. } 288. 289. > int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size) 290. { 291. unsigned char *data; ssl/statem/statem_srvr.c:3469:17: Call 3467. { 3468. if (!WPACKET_put_bytes_u8(pkt, s->ext.status_type) 3469. || !WPACKET_sub_memcpy_u24(pkt, s->ext.ocsp.resp, ^ 3470. s->ext.ocsp.resp_len)) { 3471. SSLerr(SSL_F_TLS_CONSTRUCT_CERT_STATUS_BODY, ERR_R_INTERNAL_ERROR); ssl/packet.c:345:1: Parameter `pkt->written` 343. } 344. 345. > int WPACKET_sub_memcpy__(WPACKET *pkt, const void *src, size_t len, 346. size_t lenbytes) 347. { ssl/packet.c:348:10: Call 346. size_t lenbytes) 347. { 348. if (!WPACKET_start_sub_packet_len__(pkt, lenbytes) ^ 349. || !WPACKET_memcpy(pkt, src, len) 350. || !WPACKET_close(pkt)) ssl/packet.c:252:1: Parameter `pkt->written` 250. } 251. 252. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes) 253. { 254. WPACKET_SUB *sub; ssl/packet.c:276:10: Call 274. } 275. 276. if (!WPACKET_allocate_bytes(pkt, lenbytes, &lenchars)) ^ 277. return 0; 278. /* Convert to an offset in case the underlying BUF_MEM gets realloc'd */ ssl/packet.c:15:1: Parameter `pkt->written` 13. #define DEFAULT_BUF_SIZE 256 14. 15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes)) ssl/packet.c:17:10: Call 15. int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes)) ^ 18. return 0; 19. ssl/packet.c:39:1: <LHS trace> 37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data) 38. 39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 40. { 41. /* Internal API, so should not fail */ ssl/packet.c:39:1: Parameter `pkt->buf->length` 37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data) 38. 39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 40. { 41. /* Internal API, so should not fail */ ssl/packet.c:39:1: <RHS trace> 37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data) 38. 39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 40. { 41. /* Internal API, so should not fail */ ssl/packet.c:39:1: Parameter `len` 37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data) 38. 39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 40. { 41. /* Internal API, so should not fail */ ssl/packet.c:49:36: Binary operation: ([0, +oo] - [pkt->written, pkt->written + 4]):unsigned64 by call to `WPACKET_sub_memcpy__` 47. return 0; 48. 49. if (pkt->staticbuf == NULL && (pkt->buf->length - pkt->written < len)) { ^ 50. size_t newlen; 51. size_t reflen;
https://github.com/openssl/openssl/blob/f61c5ca6ca183bf0a51651857e3efb02a98889ad/ssl/packet.c/#L49
d2a_code_trace_data_45109
int is_partially_overlapping(const void *ptr1, const void *ptr2, int len) { PTRDIFF_T diff = (PTRDIFF_T)ptr1-(PTRDIFF_T)ptr2; int overlapped = (len > 0) & (diff != 0) & ((diff < (PTRDIFF_T)len) | (diff > (0 - (PTRDIFF_T)len))); return overlapped; } crypto/pem/pem_lib.c:436: error: INTEGER_OVERFLOW_L2 (0 - [-oo, 32]):unsigned64 by call to `EVP_DecryptUpdate`. Showing all 8 steps of the trace crypto/pem/pem_lib.c:392:1: Parameter `cipher->cipher->block_size` 390. } 391. 392. > int PEM_do_header(EVP_CIPHER_INFO *cipher, unsigned char *data, long *plen, 393. pem_password_cb *callback, void *u) 394. { crypto/pem/pem_lib.c:436:14: Call 434. ok = EVP_DecryptInit_ex(ctx, cipher->cipher, NULL, key, &(cipher->iv[0])); 435. if (ok) 436. ok = EVP_DecryptUpdate(ctx, data, &ilen, data, ilen); ^ 437. if (ok) { 438. /* Squirrel away the length of data decrypted so far. */ crypto/evp/evp_enc.c:416:1: Parameter `ctx->cipher->block_size` 414. } 415. 416. > int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, 417. const unsigned char *in, int inl) 418. { crypto/evp/evp_enc.c:422:5: Assignment 420. unsigned int b; 421. 422. b = ctx->cipher->block_size; ^ 423. 424. if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) { crypto/evp/evp_enc.c:452:16: Call 450. /* see comment about PTRDIFF_T comparison above */ 451. if (((PTRDIFF_T)out == (PTRDIFF_T)in) 452. || is_partially_overlapping(out, in, b)) { ^ 453. EVPerr(EVP_F_EVP_DECRYPTUPDATE, EVP_R_PARTIALLY_OVERLAPPING); 454. return 0; crypto/evp/evp_enc.c:279:1: <RHS trace> 277. #endif 278. 279. > int is_partially_overlapping(const void *ptr1, const void *ptr2, int len) 280. { 281. PTRDIFF_T diff = (PTRDIFF_T)ptr1-(PTRDIFF_T)ptr2; crypto/evp/evp_enc.c:279:1: Parameter `len` 277. #endif 278. 279. > int is_partially_overlapping(const void *ptr1, const void *ptr2, int len) 280. { 281. PTRDIFF_T diff = (PTRDIFF_T)ptr1-(PTRDIFF_T)ptr2; crypto/evp/evp_enc.c:288:50: Binary operation: (0 - [-oo, 32]):unsigned64 by call to `EVP_DecryptUpdate` 286. */ 287. int overlapped = (len > 0) & (diff != 0) & ((diff < (PTRDIFF_T)len) | 288. (diff > (0 - (PTRDIFF_T)len))); ^ 289. 290. return overlapped;
https://github.com/openssl/openssl/blob/b1531d8e6cc95837e38b10d875ae64144c6fdf7a/crypto/evp/evp_enc.c/#L288
d2a_code_trace_data_45110
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) { SSLerr(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_free(out); return 1; } ssl/statem/statem_clnt.c:2642: error: BUFFER_OVERRUN_L3 Offset: [4, +oo] Size: [1, 150] by call to `ssl_log_rsa_client_key_exchange`. Showing all 10 steps of the trace ssl/statem/statem_clnt.c:2592:5: Assignment 2590. } 2591. 2592. pmslen = SSL_MAX_MASTER_KEY_LENGTH; ^ 2593. pms = OPENSSL_malloc(pmslen); 2594. if (pms == NULL) { ssl/statem/statem_clnt.c:2642:10: Call 2640. 2641. /* Log the premaster secret, if logging is enabled. */ 2642. if (!ssl_log_rsa_client_key_exchange(s, encdata, enclen, pms, pmslen)) ^ 2643. goto err; 2644. ssl/ssl_lib.c:4418:1: Parameter `premaster_len` 4416. } 4417. 4418. > int ssl_log_rsa_client_key_exchange(SSL *ssl, 4419. const uint8_t *encrypted_premaster, 4420. size_t encrypted_premaster_len, ssl/ssl_lib.c:4430:12: Call 4428. 4429. /* We only want the first 8 bytes of the encrypted premaster as a tag. */ 4430. return nss_keylog_int("RSA", ^ 4431. ssl, 4432. encrypted_premaster, ssl/ssl_lib.c:4366:1: <Length trace> 4364. } 4365. 4366. > static int nss_keylog_int(const char *prefix, 4367. SSL *ssl, 4368. const uint8_t *parameter_1, ssl/ssl_lib.c:4366:1: Parameter `prefix->strlen` 4364. } 4365. 4366. > static int nss_keylog_int(const char *prefix, 4367. SSL *ssl, 4368. const uint8_t *parameter_1, ssl/ssl_lib.c:4389:5: Assignment 4387. * hexadecimal, so we need a buffer that is twice their lengths. 4388. */ 4389. prefix_len = strlen(prefix); ^ 4390. out_len = prefix_len + (2*parameter_1_len) + (2*parameter_2_len) + 3; 4391. if ((out = cursor = OPENSSL_malloc(out_len)) == NULL) { ssl/ssl_lib.c:4397:5: Assignment 4395. 4396. strcpy(cursor, prefix); 4397. cursor += prefix_len; ^ 4398. *cursor++ = ' '; 4399. ssl/ssl_lib.c:4398:6: Assignment 4396. strcpy(cursor, prefix); 4397. cursor += prefix_len; 4398. *cursor++ = ' '; ^ 4399. 4400. for (i = 0; i < parameter_1_len; i++) { ssl/ssl_lib.c:4404:5: Array access: Offset: [4, +oo] Size: [1, 150] by call to `ssl_log_rsa_client_key_exchange` 4402. cursor += 2; 4403. } 4404. *cursor++ = ' '; ^ 4405. 4406. for (i = 0; i < parameter_2_len; i++) {
https://github.com/openssl/openssl/blob/0247086d9a0713e18a0f16949039a40fdb63ff7e/ssl/ssl_lib.c/#L4404
d2a_code_trace_data_45111
void CRYPTO_free(void *str, const char *file, int line) { INCREMENT(free_count); if (free_impl != NULL && free_impl != &CRYPTO_free) { free_impl(str, file, line); return; } #ifndef OPENSSL_NO_CRYPTO_MDEBUG if (call_malloc_debug) { CRYPTO_mem_debug_free(str, 0, file, line); free(str); CRYPTO_mem_debug_free(str, 1, file, line); } else { free(str); } #else free(str); #endif } crypto/engine/eng_cnf.c:183: error: USE_AFTER_FREE call to `ENGINE_finish()` eventually accesses memory that was invalidated by call to `free()` on line 183 indirectly during the call to `ENGINE_finish()`. Showing all 22 steps of the trace crypto/engine/eng_cnf.c:182:31: invalidation part of the trace starts here 180. ENGINE *e; 181. 182. while ((e = sk_ENGINE_pop(initialized_engines))) ^ 183. ENGINE_finish(e); 184. sk_ENGINE_free(initialized_engines); crypto/engine/eng_cnf.c:182:31: global variable `initialized_engines` accessed here 180. ENGINE *e; 181. 182. while ((e = sk_ENGINE_pop(initialized_engines))) ^ 183. ENGINE_finish(e); 184. sk_ENGINE_free(initialized_engines); crypto/engine/eng_cnf.c:182:17: passed as argument to `sk_ENGINE_pop` 180. ENGINE *e; 181. 182. while ((e = sk_ENGINE_pop(initialized_engines))) ^ 183. ENGINE_finish(e); 184. sk_ENGINE_free(initialized_engines); crypto/engine/eng_cnf.c:182:17: return from call to `sk_ENGINE_pop` 180. ENGINE *e; 181. 182. while ((e = sk_ENGINE_pop(initialized_engines))) ^ 183. ENGINE_finish(e); 184. sk_ENGINE_free(initialized_engines); crypto/engine/eng_cnf.c:182:13: assigned 180. ENGINE *e; 181. 182. while ((e = sk_ENGINE_pop(initialized_engines))) ^ 183. ENGINE_finish(e); 184. sk_ENGINE_free(initialized_engines); crypto/engine/eng_cnf.c:183:9: when calling `ENGINE_finish` here 181. 182. while ((e = sk_ENGINE_pop(initialized_engines))) 183. ENGINE_finish(e); ^ 184. sk_ENGINE_free(initialized_engines); 185. initialized_engines = NULL; crypto/engine/eng_init.c:95:1: parameter `e` of ENGINE_finish 93. 94. /* The API (locked) version of "finish" */ 95. > int ENGINE_finish(ENGINE *e) 96. { 97. int to_return = 1; crypto/engine/eng_init.c:102:17: when calling `engine_unlocked_finish` here 100. return 1; 101. CRYPTO_THREAD_write_lock(global_engine_lock); 102. to_return = engine_unlocked_finish(e, 1); ^ 103. CRYPTO_THREAD_unlock(global_engine_lock); 104. if (!to_return) { crypto/engine/eng_init.c:44:1: parameter `e` of engine_unlocked_finish 42. * internally. 43. */ 44. > int engine_unlocked_finish(ENGINE *e, int unlock_for_handlers) 45. { 46. int to_return = 1; crypto/engine/eng_init.c:69:10: when calling `engine_free_util` here 67. REF_ASSERT_ISNT(e->funct_ref < 0); 68. /* Release the structural reference too */ 69. if (!engine_free_util(e, 0)) { ^ 70. ENGINEerr(ENGINE_F_ENGINE_UNLOCKED_FINISH, ENGINE_R_FINISH_FAILED); 71. return 0; crypto/engine/eng_lib.c:72:1: parameter `e` of engine_free_util 70. } 71. 72. > int engine_free_util(ENGINE *e, int not_locked) 73. { 74. int i; crypto/engine/eng_lib.c:100:5: when calling `CRYPTO_free` here 98. e->destroy(e); 99. CRYPTO_free_ex_data(CRYPTO_EX_INDEX_ENGINE, e, &e->ex_data); 100. OPENSSL_free(e); ^ 101. return 1; 102. } crypto/mem.c:295:1: parameter `str` of CRYPTO_free 293. } 294. 295. > void CRYPTO_free(void *str, const char *file, int line) 296. { 297. INCREMENT(free_count); crypto/mem.c:312:5: was invalidated by call to `free()` 310. } 311. #else 312. free(str); ^ 313. #endif 314. } crypto/engine/eng_cnf.c:182:31: use-after-lifetime part of the trace starts here 180. ENGINE *e; 181. 182. while ((e = sk_ENGINE_pop(initialized_engines))) ^ 183. ENGINE_finish(e); 184. sk_ENGINE_free(initialized_engines); crypto/engine/eng_cnf.c:182:31: global variable `initialized_engines` accessed here 180. ENGINE *e; 181. 182. while ((e = sk_ENGINE_pop(initialized_engines))) ^ 183. ENGINE_finish(e); 184. sk_ENGINE_free(initialized_engines); crypto/engine/eng_cnf.c:182:17: passed as argument to `sk_ENGINE_pop` 180. ENGINE *e; 181. 182. while ((e = sk_ENGINE_pop(initialized_engines))) ^ 183. ENGINE_finish(e); 184. sk_ENGINE_free(initialized_engines); crypto/engine/eng_cnf.c:182:17: return from call to `sk_ENGINE_pop` 180. ENGINE *e; 181. 182. while ((e = sk_ENGINE_pop(initialized_engines))) ^ 183. ENGINE_finish(e); 184. sk_ENGINE_free(initialized_engines); crypto/engine/eng_cnf.c:182:13: assigned 180. ENGINE *e; 181. 182. while ((e = sk_ENGINE_pop(initialized_engines))) ^ 183. ENGINE_finish(e); 184. sk_ENGINE_free(initialized_engines); crypto/engine/eng_cnf.c:183:9: when calling `ENGINE_finish` here 181. 182. while ((e = sk_ENGINE_pop(initialized_engines))) 183. ENGINE_finish(e); ^ 184. sk_ENGINE_free(initialized_engines); 185. initialized_engines = NULL; crypto/mem.c:295:1: parameter `str` of CRYPTO_free 293. } 294. 295. > void CRYPTO_free(void *str, const char *file, int line) 296. { 297. INCREMENT(free_count); crypto/mem.c:312:5: invalid access occurs here 310. } 311. #else 312. free(str); ^ 313. #endif 314. }
https://github.com/openssl/openssl/blob/148796291e47ad402ddfd1bbe6f34a2652657ec2/crypto/mem.c/#L312
d2a_code_trace_data_45112
long TXT_DB_write(BIO *out, TXT_DB *db) { long i, j, n, nn, l, tot = 0; char *p, **pp, *f; BUF_MEM *buf = NULL; long ret = -1; if ((buf = BUF_MEM_new()) == NULL) goto err; n = sk_OPENSSL_PSTRING_num(db->data); nn = db->num_fields; for (i = 0; i < n; i++) { pp = sk_OPENSSL_PSTRING_value(db->data, i); l = 0; for (j = 0; j < nn; j++) { if (pp[j] != NULL) l += strlen(pp[j]); } if (!BUF_MEM_grow_clean(buf, (int)(l * 2 + nn))) goto err; p = buf->data; for (j = 0; j < nn; j++) { f = pp[j]; if (f != NULL) for (;;) { if (*f == '\0') break; if (*f == '\t') *(p++) = '\\'; *(p++) = *(f++); } *(p++) = '\t'; } p[-1] = '\n'; j = p - buf->data; if (BIO_write(out, buf->data, (int)j) != j) goto err; tot += j; } ret = tot; err: BUF_MEM_free(buf); return ret; } crypto/txt_db/txt_db.c:233: error: NULL_DEREFERENCE pointer `buf` last assigned on line 197 could be null and is dereferenced by call to `BUF_MEM_free()` at line 233, column 5. Showing all 31 steps of the trace crypto/txt_db/txt_db.c:190:1: start of procedure TXT_DB_write() 188. } 189. 190. > long TXT_DB_write(BIO *out, TXT_DB *db) 191. { 192. long i, j, n, nn, l, tot = 0; crypto/txt_db/txt_db.c:192:5: 190. long TXT_DB_write(BIO *out, TXT_DB *db) 191. { 192. > long i, j, n, nn, l, tot = 0; 193. char *p, **pp, *f; 194. BUF_MEM *buf = NULL; crypto/txt_db/txt_db.c:194:5: 192. long i, j, n, nn, l, tot = 0; 193. char *p, **pp, *f; 194. > BUF_MEM *buf = NULL; 195. long ret = -1; 196. crypto/txt_db/txt_db.c:195:5: 193. char *p, **pp, *f; 194. BUF_MEM *buf = NULL; 195. > long ret = -1; 196. 197. if ((buf = BUF_MEM_new()) == NULL) crypto/txt_db/txt_db.c:197:9: 195. long ret = -1; 196. 197. > if ((buf = BUF_MEM_new()) == NULL) 198. goto err; 199. n = sk_OPENSSL_PSTRING_num(db->data); crypto/buffer/buffer.c:31:1: start of procedure BUF_MEM_new() 29. } 30. 31. > BUF_MEM *BUF_MEM_new(void) 32. { 33. BUF_MEM *ret; crypto/buffer/buffer.c:35:5: 33. BUF_MEM *ret; 34. 35. > ret = OPENSSL_zalloc(sizeof(*ret)); 36. if (ret == NULL) { 37. BUFerr(BUF_F_BUF_MEM_NEW, ERR_R_MALLOC_FAILURE); 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 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) crypto/buffer/buffer.c:36:9: Taking true branch 34. 35. ret = OPENSSL_zalloc(sizeof(*ret)); 36. if (ret == NULL) { ^ 37. BUFerr(BUF_F_BUF_MEM_NEW, ERR_R_MALLOC_FAILURE); 38. return NULL; crypto/buffer/buffer.c:37:9: Skipping ERR_put_error(): empty list of specs 35. ret = OPENSSL_zalloc(sizeof(*ret)); 36. if (ret == NULL) { 37. BUFerr(BUF_F_BUF_MEM_NEW, ERR_R_MALLOC_FAILURE); ^ 38. return NULL; 39. } crypto/buffer/buffer.c:38:9: 36. if (ret == NULL) { 37. BUFerr(BUF_F_BUF_MEM_NEW, ERR_R_MALLOC_FAILURE); 38. > return NULL; 39. } 40. return ret; crypto/buffer/buffer.c:41:1: return from a call to BUF_MEM_new 39. } 40. return ret; 41. > } 42. 43. void BUF_MEM_free(BUF_MEM *a) crypto/txt_db/txt_db.c:197:9: Taking true branch 195. long ret = -1; 196. 197. if ((buf = BUF_MEM_new()) == NULL) ^ 198. goto err; 199. n = sk_OPENSSL_PSTRING_num(db->data); crypto/txt_db/txt_db.c:232:2: 230. } 231. ret = tot; 232. > err: 233. BUF_MEM_free(buf); 234. return ret; crypto/txt_db/txt_db.c:233:5: 231. ret = tot; 232. err: 233. > BUF_MEM_free(buf); 234. return ret; 235. } crypto/buffer/buffer.c:43:1: start of procedure BUF_MEM_free() 41. } 42. 43. > void BUF_MEM_free(BUF_MEM *a) 44. { 45. if (a->data != NULL) { crypto/buffer/buffer.c:45:9: 43. void BUF_MEM_free(BUF_MEM *a) 44. { 45. > if (a->data != NULL) { 46. if (a->flags & BUF_MEM_FLAG_SECURE) 47. OPENSSL_secure_clear_free(a->data, a->max);
https://github.com/openssl/openssl/blob/98c03302fb7b855647aa14022f61f5fb272e514a/crypto/txt_db/txt_db.c/#L233
d2a_code_trace_data_45113
static int tls_curve_allowed(SSL *s, const unsigned char *curve, int op) { const tls_curve_info *cinfo; if (curve[0]) return 1; if ((curve[1] < 1) || ((size_t)curve[1] > OSSL_NELEM(nid_list))) return 0; cinfo = &nid_list[curve[1] - 1]; # ifdef OPENSSL_NO_EC2M if (cinfo->flags & TLS_CURVE_CHAR2) return 0; # endif return ssl_security(s, op, cinfo->secbits, cinfo->nid, (void *)curve); } ssl/t1_lib.c:1156: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: 29 by call to `tls_curve_allowed`. Showing all 7 steps of the trace ssl/t1_lib.c:1026:1: Parameter `*s->session->tlsext_supportedgroupslist` 1024. } 1025. 1026. > int ssl_add_clienthello_tlsext(SSL *s, WPACKET *pkt, int *al) 1027. { 1028. #ifndef OPENSSL_NO_EC ssl/t1_lib.c:1156:17: Call 1154. /* Copy curve ID if supported */ 1155. for (i = 0; i < num_curves; i++, pcurvestmp += 2) { 1156. if (tls_curve_allowed(s, pcurves, SSL_SECOP_CURVE_SUPPORTED)) { ^ 1157. if (!WPACKET_put_bytes_u8(pkt, pcurvestmp[0]) 1158. || !WPACKET_put_bytes_u8(pkt, pcurvestmp[1])) { ssl/t1_lib.c:312:1: <Offset trace> 310. 311. /* See if curve is allowed by security callback */ 312. > static int tls_curve_allowed(SSL *s, const unsigned char *curve, int op) 313. { 314. const tls_curve_info *cinfo; ssl/t1_lib.c:312:1: Parameter `*curve` 310. 311. /* See if curve is allowed by security callback */ 312. > static int tls_curve_allowed(SSL *s, const unsigned char *curve, int op) 313. { 314. const tls_curve_info *cinfo; ssl/t1_lib.c:144:1: <Length trace> 142. * table: the index of each entry is one less than the TLS curve id. 143. */ 144. > static const tls_curve_info nid_list[] = { 145. {NID_sect163k1, 80, TLS_CURVE_CHAR2}, /* sect163k1 (1) */ 146. {NID_sect163r1, 80, TLS_CURVE_CHAR2}, /* sect163r1 (2) */ ssl/t1_lib.c:144:1: Array declaration 142. * table: the index of each entry is one less than the TLS curve id. 143. */ 144. > static const tls_curve_info nid_list[] = { 145. {NID_sect163k1, 80, TLS_CURVE_CHAR2}, /* sect163k1 (1) */ 146. {NID_sect163r1, 80, TLS_CURVE_CHAR2}, /* sect163r1 (2) */ ssl/t1_lib.c:319:5: Array access: Offset: [-1, +oo] Size: 29 by call to `tls_curve_allowed` 317. if ((curve[1] < 1) || ((size_t)curve[1] > OSSL_NELEM(nid_list))) 318. return 0; 319. cinfo = &nid_list[curve[1] - 1]; ^ 320. # ifdef OPENSSL_NO_EC2M 321. if (cinfo->flags & TLS_CURVE_CHAR2)
https://github.com/openssl/openssl/blob/d7c42d71ba407a4b3c26ed58263ae225976bbac3/ssl/t1_lib.c/#L319
d2a_code_trace_data_45114
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; 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; #ifndef OPENSSL_NO_SHA256 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; #endif #ifndef OPENSSL_NO_SHA512 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; #endif 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(j, c); is_past_cp1 = is_block_a & constant_time_ge(j, c+1); b = (b&~is_past_c) | (0x80&is_past_c); b = b&~is_past_cp1; b &= ~is_block_b | is_block_a; if (j >= md_block_size - md_length_size) { b = (b&~is_block_b) | (is_block_b&length_bytes[j-(md_block_size-md_length_size)]); } 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); } EVP_DigestFinal(&md_ctx, md_out, &md_out_size_u); if (md_out_size) *md_out_size = md_out_size_u; EVP_MD_CTX_cleanup(&md_ctx); } ssl/s3_enc.c:785: error: INTEGER_OVERFLOW_L2 ([13, +oo] - [16, 64]):unsigned64 by call to `ssl3_cbc_digest_record`. Showing all 7 steps of the trace ssl/s3_enc.c:726:1: Parameter `ssl->s3->rrec.length` 724. } 725. 726. > int n_ssl3_mac(SSL *ssl, unsigned char *md, int send) 727. { 728. SSL3_RECORD *rec; ssl/s3_enc.c:785:3: Call 783. header[j++] = rec->length & 0xff; 784. 785. ssl3_cbc_digest_record( ^ 786. hash, 787. md, &md_size, ssl/s3_cbc.c:433:1: <LHS trace> 431. * a padding byte and MAC. (If the padding was invalid, it might contain the 432. * padding too. ) */ 433. > void ssl3_cbc_digest_record( 434. const EVP_MD_CTX *ctx, 435. unsigned char* md_out, ssl/s3_cbc.c:433:1: Parameter `data_plus_mac_size` 431. * a padding byte and MAC. (If the padding was invalid, it might contain the 432. * padding too. ) */ 433. > void ssl3_cbc_digest_record( 434. const EVP_MD_CTX *ctx, 435. unsigned char* md_out, ssl/s3_cbc.c:476:4: <RHS trace> 474. md_final_raw = tls1_md5_final_raw; 475. md_transform = (void(*)(void *ctx, const unsigned char *block)) MD5_Transform; 476. md_size = 16; ^ 477. sslv3_pad_length = 48; 478. length_is_big_endian = 0; ssl/s3_cbc.c:476:4: Assignment 474. md_final_raw = tls1_md5_final_raw; 475. md_transform = (void(*)(void *ctx, const unsigned char *block)) MD5_Transform; 476. md_size = 16; ^ 477. sslv3_pad_length = 48; 478. length_is_big_endian = 0; ssl/s3_cbc.c:581:2: Binary operation: ([13, +oo] - [16, 64]):unsigned64 by call to `ssl3_cbc_digest_record` 579. /* mac_end_offset is the index just past the end of the data to be 580. * MACed. */ 581. mac_end_offset = data_plus_mac_size + header_length - md_size; ^ 582. /* c is the index of the 0x80 byte in the final hash block that 583. * contains application data. */
https://github.com/openssl/openssl/blob/f93a41877d8d7a287debb7c63d7b646abaaf269c/ssl/s3_cbc.c/#L581
d2a_code_trace_data_45115
int MAIN(int argc, char *argv[]) { X509_VERIFY_PARAM *vpm = NULL; int badarg = 0; short port=PORT; char *CApath=NULL,*CAfile=NULL; unsigned char *context = NULL; char *dhfile = NULL; #ifndef OPENSSL_NO_ECDH char *named_curve = NULL; #endif int badop=0,bugs=0; int ret=1; int off=0; int no_tmp_rsa=0,no_dhe=0,no_ecdhe=0,nocert=0; int state=0; const SSL_METHOD *meth=NULL; int socket_type=SOCK_STREAM; ENGINE *e=NULL; char *inrand=NULL; int s_cert_format = FORMAT_PEM, s_key_format = FORMAT_PEM; char *passarg = NULL, *pass = NULL; char *dpassarg = NULL, *dpass = NULL; int s_dcert_format = FORMAT_PEM, s_dkey_format = FORMAT_PEM; X509 *s_cert = NULL, *s_dcert = NULL; EVP_PKEY *s_key = NULL, *s_dkey = NULL; int no_cache = 0, ext_cache = 0; #ifndef OPENSSL_NO_TLSEXT EVP_PKEY *s_key2 = NULL; X509 *s_cert2 = NULL; #endif #ifndef OPENSSL_NO_TLSEXT tlsextctx tlsextcbp = {NULL, NULL, SSL_TLSEXT_ERR_ALERT_WARNING}; # ifndef OPENSSL_NO_NPN const char *next_proto_neg_in = NULL; tlsextnextprotoctx next_proto; # endif #endif #ifndef OPENSSL_NO_PSK static char *psk_identity_hint=NULL; #endif #if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3) meth=SSLv23_server_method(); #elif !defined(OPENSSL_NO_SSL3) meth=SSLv3_server_method(); #elif !defined(OPENSSL_NO_SSL2) meth=SSLv2_server_method(); #endif local_argc=argc; local_argv=argv; apps_startup(); #ifdef MONOLITH s_server_init(); #endif if (bio_err == NULL) bio_err=BIO_new_fp(stderr,BIO_NOCLOSE); if (!load_config(bio_err, NULL)) goto end; verify_depth=0; #ifdef FIONBIO s_nbio=0; #endif s_nbio_test=0; argc--; argv++; while (argc >= 1) { if ((strcmp(*argv,"-port") == 0) || (strcmp(*argv,"-accept") == 0)) { if (--argc < 1) goto bad; if (!extract_port(*(++argv),&port)) goto bad; } else if (strcmp(*argv,"-verify") == 0) { s_server_verify=SSL_VERIFY_PEER|SSL_VERIFY_CLIENT_ONCE; if (--argc < 1) goto bad; verify_depth=atoi(*(++argv)); BIO_printf(bio_err,"verify depth is %d\n",verify_depth); } else if (strcmp(*argv,"-Verify") == 0) { s_server_verify=SSL_VERIFY_PEER|SSL_VERIFY_FAIL_IF_NO_PEER_CERT| SSL_VERIFY_CLIENT_ONCE; if (--argc < 1) goto bad; verify_depth=atoi(*(++argv)); BIO_printf(bio_err,"verify depth is %d, must return a certificate\n",verify_depth); } else if (strcmp(*argv,"-context") == 0) { if (--argc < 1) goto bad; context= (unsigned char *)*(++argv); } else if (strcmp(*argv,"-cert") == 0) { if (--argc < 1) goto bad; s_cert_file= *(++argv); } else if (strcmp(*argv,"-certform") == 0) { if (--argc < 1) goto bad; s_cert_format = str2fmt(*(++argv)); } else if (strcmp(*argv,"-key") == 0) { if (--argc < 1) goto bad; s_key_file= *(++argv); } else if (strcmp(*argv,"-keyform") == 0) { if (--argc < 1) goto bad; s_key_format = str2fmt(*(++argv)); } else if (strcmp(*argv,"-pass") == 0) { if (--argc < 1) goto bad; passarg = *(++argv); } else if (strcmp(*argv,"-dhparam") == 0) { if (--argc < 1) goto bad; dhfile = *(++argv); } #ifndef OPENSSL_NO_ECDH else if (strcmp(*argv,"-named_curve") == 0) { if (--argc < 1) goto bad; named_curve = *(++argv); } #endif else if (strcmp(*argv,"-dcertform") == 0) { if (--argc < 1) goto bad; s_dcert_format = str2fmt(*(++argv)); } else if (strcmp(*argv,"-dcert") == 0) { if (--argc < 1) goto bad; s_dcert_file= *(++argv); } else if (strcmp(*argv,"-dkeyform") == 0) { if (--argc < 1) goto bad; s_dkey_format = str2fmt(*(++argv)); } else if (strcmp(*argv,"-dpass") == 0) { if (--argc < 1) goto bad; dpassarg = *(++argv); } else if (strcmp(*argv,"-dkey") == 0) { if (--argc < 1) goto bad; s_dkey_file= *(++argv); } else if (strcmp(*argv,"-nocert") == 0) { nocert=1; } else if (strcmp(*argv,"-CApath") == 0) { if (--argc < 1) goto bad; CApath= *(++argv); } else if (strcmp(*argv,"-no_cache") == 0) no_cache = 1; else if (strcmp(*argv,"-ext_cache") == 0) ext_cache = 1; else if (args_verify(&argv, &argc, &badarg, bio_err, &vpm)) { if (badarg) goto bad; continue; } else if (strcmp(*argv,"-verify_return_error") == 0) verify_return_error = 1; else if (strcmp(*argv,"-serverpref") == 0) { off|=SSL_OP_CIPHER_SERVER_PREFERENCE; } else if (strcmp(*argv,"-legacy_renegotiation") == 0) off|=SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION; else if (strcmp(*argv,"-cipher") == 0) { if (--argc < 1) goto bad; cipher= *(++argv); } else if (strcmp(*argv,"-CAfile") == 0) { if (--argc < 1) goto bad; CAfile= *(++argv); } #ifdef FIONBIO else if (strcmp(*argv,"-nbio") == 0) { s_nbio=1; } #endif else if (strcmp(*argv,"-nbio_test") == 0) { #ifdef FIONBIO s_nbio=1; #endif s_nbio_test=1; } else if (strcmp(*argv,"-debug") == 0) { s_debug=1; } #ifndef OPENSSL_NO_TLSEXT else if (strcmp(*argv,"-tlsextdebug") == 0) s_tlsextdebug=1; else if (strcmp(*argv,"-status") == 0) s_tlsextstatus=1; else if (strcmp(*argv,"-status_verbose") == 0) { s_tlsextstatus=1; tlscstatp.verbose = 1; } else if (!strcmp(*argv, "-status_timeout")) { s_tlsextstatus=1; if (--argc < 1) goto bad; tlscstatp.timeout = atoi(*(++argv)); } else if (!strcmp(*argv, "-status_url")) { s_tlsextstatus=1; if (--argc < 1) goto bad; if (!OCSP_parse_url(*(++argv), &tlscstatp.host, &tlscstatp.port, &tlscstatp.path, &tlscstatp.use_ssl)) { BIO_printf(bio_err, "Error parsing URL\n"); goto bad; } } #endif else if (strcmp(*argv,"-msg") == 0) { s_msg=1; } else if (strcmp(*argv,"-hack") == 0) { hack=1; } else if (strcmp(*argv,"-state") == 0) { state=1; } else if (strcmp(*argv,"-crlf") == 0) { s_crlf=1; } else if (strcmp(*argv,"-quiet") == 0) { s_quiet=1; } else if (strcmp(*argv,"-bugs") == 0) { bugs=1; } else if (strcmp(*argv,"-no_tmp_rsa") == 0) { no_tmp_rsa=1; } else if (strcmp(*argv,"-no_dhe") == 0) { no_dhe=1; } else if (strcmp(*argv,"-no_ecdhe") == 0) { no_ecdhe=1; } #ifndef OPENSSL_NO_PSK else if (strcmp(*argv,"-psk_hint") == 0) { if (--argc < 1) goto bad; psk_identity_hint= *(++argv); } else if (strcmp(*argv,"-psk") == 0) { size_t i; if (--argc < 1) goto bad; psk_key=*(++argv); for (i=0; i<strlen(psk_key); i++) { if (isxdigit((int)psk_key[i])) continue; BIO_printf(bio_err,"Not a hex number '%s'\n",*argv); goto bad; } } #endif else if (strcmp(*argv,"-www") == 0) { www=1; } else if (strcmp(*argv,"-WWW") == 0) { www=2; } else if (strcmp(*argv,"-HTTP") == 0) { www=3; } else if (strcmp(*argv,"-no_ssl2") == 0) { off|=SSL_OP_NO_SSLv2; } else if (strcmp(*argv,"-no_ssl3") == 0) { off|=SSL_OP_NO_SSLv3; } else if (strcmp(*argv,"-no_tls1_1") == 0) { off|=SSL_OP_NO_TLSv1_1; } else if (strcmp(*argv,"-no_tls1") == 0) { off|=SSL_OP_NO_TLSv1; } else if (strcmp(*argv,"-no_comp") == 0) { off|=SSL_OP_NO_COMPRESSION; } #ifndef OPENSSL_NO_TLSEXT else if (strcmp(*argv,"-no_ticket") == 0) { off|=SSL_OP_NO_TICKET; } #endif #ifndef OPENSSL_NO_SSL2 else if (strcmp(*argv,"-ssl2") == 0) { meth=SSLv2_server_method(); } #endif #ifndef OPENSSL_NO_SSL3 else if (strcmp(*argv,"-ssl3") == 0) { meth=SSLv3_server_method(); } #endif #ifndef OPENSSL_NO_TLS1 else if (strcmp(*argv,"-tls1_1") == 0) { meth=TLSv1_1_server_method(); } else if (strcmp(*argv,"-tls1") == 0) { meth=TLSv1_server_method(); } #endif #ifndef OPENSSL_NO_DTLS1 else if (strcmp(*argv,"-dtls1") == 0) { meth=DTLSv1_server_method(); socket_type = SOCK_DGRAM; } else if (strcmp(*argv,"-timeout") == 0) enable_timeouts = 1; else if (strcmp(*argv,"-mtu") == 0) { if (--argc < 1) goto bad; socket_mtu = atol(*(++argv)); } else if (strcmp(*argv, "-chain") == 0) cert_chain = 1; #endif else if (strcmp(*argv, "-id_prefix") == 0) { if (--argc < 1) goto bad; session_id_prefix = *(++argv); } #ifndef OPENSSL_NO_ENGINE else if (strcmp(*argv,"-engine") == 0) { if (--argc < 1) goto bad; engine_id= *(++argv); } #endif else if (strcmp(*argv,"-rand") == 0) { if (--argc < 1) goto bad; inrand= *(++argv); } #ifndef OPENSSL_NO_TLSEXT else if (strcmp(*argv,"-servername") == 0) { if (--argc < 1) goto bad; tlsextcbp.servername= *(++argv); } else if (strcmp(*argv,"-servername_fatal") == 0) { tlsextcbp.extension_error = SSL_TLSEXT_ERR_ALERT_FATAL; } else if (strcmp(*argv,"-cert2") == 0) { if (--argc < 1) goto bad; s_cert_file2= *(++argv); } else if (strcmp(*argv,"-key2") == 0) { if (--argc < 1) goto bad; s_key_file2= *(++argv); } # ifndef OPENSSL_NO_NPN else if (strcmp(*argv,"-nextprotoneg") == 0) { if (--argc < 1) goto bad; next_proto_neg_in = *(++argv); } # endif #endif #if !defined(OPENSSL_NO_JPAKE) && !defined(OPENSSL_NO_PSK) else if (strcmp(*argv,"-jpake") == 0) { if (--argc < 1) goto bad; jpake_secret = *(++argv); } #endif else { BIO_printf(bio_err,"unknown option %s\n",*argv); badop=1; break; } argc--; argv++; } if (badop) { bad: sv_usage(); goto end; } #if !defined(OPENSSL_NO_JPAKE) && !defined(OPENSSL_NO_PSK) if (jpake_secret) { if (psk_key) { BIO_printf(bio_err, "Can't use JPAKE and PSK together\n"); goto end; } psk_identity = "JPAKE"; if (cipher) { BIO_printf(bio_err, "JPAKE sets cipher to PSK\n"); goto end; } cipher = "PSK"; } #endif SSL_load_error_strings(); OpenSSL_add_ssl_algorithms(); #ifndef OPENSSL_NO_ENGINE e = setup_engine(bio_err, engine_id, 1); #endif if (!app_passwd(bio_err, passarg, dpassarg, &pass, &dpass)) { BIO_printf(bio_err, "Error getting password\n"); goto end; } if (s_key_file == NULL) s_key_file = s_cert_file; #ifndef OPENSSL_NO_TLSEXT if (s_key_file2 == NULL) s_key_file2 = s_cert_file2; #endif if (nocert == 0) { s_key = load_key(bio_err, s_key_file, s_key_format, 0, pass, e, "server certificate private key file"); if (!s_key) { ERR_print_errors(bio_err); goto end; } s_cert = load_cert(bio_err,s_cert_file,s_cert_format, NULL, e, "server certificate file"); if (!s_cert) { ERR_print_errors(bio_err); goto end; } #ifndef OPENSSL_NO_TLSEXT if (tlsextcbp.servername) { s_key2 = load_key(bio_err, s_key_file2, s_key_format, 0, pass, e, "second server certificate private key file"); if (!s_key2) { ERR_print_errors(bio_err); goto end; } s_cert2 = load_cert(bio_err,s_cert_file2,s_cert_format, NULL, e, "second server certificate file"); if (!s_cert2) { ERR_print_errors(bio_err); goto end; } } # ifndef OPENSSL_NO_NPN if (next_proto_neg_in) { unsigned short len; next_proto.data = next_protos_parse(&len, next_proto_neg_in); if (next_proto.data == NULL) goto end; next_proto.len = len; } else { next_proto.data = NULL; } # endif #endif } if (s_dcert_file) { if (s_dkey_file == NULL) s_dkey_file = s_dcert_file; s_dkey = load_key(bio_err, s_dkey_file, s_dkey_format, 0, dpass, e, "second certificate private key file"); if (!s_dkey) { ERR_print_errors(bio_err); goto end; } s_dcert = load_cert(bio_err,s_dcert_file,s_dcert_format, NULL, e, "second server certificate file"); if (!s_dcert) { ERR_print_errors(bio_err); goto end; } } if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL && !RAND_status()) { BIO_printf(bio_err,"warning, not much extra random data, consider using the -rand option\n"); } if (inrand != NULL) BIO_printf(bio_err,"%ld semi-random bytes loaded\n", app_RAND_load_files(inrand)); if (bio_s_out == NULL) { if (s_quiet && !s_debug && !s_msg) { bio_s_out=BIO_new(BIO_s_null()); } else { if (bio_s_out == NULL) bio_s_out=BIO_new_fp(stdout,BIO_NOCLOSE); } } #if !defined(OPENSSL_NO_RSA) || !defined(OPENSSL_NO_DSA) || !defined(OPENSSL_NO_ECDSA) if (nocert) #endif { s_cert_file=NULL; s_key_file=NULL; s_dcert_file=NULL; s_dkey_file=NULL; #ifndef OPENSSL_NO_TLSEXT s_cert_file2=NULL; s_key_file2=NULL; #endif } ctx=SSL_CTX_new(meth); if (ctx == NULL) { ERR_print_errors(bio_err); goto end; } if (session_id_prefix) { if(strlen(session_id_prefix) >= 32) BIO_printf(bio_err, "warning: id_prefix is too long, only one new session will be possible\n"); else if(strlen(session_id_prefix) >= 16) BIO_printf(bio_err, "warning: id_prefix is too long if you use SSLv2\n"); if(!SSL_CTX_set_generate_session_id(ctx, generate_session_id)) { BIO_printf(bio_err,"error setting 'id_prefix'\n"); ERR_print_errors(bio_err); goto end; } BIO_printf(bio_err,"id_prefix '%s' set.\n", session_id_prefix); } SSL_CTX_set_quiet_shutdown(ctx,1); if (bugs) SSL_CTX_set_options(ctx,SSL_OP_ALL); if (hack) SSL_CTX_set_options(ctx,SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG); SSL_CTX_set_options(ctx,off); if (socket_type == SOCK_DGRAM) SSL_CTX_set_read_ahead(ctx, 1); if (state) SSL_CTX_set_info_callback(ctx,apps_ssl_info_callback); if (no_cache) SSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_OFF); else if (ext_cache) init_session_cache_ctx(ctx); else SSL_CTX_sess_set_cache_size(ctx,128); #if 0 if (cipher == NULL) cipher=getenv("SSL_CIPHER"); #endif #if 0 if (s_cert_file == NULL) { BIO_printf(bio_err,"You must specify a certificate file for the server to use\n"); goto end; } #endif if ((!SSL_CTX_load_verify_locations(ctx,CAfile,CApath)) || (!SSL_CTX_set_default_verify_paths(ctx))) { ERR_print_errors(bio_err); } if (vpm) SSL_CTX_set1_param(ctx, vpm); #ifndef OPENSSL_NO_TLSEXT if (s_cert2) { ctx2=SSL_CTX_new(meth); if (ctx2 == NULL) { ERR_print_errors(bio_err); goto end; } } if (ctx2) { BIO_printf(bio_s_out,"Setting secondary ctx parameters\n"); if (session_id_prefix) { if(strlen(session_id_prefix) >= 32) BIO_printf(bio_err, "warning: id_prefix is too long, only one new session will be possible\n"); else if(strlen(session_id_prefix) >= 16) BIO_printf(bio_err, "warning: id_prefix is too long if you use SSLv2\n"); if(!SSL_CTX_set_generate_session_id(ctx2, generate_session_id)) { BIO_printf(bio_err,"error setting 'id_prefix'\n"); ERR_print_errors(bio_err); goto end; } BIO_printf(bio_err,"id_prefix '%s' set.\n", session_id_prefix); } SSL_CTX_set_quiet_shutdown(ctx2,1); if (bugs) SSL_CTX_set_options(ctx2,SSL_OP_ALL); if (hack) SSL_CTX_set_options(ctx2,SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG); SSL_CTX_set_options(ctx2,off); if (socket_type == SOCK_DGRAM) SSL_CTX_set_read_ahead(ctx2, 1); if (state) SSL_CTX_set_info_callback(ctx2,apps_ssl_info_callback); if (no_cache) SSL_CTX_set_session_cache_mode(ctx2,SSL_SESS_CACHE_OFF); else if (ext_cache) init_session_cache_ctx(ctx2); else SSL_CTX_sess_set_cache_size(ctx2,128); if ((!SSL_CTX_load_verify_locations(ctx2,CAfile,CApath)) || (!SSL_CTX_set_default_verify_paths(ctx2))) { ERR_print_errors(bio_err); } if (vpm) SSL_CTX_set1_param(ctx2, vpm); } # ifndef OPENSSL_NO_NPN if (next_proto.data) SSL_CTX_set_next_protos_advertised_cb(ctx, next_proto_cb, &next_proto); # endif #endif #ifndef OPENSSL_NO_DH if (!no_dhe) { DH *dh=NULL; if (dhfile) dh = load_dh_param(dhfile); else if (s_cert_file) dh = load_dh_param(s_cert_file); if (dh != NULL) { BIO_printf(bio_s_out,"Setting temp DH parameters\n"); } else { BIO_printf(bio_s_out,"Using default temp DH parameters\n"); dh=get_dh512(); } (void)BIO_flush(bio_s_out); SSL_CTX_set_tmp_dh(ctx,dh); #ifndef OPENSSL_NO_TLSEXT if (ctx2) { if (!dhfile) { DH *dh2=load_dh_param(s_cert_file2); if (dh2 != NULL) { BIO_printf(bio_s_out,"Setting temp DH parameters\n"); (void)BIO_flush(bio_s_out); DH_free(dh); dh = dh2; } } SSL_CTX_set_tmp_dh(ctx2,dh); } #endif DH_free(dh); } #endif #ifndef OPENSSL_NO_ECDH if (!no_ecdhe) { EC_KEY *ecdh=NULL; if (named_curve) { int nid = OBJ_sn2nid(named_curve); if (nid == 0) { BIO_printf(bio_err, "unknown curve name (%s)\n", named_curve); goto end; } ecdh = EC_KEY_new_by_curve_name(nid); if (ecdh == NULL) { BIO_printf(bio_err, "unable to create curve (%s)\n", named_curve); goto end; } } if (ecdh != NULL) { BIO_printf(bio_s_out,"Setting temp ECDH parameters\n"); } else { BIO_printf(bio_s_out,"Using default temp ECDH parameters\n"); ecdh = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1); if (ecdh == NULL) { BIO_printf(bio_err, "unable to create curve (nistp256)\n"); goto end; } } (void)BIO_flush(bio_s_out); SSL_CTX_set_tmp_ecdh(ctx,ecdh); #ifndef OPENSSL_NO_TLSEXT if (ctx2) SSL_CTX_set_tmp_ecdh(ctx2,ecdh); #endif EC_KEY_free(ecdh); } #endif if (!set_cert_key_stuff(ctx,s_cert,s_key)) goto end; #ifndef OPENSSL_NO_TLSEXT if (ctx2 && !set_cert_key_stuff(ctx2,s_cert2,s_key2)) goto end; #endif if (s_dcert != NULL) { if (!set_cert_key_stuff(ctx,s_dcert,s_dkey)) goto end; } #ifndef OPENSSL_NO_RSA #if 1 if (!no_tmp_rsa) { SSL_CTX_set_tmp_rsa_callback(ctx,tmp_rsa_cb); #ifndef OPENSSL_NO_TLSEXT if (ctx2) SSL_CTX_set_tmp_rsa_callback(ctx2,tmp_rsa_cb); #endif } #else if (!no_tmp_rsa && SSL_CTX_need_tmp_RSA(ctx)) { RSA *rsa; BIO_printf(bio_s_out,"Generating temp (512 bit) RSA key..."); BIO_flush(bio_s_out); rsa=RSA_generate_key(512,RSA_F4,NULL); if (!SSL_CTX_set_tmp_rsa(ctx,rsa)) { ERR_print_errors(bio_err); goto end; } #ifndef OPENSSL_NO_TLSEXT if (ctx2) { if (!SSL_CTX_set_tmp_rsa(ctx2,rsa)) { ERR_print_errors(bio_err); goto end; } } #endif RSA_free(rsa); BIO_printf(bio_s_out,"\n"); } #endif #endif #ifndef OPENSSL_NO_PSK #ifdef OPENSSL_NO_JPAKE if (psk_key != NULL) #else if (psk_key != NULL || jpake_secret) #endif { if (s_debug) BIO_printf(bio_s_out, "PSK key given or JPAKE in use, setting server callback\n"); SSL_CTX_set_psk_server_callback(ctx, psk_server_cb); } if (!SSL_CTX_use_psk_identity_hint(ctx, psk_identity_hint)) { BIO_printf(bio_err,"error setting PSK identity hint to context\n"); ERR_print_errors(bio_err); goto end; } #endif if (cipher != NULL) { if(!SSL_CTX_set_cipher_list(ctx,cipher)) { BIO_printf(bio_err,"error setting cipher list\n"); ERR_print_errors(bio_err); goto end; } #ifndef OPENSSL_NO_TLSEXT if (ctx2 && !SSL_CTX_set_cipher_list(ctx2,cipher)) { BIO_printf(bio_err,"error setting cipher list\n"); ERR_print_errors(bio_err); goto end; } #endif } SSL_CTX_set_verify(ctx,s_server_verify,verify_callback); SSL_CTX_set_session_id_context(ctx,(void*)&s_server_session_id_context, sizeof s_server_session_id_context); SSL_CTX_set_cookie_generate_cb(ctx, generate_cookie_callback); SSL_CTX_set_cookie_verify_cb(ctx, verify_cookie_callback); #ifndef OPENSSL_NO_TLSEXT if (ctx2) { SSL_CTX_set_verify(ctx2,s_server_verify,verify_callback); SSL_CTX_set_session_id_context(ctx2,(void*)&s_server_session_id_context, sizeof s_server_session_id_context); tlsextcbp.biodebug = bio_s_out; SSL_CTX_set_tlsext_servername_callback(ctx2, ssl_servername_cb); SSL_CTX_set_tlsext_servername_arg(ctx2, &tlsextcbp); SSL_CTX_set_tlsext_servername_callback(ctx, ssl_servername_cb); SSL_CTX_set_tlsext_servername_arg(ctx, &tlsextcbp); } #endif if (CAfile != NULL) { SSL_CTX_set_client_CA_list(ctx,SSL_load_client_CA_file(CAfile)); #ifndef OPENSSL_NO_TLSEXT if (ctx2) SSL_CTX_set_client_CA_list(ctx2,SSL_load_client_CA_file(CAfile)); #endif } BIO_printf(bio_s_out,"ACCEPT\n"); (void)BIO_flush(bio_s_out); if (www) do_server(port,socket_type,&accept_socket,www_body, context); else do_server(port,socket_type,&accept_socket,sv_body, context); print_stats(bio_s_out,ctx); ret=0; end: if (ctx != NULL) SSL_CTX_free(ctx); if (s_cert) X509_free(s_cert); if (s_dcert) X509_free(s_dcert); if (s_key) EVP_PKEY_free(s_key); if (s_dkey) EVP_PKEY_free(s_dkey); if (pass) OPENSSL_free(pass); if (dpass) OPENSSL_free(dpass); free_sessions(); #ifndef OPENSSL_NO_TLSEXT if (ctx2 != NULL) SSL_CTX_free(ctx2); if (s_cert2) X509_free(s_cert2); if (s_key2) EVP_PKEY_free(s_key2); #endif if (bio_s_out != NULL) { BIO_free(bio_s_out); bio_s_out=NULL; } apps_shutdown(); OPENSSL_EXIT(ret); } apps/s_server.c:1541: error: UNINITIALIZED_VALUE The value read from next_proto.data was never initialized. Showing all 1 steps of the trace apps/s_server.c:1541:6: 1539. 1540. # ifndef OPENSSL_NO_NPN 1541. > if (next_proto.data) 1542. SSL_CTX_set_next_protos_advertised_cb(ctx, next_proto_cb, &next_proto); 1543. # endif
https://github.com/openssl/openssl/blob/173350bccaf25d6114a7108ccceabb974f125fa4/apps/s_server.c/#L1541
d2a_code_trace_data_45116
void *av_fast_realloc(void *ptr, unsigned int *size, unsigned int min_size) { if(min_size < *size) return ptr; *size= FFMAX(17*min_size/16 + 32, min_size); ptr= av_realloc(ptr, *size); if(!ptr) *size= 0; return ptr; } libavformat/utils.c:1058: error: Integer Overflow L2 (17 × [24⋅`st->nb_index_entries` + 24, 4294967256]):unsigned32 by call to `av_fast_realloc`. libavformat/utils.c:1049:1: Parameter `st->nb_index_entries` 1047. } 1048. 1049. int av_add_index_entry(AVStream *st, ^ 1050. int64_t pos, int64_t timestamp, int size, int distance, int flags) 1051. { libavformat/utils.c:1058:15: Call 1056. return -1; 1057. 1058. entries = av_fast_realloc(st->index_entries, ^ 1059. &st->index_entries_allocated_size, 1060. (st->nb_index_entries + 1) * libavcodec/utils.c:62:1: <RHS trace> 60. static int volatile entangled_thread_counter=0; 61. 62. void *av_fast_realloc(void *ptr, unsigned int *size, unsigned int min_size) ^ 63. { 64. if(min_size < *size) libavcodec/utils.c:62:1: Parameter `min_size` 60. static int volatile entangled_thread_counter=0; 61. 62. void *av_fast_realloc(void *ptr, unsigned int *size, unsigned int min_size) ^ 63. { 64. if(min_size < *size) libavcodec/utils.c:67:12: Binary operation: (17 × [24⋅st->nb_index_entries + 24, 4294967256]):unsigned32 by call to `av_fast_realloc` 65. return ptr; 66. 67. *size= FFMAX(17*min_size/16 + 32, min_size); ^ 68. 69. ptr= av_realloc(ptr, *size);
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/utils.c/#L67
d2a_code_trace_data_45117
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:4095: error: Null Dereference pointer `today` last assigned on line 4093 could be null and is dereferenced at line 4095, column 69. ffmpeg.c:4089:1: start of procedure opt_vstats() 4087. } 4088. 4089. static void opt_vstats (void) ^ 4090. { 4091. char filename[40]; ffmpeg.c:4092:5: 4090. { 4091. char filename[40]; 4092. time_t today2 = time(NULL); ^ 4093. struct tm *today = localtime(&today2); 4094. ffmpeg.c:4093:5: 4091. char filename[40]; 4092. time_t today2 = time(NULL); 4093. struct tm *today = localtime(&today2); ^ 4094. 4095. snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min, ffmpeg.c:4095:5: 4093. struct tm *today = localtime(&today2); 4094. 4095. snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min, ^ 4096. today->tm_sec); 4097. opt_vstats_file(filename);
https://github.com/libav/libav/blob/ad0d70c964f852a18e9ab8124f0e7aa8876cac6e/ffmpeg.c/#L4095
d2a_code_trace_data_45118
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 && n == 0) { 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 = check_cert_time(ctx, xs); 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:1787: error: NULL_DEREFERENCE pointer `xs` last assigned on line 1774 could be null and is dereferenced at line 1787, column 8. Showing all 36 steps of the trace crypto/x509/x509_vfy.c:1740:1: start of procedure internal_verify() 1738. } 1739. 1740. > static int internal_verify(X509_STORE_CTX *ctx) 1741. { 1742. int ok=0,n; crypto/x509/x509_vfy.c:1742:2: 1740. static int internal_verify(X509_STORE_CTX *ctx) 1741. { 1742. > int ok=0,n; 1743. X509 *xs,*xi; 1744. EVP_PKEY *pkey=NULL; crypto/x509/x509_vfy.c:1744:2: 1742. int ok=0,n; 1743. X509 *xs,*xi; 1744. > EVP_PKEY *pkey=NULL; 1745. int (*cb)(int xok,X509_STORE_CTX *xctx); 1746. crypto/x509/x509_vfy.c:1747:2: 1745. int (*cb)(int xok,X509_STORE_CTX *xctx); 1746. 1747. > cb=ctx->verify_cb; 1748. 1749. n=sk_X509_num(ctx->chain); crypto/x509/x509_vfy.c:1749:4: Condition is true 1747. cb=ctx->verify_cb; 1748. 1749. n=sk_X509_num(ctx->chain); ^ 1750. ctx->error_depth=n-1; 1751. n--; crypto/x509/x509_vfy.c:1749:2: 1747. cb=ctx->verify_cb; 1748. 1749. > n=sk_X509_num(ctx->chain); 1750. ctx->error_depth=n-1; 1751. n--; crypto/stack/stack.c:294:1: start of procedure sk_num() 292. } 293. 294. > int sk_num(const _STACK *st) 295. { 296. if(st == NULL) return -1; crypto/stack/stack.c:296:5: Taking false branch 294. int sk_num(const _STACK *st) 295. { 296. if(st == NULL) return -1; ^ 297. return st->num; 298. } crypto/stack/stack.c:297:2: 295. { 296. if(st == NULL) return -1; 297. > return st->num; 298. } 299. crypto/stack/stack.c:298:1: return from a call to sk_num 296. if(st == NULL) return -1; 297. return st->num; 298. > } 299. 300. void *sk_value(const _STACK *st, int i) crypto/x509/x509_vfy.c:1750:2: 1748. 1749. n=sk_X509_num(ctx->chain); 1750. > ctx->error_depth=n-1; 1751. n--; 1752. xi=sk_X509_value(ctx->chain,n); crypto/x509/x509_vfy.c:1751:2: 1749. n=sk_X509_num(ctx->chain); 1750. ctx->error_depth=n-1; 1751. > n--; 1752. xi=sk_X509_value(ctx->chain,n); 1753. crypto/x509/x509_vfy.c:1752:5: Condition is true 1750. ctx->error_depth=n-1; 1751. n--; 1752. xi=sk_X509_value(ctx->chain,n); ^ 1753. 1754. if (ctx->check_issued(ctx, xi, xi)) crypto/x509/x509_vfy.c:1752:2: 1750. ctx->error_depth=n-1; 1751. n--; 1752. > xi=sk_X509_value(ctx->chain,n); 1753. 1754. if (ctx->check_issued(ctx, xi, xi)) crypto/stack/stack.c:300:1: start of procedure sk_value() 298. } 299. 300. > void *sk_value(const _STACK *st, int i) 301. { 302. if(!st || (i < 0) || (i >= st->num)) return NULL; crypto/stack/stack.c:302:6: Taking false branch 300. void *sk_value(const _STACK *st, int i) 301. { 302. if(!st || (i < 0) || (i >= st->num)) return NULL; ^ 303. return st->data[i]; 304. } crypto/stack/stack.c:302:13: Taking false branch 300. void *sk_value(const _STACK *st, int i) 301. { 302. if(!st || (i < 0) || (i >= st->num)) return NULL; ^ 303. return st->data[i]; 304. } crypto/stack/stack.c:302:24: Taking false branch 300. void *sk_value(const _STACK *st, int i) 301. { 302. if(!st || (i < 0) || (i >= st->num)) return NULL; ^ 303. return st->data[i]; 304. } crypto/stack/stack.c:303:2: 301. { 302. if(!st || (i < 0) || (i >= st->num)) return NULL; 303. > return st->data[i]; 304. } 305. crypto/stack/stack.c:304:1: return from a call to sk_value 302. if(!st || (i < 0) || (i >= st->num)) return NULL; 303. return st->data[i]; 304. > } 305. 306. void *sk_set(_STACK *st, int i, void *value) crypto/x509/x509_vfy.c:1754:6: Taking false branch 1752. xi=sk_X509_value(ctx->chain,n); 1753. 1754. if (ctx->check_issued(ctx, xi, xi)) ^ 1755. xs=xi; 1756. else crypto/x509/x509_vfy.c:1758:7: Taking false branch 1756. else 1757. { 1758. if (ctx->param->flags & X509_V_FLAG_PARTIAL_CHAIN && n == 0) ^ 1759. { 1760. xs = xi; crypto/x509/x509_vfy.c:1763:7: Taking false branch 1761. goto check_cert; 1762. } 1763. if (n <= 0) ^ 1764. { 1765. ctx->error=X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE; crypto/x509/x509_vfy.c:1772:4: 1770. else 1771. { 1772. > n--; 1773. ctx->error_depth=n; 1774. xs=sk_X509_value(ctx->chain,n); crypto/x509/x509_vfy.c:1773:4: 1771. { 1772. n--; 1773. > ctx->error_depth=n; 1774. xs=sk_X509_value(ctx->chain,n); 1775. } crypto/x509/x509_vfy.c:1774:7: Condition is true 1772. n--; 1773. ctx->error_depth=n; 1774. xs=sk_X509_value(ctx->chain,n); ^ 1775. } 1776. } crypto/x509/x509_vfy.c:1774:4: 1772. n--; 1773. ctx->error_depth=n; 1774. > xs=sk_X509_value(ctx->chain,n); 1775. } 1776. } crypto/stack/stack.c:300:1: start of procedure sk_value() 298. } 299. 300. > void *sk_value(const _STACK *st, int i) 301. { 302. if(!st || (i < 0) || (i >= st->num)) return NULL; crypto/stack/stack.c:302:6: Taking false branch 300. void *sk_value(const _STACK *st, int i) 301. { 302. if(!st || (i < 0) || (i >= st->num)) return NULL; ^ 303. return st->data[i]; 304. } crypto/stack/stack.c:302:13: Taking false branch 300. void *sk_value(const _STACK *st, int i) 301. { 302. if(!st || (i < 0) || (i >= st->num)) return NULL; ^ 303. return st->data[i]; 304. } crypto/stack/stack.c:302:24: Taking true branch 300. void *sk_value(const _STACK *st, int i) 301. { 302. if(!st || (i < 0) || (i >= st->num)) return NULL; ^ 303. return st->data[i]; 304. } crypto/stack/stack.c:302:39: 300. void *sk_value(const _STACK *st, int i) 301. { 302. > if(!st || (i < 0) || (i >= st->num)) return NULL; 303. return st->data[i]; 304. } crypto/stack/stack.c:304:1: return from a call to sk_value 302. if(!st || (i < 0) || (i >= st->num)) return NULL; 303. return st->data[i]; 304. > } 305. 306. void *sk_set(_STACK *st, int i, void *value) crypto/x509/x509_vfy.c:1779:9: Loop condition is true. Entering loop body 1777. 1778. /* ctx->error=0; not needed */ 1779. while (n >= 0) ^ 1780. { 1781. ctx->error_depth=n; crypto/x509/x509_vfy.c:1781:3: 1779. while (n >= 0) 1780. { 1781. > ctx->error_depth=n; 1782. 1783. /* Skip signature check for self signed certificates unless crypto/x509/x509_vfy.c:1787:8: Taking false branch 1785. * just wastes time. 1786. */ 1787. if (!xs->valid && (xs != xi || (ctx->param->flags & X509_V_FLAG_CHECK_SS_SIGNATURE))) ^ 1788. { 1789. if ((pkey=X509_get_pubkey(xi)) == NULL)
https://github.com/openssl/openssl/blob/2dac2667d1ec0ffd9f5609cc07f7e1221624e152/crypto/x509/x509_vfy.c/#L1787
d2a_code_trace_data_45119
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:4206: error: Null Dereference pointer `today` last assigned on line 4204 could be null and is dereferenced at line 4206, column 69. ffmpeg.c:4200:1: start of procedure opt_vstats() 4198. } 4199. 4200. static void opt_vstats (void) ^ 4201. { 4202. char filename[40]; ffmpeg.c:4203:5: 4201. { 4202. char filename[40]; 4203. time_t today2 = time(NULL); ^ 4204. struct tm *today = localtime(&today2); 4205. ffmpeg.c:4204:5: 4202. char filename[40]; 4203. time_t today2 = time(NULL); 4204. struct tm *today = localtime(&today2); ^ 4205. 4206. snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min, ffmpeg.c:4206:5: 4204. struct tm *today = localtime(&today2); 4205. 4206. snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min, ^ 4207. today->tm_sec); 4208. opt_vstats_file(filename);
https://github.com/libav/libav/blob/6465c820da7b104150366a8cdd837c00cf364235/ffmpeg.c/#L4206
d2a_code_trace_data_45120
static void doall_util_fn(_LHASH *lh, int use_arg, LHASH_DOALL_FN_TYPE func, LHASH_DOALL_ARG_FN_TYPE func_arg, void *arg) { int i; LHASH_NODE *a,*n; if (lh == NULL) return; for (i=lh->num_nodes-1; i>=0; i--) { a=lh->b[i]; while (a != NULL) { n=a->next; if(use_arg) func_arg(a->data,arg); else func(a->data); a=n; } } } apps/ciphers.c:249: error: INTEGER_OVERFLOW_L2 ([0, 8] - 1):unsigned32 by call to `SSL_CTX_free`. Showing all 13 steps of the trace apps/ciphers.c:174:6: Call 172. OpenSSL_add_ssl_algorithms(); 173. 174. ctx=SSL_CTX_new(meth); ^ 175. if (ctx == NULL) goto err; 176. if (ciphers != NULL) { ssl/ssl_lib.c:2064:16: Call 2062. ret->app_verify_cookie_cb=0; 2063. 2064. ret->sessions=lh_SSL_SESSION_new(); ^ 2065. if (ret->sessions == NULL) goto err; 2066. ret->cert_store=X509_STORE_new(); crypto/lhash/lhash.c:127:2: Assignment 125. ret->comp=((c == NULL)?(LHASH_COMP_FN_TYPE)strcmp:c); 126. ret->hash=((h == NULL)?(LHASH_HASH_FN_TYPE)lh_strhash:h); 127. ret->num_nodes=MIN_NODES/2; ^ 128. ret->num_alloc_nodes=MIN_NODES; 129. ret->p=0; apps/ciphers.c:249:19: Call 247. if (use_supported && sk) 248. sk_SSL_CIPHER_free(sk); 249. if (ctx != NULL) SSL_CTX_free(ctx); ^ 250. if (ssl != NULL) SSL_free(ssl); 251. if (STDout != NULL) BIO_free_all(STDout); ssl/ssl_lib.c:2214:1: Parameter `a->sessions->num_nodes` 2212. #endif 2213. 2214. > void SSL_CTX_free(SSL_CTX *a) 2215. { 2216. int i; ssl/ssl_lib.c:2246:3: Call 2244. */ 2245. if (a->sessions != NULL) 2246. SSL_CTX_flush_sessions(a,0); ^ 2247. 2248. CRYPTO_free_ex_data(CRYPTO_EX_INDEX_SSL_CTX, a, &a->ex_data); ssl/ssl_sess.c:964:1: Parameter `s->sessions->num_nodes` 962. static IMPLEMENT_LHASH_DOALL_ARG_FN(timeout, SSL_SESSION, TIMEOUT_PARAM) 963. 964. > void SSL_CTX_flush_sessions(SSL_CTX *s, long t) 965. { 966. unsigned long i; ssl/ssl_sess.c:976:2: Call 974. i=CHECKED_LHASH_OF(SSL_SESSION, tp.cache)->down_load; 975. CHECKED_LHASH_OF(SSL_SESSION, tp.cache)->down_load=0; 976. lh_SSL_SESSION_doall_arg(tp.cache, LHASH_DOALL_ARG_FN(timeout), ^ 977. TIMEOUT_PARAM, &tp); 978. CHECKED_LHASH_OF(SSL_SESSION, tp.cache)->down_load=i; crypto/lhash/lhash.c:305:1: Parameter `lh->num_nodes` 303. } 304. 305. > void lh_doall_arg(_LHASH *lh, LHASH_DOALL_ARG_FN_TYPE func, void *arg) 306. { 307. doall_util_fn(lh, 1, (LHASH_DOALL_FN_TYPE)0, func, arg); crypto/lhash/lhash.c:307:2: Call 305. void lh_doall_arg(_LHASH *lh, LHASH_DOALL_ARG_FN_TYPE func, void *arg) 306. { 307. doall_util_fn(lh, 1, (LHASH_DOALL_FN_TYPE)0, func, arg); ^ 308. } 309. crypto/lhash/lhash.c:270:1: <LHS trace> 268. } 269. 270. > static void doall_util_fn(_LHASH *lh, int use_arg, LHASH_DOALL_FN_TYPE func, 271. LHASH_DOALL_ARG_FN_TYPE func_arg, void *arg) 272. { crypto/lhash/lhash.c:270:1: Parameter `lh->num_nodes` 268. } 269. 270. > static void doall_util_fn(_LHASH *lh, int use_arg, LHASH_DOALL_FN_TYPE func, 271. LHASH_DOALL_ARG_FN_TYPE func_arg, void *arg) 272. { crypto/lhash/lhash.c:281:7: Binary operation: ([0, 8] - 1):unsigned32 by call to `SSL_CTX_free` 279. /* reverse the order so we search from 'top to bottom' 280. * We were having memory leaks otherwise */ 281. for (i=lh->num_nodes-1; i>=0; i--) ^ 282. { 283. a=lh->b[i];
https://github.com/openssl/openssl/blob/66f96fe2d519147097c118d4bf60704c69ed0635/crypto/lhash/lhash.c/#L281
d2a_code_trace_data_45121
void avfilter_unref_buffer(AVFilterBufferRef *ref) { if (!ref) return; if (!(--ref->buf->refcount)) ref->buf->free(ref->buf); if (ref->extended_data != ref->data) av_freep(&ref->extended_data); av_free(ref->video); av_free(ref->audio); av_free(ref); } libavfilter/vf_fieldorder.c:216: error: Integer Overflow L2 ([0, +oo] - 1):unsigned32 by call to `avfilter_unref_buffer`. libavfilter/vf_fieldorder.c:216:5: Call 214. 215. ff_end_frame(outlink); 216. avfilter_unref_buffer(inpicref); ^ 217. avfilter_unref_bufferp(&outlink->out_buf); 218. } libavfilter/buffer.c:74:1: <LHS trace> 72. } 73. 74. void avfilter_unref_buffer(AVFilterBufferRef *ref) ^ 75. { 76. if (!ref) libavfilter/buffer.c:74:1: Parameter `ref->buf->refcount` 72. } 73. 74. void avfilter_unref_buffer(AVFilterBufferRef *ref) ^ 75. { 76. if (!ref) libavfilter/buffer.c:78:11: Binary operation: ([0, +oo] - 1):unsigned32 by call to `avfilter_unref_buffer` 76. if (!ref) 77. return; 78. if (!(--ref->buf->refcount)) ^ 79. ref->buf->free(ref->buf); 80. if (ref->extended_data != ref->data)
https://github.com/libav/libav/blob/533fd5b5b468131cfe164455783c351eb69af657/libavfilter/buffer.c/#L78
d2a_code_trace_data_45122
static int spdif_header_aac(AVFormatContext *s, AVPacket *pkt) { IEC61937Context *ctx = s->priv_data; AACADTSHeaderInfo hdr; GetBitContext gbc; int ret; init_get_bits(&gbc, pkt->data, AAC_ADTS_HEADER_SIZE * 8); ret = ff_aac_parse_header(&gbc, &hdr); if (ret < 0) { av_log(s, AV_LOG_ERROR, "Wrong AAC file format\n"); return AVERROR_INVALIDDATA; } ctx->pkt_offset = hdr.samples << 2; switch (hdr.num_aac_frames) { case 1: ctx->data_type = IEC61937_MPEG2_AAC; break; case 2: ctx->data_type = IEC61937_MPEG2_AAC_LSF_2048; break; case 4: ctx->data_type = IEC61937_MPEG2_AAC_LSF_4096; break; default: av_log(s, AV_LOG_ERROR, "%i samples in AAC frame not supported\n", hdr.samples); return AVERROR(EINVAL); } return 0; } libavformat/spdifenc.c:346: error: Null Dereference pointer `&gbc->buffer` last assigned on line 345 could be null and is dereferenced by call to `ff_aac_parse_header()` at line 346, column 11. libavformat/spdifenc.c:338:1: start of procedure spdif_header_aac() 336. } 337. 338. static int spdif_header_aac(AVFormatContext *s, AVPacket *pkt) ^ 339. { 340. IEC61937Context *ctx = s->priv_data; libavformat/spdifenc.c:340:5: 338. static int spdif_header_aac(AVFormatContext *s, AVPacket *pkt) 339. { 340. IEC61937Context *ctx = s->priv_data; ^ 341. AACADTSHeaderInfo hdr; 342. GetBitContext gbc; libavformat/spdifenc.c:345:5: 343. int ret; 344. 345. init_get_bits(&gbc, pkt->data, AAC_ADTS_HEADER_SIZE * 8); ^ 346. ret = ff_aac_parse_header(&gbc, &hdr); 347. if (ret < 0) { libavcodec/get_bits.h:391:1: start of procedure init_get_bits() 389. * responsible for checking for the buffer end yourself (take advantage of the padding)! 390. */ 391. static inline void init_get_bits(GetBitContext *s, ^ 392. const uint8_t *buffer, int bit_size) 393. { libavcodec/get_bits.h:394:5: 392. const uint8_t *buffer, int bit_size) 393. { 394. int buffer_size = (bit_size+7)>>3; ^ 395. if (buffer_size < 0 || bit_size < 0) { 396. buffer_size = bit_size = 0; libavcodec/get_bits.h:395:9: Taking true branch 393. { 394. int buffer_size = (bit_size+7)>>3; 395. if (buffer_size < 0 || bit_size < 0) { ^ 396. buffer_size = bit_size = 0; 397. buffer = NULL; libavcodec/get_bits.h:396:9: 394. int buffer_size = (bit_size+7)>>3; 395. if (buffer_size < 0 || bit_size < 0) { 396. buffer_size = bit_size = 0; ^ 397. buffer = NULL; 398. } libavcodec/get_bits.h:397:9: 395. if (buffer_size < 0 || bit_size < 0) { 396. buffer_size = bit_size = 0; 397. buffer = NULL; ^ 398. } 399. libavcodec/get_bits.h:400:5: 398. } 399. 400. s->buffer = buffer; ^ 401. s->size_in_bits = bit_size; 402. s->buffer_end = buffer + buffer_size; libavcodec/get_bits.h:401:5: 399. 400. s->buffer = buffer; 401. s->size_in_bits = bit_size; ^ 402. s->buffer_end = buffer + buffer_size; 403. #ifdef ALT_BITSTREAM_READER libavcodec/get_bits.h:402:5: 400. s->buffer = buffer; 401. s->size_in_bits = bit_size; 402. s->buffer_end = buffer + buffer_size; ^ 403. #ifdef ALT_BITSTREAM_READER 404. s->index = 0; libavcodec/get_bits.h:404:5: 402. s->buffer_end = buffer + buffer_size; 403. #ifdef ALT_BITSTREAM_READER 404. s->index = 0; ^ 405. #elif defined A32_BITSTREAM_READER 406. s->buffer_ptr = (uint32_t*)((intptr_t)buffer & ~3); libavcodec/get_bits.h:410:1: return from a call to init_get_bits 408. skip_bits_long(s, 0); 409. #endif 410. } ^ 411. 412. static inline void align_get_bits(GetBitContext *s) libavformat/spdifenc.c:346:5: 344. 345. init_get_bits(&gbc, pkt->data, AAC_ADTS_HEADER_SIZE * 8); 346. ret = ff_aac_parse_header(&gbc, &hdr); ^ 347. if (ret < 0) { 348. av_log(s, AV_LOG_ERROR, "Wrong AAC file format\n"); libavcodec/aacadtsdec.c:29:1: start of procedure ff_aac_parse_header() 27. #include "mpeg4audio.h" 28. 29. int ff_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr) ^ 30. { 31. int size, rdb, ch, sr; libavcodec/aacadtsdec.c:34:8: 32. int aot, crc_abs; 33. 34. if(get_bits(gbc, 12) != 0xfff) ^ 35. return AAC_AC3_PARSE_ERROR_SYNC; 36. libavcodec/get_bits.h:282:1: start of procedure get_bits() 280. * Read 1-25 bits. 281. */ 282. static inline unsigned int get_bits(GetBitContext *s, int n){ ^ 283. register int tmp; 284. OPEN_READER(re, s); libavcodec/get_bits.h:284:5: 282. static inline unsigned int get_bits(GetBitContext *s, int n){ 283. register int tmp; 284. OPEN_READER(re, s); ^ 285. UPDATE_CACHE(re, s); 286. tmp = SHOW_UBITS(re, s, n); libavcodec/get_bits.h:285:5: 283. register int tmp; 284. OPEN_READER(re, s); 285. UPDATE_CACHE(re, s); ^ 286. tmp = SHOW_UBITS(re, s, n); 287. LAST_SKIP_BITS(re, s, n); libavutil/bswap.h:66:1: start of procedure av_bswap32() 64. 65. #ifndef av_bswap32 66. static av_always_inline av_const uint32_t av_bswap32(uint32_t x) ^ 67. { 68. x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF); libavutil/bswap.h:68:5: 66. static av_always_inline av_const uint32_t av_bswap32(uint32_t x) 67. { 68. x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF); ^ 69. x= (x>>16) | (x<<16); 70. return x; libavutil/bswap.h:69:5: 67. { 68. x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF); 69. x= (x>>16) | (x<<16); ^ 70. return x; 71. } libavutil/bswap.h:70:5: 68. x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF); 69. x= (x>>16) | (x<<16); 70. return x; ^ 71. } 72. #endif libavutil/bswap.h:71:1: return from a call to av_bswap32 69. x= (x>>16) | (x<<16); 70. return x; 71. } ^ 72. #endif 73. libavcodec/get_bits.h:286:5: 284. OPEN_READER(re, s); 285. UPDATE_CACHE(re, s); 286. tmp = SHOW_UBITS(re, s, n); ^ 287. LAST_SKIP_BITS(re, s, n); 288. CLOSE_READER(re, s); libavcodec/get_bits.h:287:5: 285. UPDATE_CACHE(re, s); 286. tmp = SHOW_UBITS(re, s, n); 287. LAST_SKIP_BITS(re, s, n); ^ 288. CLOSE_READER(re, s); 289. return tmp; libavcodec/get_bits.h:288:5: 286. tmp = SHOW_UBITS(re, s, n); 287. LAST_SKIP_BITS(re, s, n); 288. CLOSE_READER(re, s); ^ 289. return tmp; 290. } libavcodec/get_bits.h:289:5: 287. LAST_SKIP_BITS(re, s, n); 288. CLOSE_READER(re, s); 289. return tmp; ^ 290. } 291. libavcodec/get_bits.h:290:1: return from a call to get_bits 288. CLOSE_READER(re, s); 289. return tmp; 290. } ^ 291. 292. /** libavcodec/aacadtsdec.c:34:8: Taking false branch 32. int aot, crc_abs; 33. 34. if(get_bits(gbc, 12) != 0xfff) ^ 35. return AAC_AC3_PARSE_ERROR_SYNC; 36. libavcodec/aacadtsdec.c:37:5: 35. return AAC_AC3_PARSE_ERROR_SYNC; 36. 37. skip_bits1(gbc); /* id */ ^ 38. skip_bits(gbc, 2); /* layer */ 39. crc_abs = get_bits1(gbc); /* protection_absent */ libavcodec/get_bits.h:335:1: start of procedure skip_bits1() 333. } 334. 335. static inline void skip_bits1(GetBitContext *s){ ^ 336. skip_bits(s, 1); 337. } libavcodec/get_bits.h:336:5: 334. 335. static inline void skip_bits1(GetBitContext *s){ 336. skip_bits(s, 1); ^ 337. } 338. libavcodec/get_bits.h:303:1: start of procedure skip_bits() 301. } 302. 303. static inline void skip_bits(GetBitContext *s, int n){ ^ 304. //Note gcc seems to optimize this to s->index+=n for the ALT_READER :)) 305. OPEN_READER(re, s); libavcodec/get_bits.h:305:5: 303. static inline void skip_bits(GetBitContext *s, int n){ 304. //Note gcc seems to optimize this to s->index+=n for the ALT_READER :)) 305. OPEN_READER(re, s); ^ 306. UPDATE_CACHE(re, s); 307. LAST_SKIP_BITS(re, s, n); libavcodec/get_bits.h:306:5: 304. //Note gcc seems to optimize this to s->index+=n for the ALT_READER :)) 305. OPEN_READER(re, s); 306. UPDATE_CACHE(re, s); ^ 307. LAST_SKIP_BITS(re, s, n); 308. CLOSE_READER(re, s); libavutil/bswap.h:66:1: start of procedure av_bswap32() 64. 65. #ifndef av_bswap32 66. static av_always_inline av_const uint32_t av_bswap32(uint32_t x) ^ 67. { 68. x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF); libavutil/bswap.h:68:5: 66. static av_always_inline av_const uint32_t av_bswap32(uint32_t x) 67. { 68. x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF); ^ 69. x= (x>>16) | (x<<16); 70. return x; libavutil/bswap.h:69:5: 67. { 68. x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF); 69. x= (x>>16) | (x<<16); ^ 70. return x; 71. } libavutil/bswap.h:70:5: 68. x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF); 69. x= (x>>16) | (x<<16); 70. return x; ^ 71. } 72. #endif libavutil/bswap.h:71:1: return from a call to av_bswap32 69. x= (x>>16) | (x<<16); 70. return x; 71. } ^ 72. #endif 73. libavcodec/get_bits.h:307:5: 305. OPEN_READER(re, s); 306. UPDATE_CACHE(re, s); 307. LAST_SKIP_BITS(re, s, n); ^ 308. CLOSE_READER(re, s); 309. } libavcodec/get_bits.h:308:5: 306. UPDATE_CACHE(re, s); 307. LAST_SKIP_BITS(re, s, n); 308. CLOSE_READER(re, s); ^ 309. } 310. libavcodec/get_bits.h:309:1: return from a call to skip_bits 307. LAST_SKIP_BITS(re, s, n); 308. CLOSE_READER(re, s); 309. } ^ 310. 311. static inline unsigned int get_bits1(GetBitContext *s){ libavcodec/get_bits.h:337:1: return from a call to skip_bits1 335. static inline void skip_bits1(GetBitContext *s){ 336. skip_bits(s, 1); 337. } ^ 338. 339. /** libavcodec/aacadtsdec.c:38:5: 36. 37. skip_bits1(gbc); /* id */ 38. skip_bits(gbc, 2); /* layer */ ^ 39. crc_abs = get_bits1(gbc); /* protection_absent */ 40. aot = get_bits(gbc, 2); /* profile_objecttype */ libavcodec/get_bits.h:303:1: start of procedure skip_bits() 301. } 302. 303. static inline void skip_bits(GetBitContext *s, int n){ ^ 304. //Note gcc seems to optimize this to s->index+=n for the ALT_READER :)) 305. OPEN_READER(re, s); libavcodec/get_bits.h:305:5: 303. static inline void skip_bits(GetBitContext *s, int n){ 304. //Note gcc seems to optimize this to s->index+=n for the ALT_READER :)) 305. OPEN_READER(re, s); ^ 306. UPDATE_CACHE(re, s); 307. LAST_SKIP_BITS(re, s, n); libavcodec/get_bits.h:306:5: 304. //Note gcc seems to optimize this to s->index+=n for the ALT_READER :)) 305. OPEN_READER(re, s); 306. UPDATE_CACHE(re, s); ^ 307. LAST_SKIP_BITS(re, s, n); 308. CLOSE_READER(re, s); libavutil/bswap.h:66:1: start of procedure av_bswap32() 64. 65. #ifndef av_bswap32 66. static av_always_inline av_const uint32_t av_bswap32(uint32_t x) ^ 67. { 68. x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF); libavutil/bswap.h:68:5: 66. static av_always_inline av_const uint32_t av_bswap32(uint32_t x) 67. { 68. x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF); ^ 69. x= (x>>16) | (x<<16); 70. return x; libavutil/bswap.h:69:5: 67. { 68. x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF); 69. x= (x>>16) | (x<<16); ^ 70. return x; 71. } libavutil/bswap.h:70:5: 68. x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF); 69. x= (x>>16) | (x<<16); 70. return x; ^ 71. } 72. #endif libavutil/bswap.h:71:1: return from a call to av_bswap32 69. x= (x>>16) | (x<<16); 70. return x; 71. } ^ 72. #endif 73. libavcodec/get_bits.h:307:5: 305. OPEN_READER(re, s); 306. UPDATE_CACHE(re, s); 307. LAST_SKIP_BITS(re, s, n); ^ 308. CLOSE_READER(re, s); 309. } libavcodec/get_bits.h:308:5: 306. UPDATE_CACHE(re, s); 307. LAST_SKIP_BITS(re, s, n); 308. CLOSE_READER(re, s); ^ 309. } 310. libavcodec/get_bits.h:309:1: return from a call to skip_bits 307. LAST_SKIP_BITS(re, s, n); 308. CLOSE_READER(re, s); 309. } ^ 310. 311. static inline unsigned int get_bits1(GetBitContext *s){ libavcodec/aacadtsdec.c:39:5: 37. skip_bits1(gbc); /* id */ 38. skip_bits(gbc, 2); /* layer */ 39. crc_abs = get_bits1(gbc); /* protection_absent */ ^ 40. aot = get_bits(gbc, 2); /* profile_objecttype */ 41. sr = get_bits(gbc, 4); /* sample_frequency_index */ libavcodec/get_bits.h:311:1: start of procedure get_bits1() 309. } 310. 311. static inline unsigned int get_bits1(GetBitContext *s){ ^ 312. #ifdef ALT_BITSTREAM_READER 313. unsigned int index = s->index; libavcodec/get_bits.h:313:5: 311. static inline unsigned int get_bits1(GetBitContext *s){ 312. #ifdef ALT_BITSTREAM_READER 313. unsigned int index = s->index; ^ 314. uint8_t result = s->buffer[index>>3]; 315. #ifdef ALT_BITSTREAM_READER_LE libavcodec/get_bits.h:314:5: 312. #ifdef ALT_BITSTREAM_READER 313. unsigned int index = s->index; 314. uint8_t result = s->buffer[index>>3]; ^ 315. #ifdef ALT_BITSTREAM_READER_LE 316. result >>= index & 7;
https://github.com/libav/libav/blob/938b62538a719785bce0f1d49d3065937b29e3aa/libavformat/spdifenc.c/#L346
d2a_code_trace_data_45123
ngx_int_t ngx_http_script_compile(ngx_http_script_compile_t *sc) { u_char ch; ngx_str_t name; ngx_uint_t i, bracket; if (ngx_http_script_init_arrays(sc) != NGX_OK) { return NGX_ERROR; } for (i = 0; i < sc->source->len; ) { name.len = 0; if (sc->source->data[i] == '$') { if (++i == sc->source->len) { goto invalid_variable; } #if (NGX_PCRE) { ngx_uint_t n; if (sc->source->data[i] >= '1' && sc->source->data[i] <= '9') { n = sc->source->data[i] - '0'; if (sc->captures_mask & (1 << n)) { sc->dup_capture = 1; } sc->captures_mask |= 1 << n; if (ngx_http_script_add_capture_code(sc, n) != NGX_OK) { return NGX_ERROR; } i++; continue; } } #endif if (sc->source->data[i] == '{') { bracket = 1; if (++i == sc->source->len) { goto invalid_variable; } name.data = &sc->source->data[i]; } else { bracket = 0; name.data = &sc->source->data[i]; } for ( ; i < sc->source->len; i++, name.len++) { ch = sc->source->data[i]; if (ch == '}' && bracket) { i++; bracket = 0; break; } if ((ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z') || (ch >= '0' && ch <= '9') || ch == '_') { continue; } break; } if (bracket) { ngx_conf_log_error(NGX_LOG_EMERG, sc->cf, 0, "the closing bracket in \"%V\" " "variable is missing", &name); return NGX_ERROR; } if (name.len == 0) { goto invalid_variable; } sc->variables++; if (ngx_http_script_add_var_code(sc, &name) != NGX_OK) { return NGX_ERROR; } continue; } if (sc->source->data[i] == '?' && sc->compile_args) { sc->args = 1; sc->compile_args = 0; if (ngx_http_script_add_args_code(sc) != NGX_OK) { return NGX_ERROR; } i++; continue; } name.data = &sc->source->data[i]; while (i < sc->source->len) { if (sc->source->data[i] == '$') { break; } if (sc->source->data[i] == '?') { sc->args = 1; if (sc->compile_args) { break; } } i++; name.len++; } sc->size += name.len; if (ngx_http_script_add_copy_code(sc, &name, (i == sc->source->len)) != NGX_OK) { return NGX_ERROR; } } return ngx_http_script_done(sc); invalid_variable: ngx_conf_log_error(NGX_LOG_EMERG, sc->cf, 0, "invalid variable name"); return NGX_ERROR; } src/http/modules/ngx_http_log_module.c:885: error: Buffer Overrun L3 Offset: [1, +oo] Size: [0, +oo] by call to `ngx_http_script_compile`. src/http/modules/ngx_http_log_module.c:866:13: Call 864. 865. } else { 866. if (ngx_conf_full_name(cf->cycle, &value[1], 0) != NGX_OK) { ^ 867. return NGX_CONF_ERROR; 868. } src/core/ngx_conf_file.c:794:1: Parameter `*name->data` 792. 793. 794. ngx_int_t ^ 795. ngx_conf_full_name(ngx_cycle_t *cycle, ngx_str_t *name, ngx_uint_t conf_prefix) 796. { src/http/modules/ngx_http_log_module.c:885:13: Call 883. sc.complete_values = 1; 884. 885. if (ngx_http_script_compile(&sc) != NGX_OK) { ^ 886. return NGX_CONF_ERROR; 887. } src/http/ngx_http_script.c:229:1: <Offset trace> 227. 228. 229. ngx_int_t ^ 230. ngx_http_script_compile(ngx_http_script_compile_t *sc) 231. { src/http/ngx_http_script.c:229:1: Parameter `sc->source->len` 227. 228. 229. ngx_int_t ^ 230. ngx_http_script_compile(ngx_http_script_compile_t *sc) 231. { src/http/ngx_http_script.c:229:1: <Length trace> 227. 228. 229. ngx_int_t ^ 230. ngx_http_script_compile(ngx_http_script_compile_t *sc) 231. { src/http/ngx_http_script.c:229:1: Parameter `*sc->source->data` 227. 228. 229. ngx_int_t ^ 230. ngx_http_script_compile(ngx_http_script_compile_t *sc) 231. { src/http/ngx_http_script.c:256:17: Array access: Offset: [1, +oo] Size: [0, +oo] by call to `ngx_http_script_compile` 254. /* NGX_HTTP_MAX_CAPTURES is 9 */ 255. 256. if (sc->source->data[i] >= '1' && sc->source->data[i] <= '9') { ^ 257. 258. n = sc->source->data[i] - '0';
https://github.com/nginx/nginx/blob/e4ecddfdb0d2ffc872658e36028971ad9a873726/src/http/ngx_http_script.c/#L256
d2a_code_trace_data_45124
static inline unsigned int constant_time_lt(unsigned int a, unsigned int b) { return constant_time_msb(a^((a^b)|((a-b)^b))); } ssl/d1_pkt.c:319: error: INTEGER_OVERFLOW_L2 ([0, 17727] - [0, 17728]):unsigned32 by call to `dtls1_process_record`. Showing all 15 steps of the trace ssl/d1_pkt.c:303:1: Parameter `s->s3->rrec.length` 301. &((s)->d1->processed_rcds)) 302. 303. > static int 304. dtls1_process_buffered_records(SSL *s) 305. { ssl/d1_pkt.c:319:20: Call 317. { 318. dtls1_get_unprocessed_record(s); 319. if ( ! dtls1_process_record(s)) ^ 320. return(0); 321. if(dtls1_buffer_record(s, &(s->d1->processed_rcds), ssl/d1_pkt.c:381:1: Parameter `s->s3->rrec.length` 379. #endif 380. 381. > static int 382. dtls1_process_record(SSL *s) 383. { ssl/d1_pkt.c:474:4: Call 472. * */ 473. mac = mac_tmp; 474. ssl3_cbc_copy_mac(mac_tmp, rr, mac_size); ^ 475. rr->length -= mac_size; 476. } ssl/s3_cbc.c:220:1: Parameter `md_size` 218. #define CBC_MAC_ROTATE_IN_PLACE 219. 220. > void ssl3_cbc_copy_mac(unsigned char* out, 221. const SSL3_RECORD *rec, 222. unsigned md_size) ssl/s3_cbc.c:266:29: Call 264. { 265. unsigned char mac_started = constant_time_ge_8(i, mac_start); 266. unsigned char mac_ended = constant_time_ge_8(i, mac_end); ^ 267. unsigned char b = rec->data[i]; 268. rotated_mac[j++] |= b & mac_started & ~mac_ended; crypto/constant_time_locl.h:150:1: Parameter `a` 148. } 149. 150. > static inline unsigned char constant_time_ge_8(unsigned int a, unsigned int b) 151. { 152. return (unsigned char)(constant_time_ge(a, b)); crypto/constant_time_locl.h:152:25: Call 150. static inline unsigned char constant_time_ge_8(unsigned int a, unsigned int b) 151. { 152. return (unsigned char)(constant_time_ge(a, b)); ^ 153. } 154. crypto/constant_time_locl.h:145:1: Parameter `a` 143. } 144. 145. > static inline unsigned int constant_time_ge(unsigned int a, unsigned int b) 146. { 147. return ~constant_time_lt(a, b); crypto/constant_time_locl.h:147:10: Call 145. static inline unsigned int constant_time_ge(unsigned int a, unsigned int b) 146. { 147. return ~constant_time_lt(a, b); ^ 148. } 149. crypto/constant_time_locl.h:135:1: <LHS trace> 133. } 134. 135. > static inline unsigned int constant_time_lt(unsigned int a, unsigned int b) 136. { 137. return constant_time_msb(a^((a^b)|((a-b)^b))); crypto/constant_time_locl.h:135:1: Parameter `a` 133. } 134. 135. > static inline unsigned int constant_time_lt(unsigned int a, unsigned int b) 136. { 137. return constant_time_msb(a^((a^b)|((a-b)^b))); crypto/constant_time_locl.h:135:1: <RHS trace> 133. } 134. 135. > static inline unsigned int constant_time_lt(unsigned int a, unsigned int b) 136. { 137. return constant_time_msb(a^((a^b)|((a-b)^b))); crypto/constant_time_locl.h:135:1: Parameter `b` 133. } 134. 135. > static inline unsigned int constant_time_lt(unsigned int a, unsigned int b) 136. { 137. return constant_time_msb(a^((a^b)|((a-b)^b))); crypto/constant_time_locl.h:137:9: Binary operation: ([0, 17727] - [0, 17728]):unsigned32 by call to `dtls1_process_record` 135. static inline unsigned int constant_time_lt(unsigned int a, unsigned int b) 136. { 137. return constant_time_msb(a^((a^b)|((a-b)^b))); ^ 138. } 139.
https://github.com/openssl/openssl/blob/732192a0796c4ecbef3b13ccc8ee8ab23e28f483/crypto/constant_time_locl.h/#L137
d2a_code_trace_data_45125
int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflags, unsigned long cflag) { long l; int i; EVP_PKEY *pkey; STACK_OF(X509_EXTENSION) *exts; char mlch = ' '; int nmindent = 0; if ((nmflags & XN_FLAG_SEP_MASK) == XN_FLAG_SEP_MULTILINE) { mlch = '\n'; nmindent = 12; } if (nmflags == X509_FLAG_COMPAT) nmindent = 16; if (!(cflag & X509_FLAG_NO_HEADER)) { if (BIO_write(bp, "Certificate Request:\n", 21) <= 0) goto err; if (BIO_write(bp, " Data:\n", 10) <= 0) goto err; } if (!(cflag & X509_FLAG_NO_VERSION)) { l = X509_REQ_get_version(x); if (BIO_printf(bp, "%8sVersion: %ld (0x%lx)\n", "", l + 1, l) <= 0) goto err; } if (!(cflag & X509_FLAG_NO_SUBJECT)) { if (BIO_printf(bp, " Subject:%c", mlch) <= 0) goto err; if (X509_NAME_print_ex(bp, X509_REQ_get_subject_name(x), nmindent, nmflags) < 0) goto err; if (BIO_write(bp, "\n", 1) <= 0) goto err; } if (!(cflag & X509_FLAG_NO_PUBKEY)) { X509_PUBKEY *xpkey; ASN1_OBJECT *koid; if (BIO_write(bp, " Subject Public Key Info:\n", 33) <= 0) goto err; if (BIO_printf(bp, "%12sPublic Key Algorithm: ", "") <= 0) goto err; xpkey = X509_REQ_get_X509_PUBKEY(x); X509_PUBKEY_get0_param(&koid, NULL, NULL, NULL, xpkey); if (i2a_ASN1_OBJECT(bp, koid) <= 0) goto err; if (BIO_puts(bp, "\n") <= 0) goto err; pkey = X509_REQ_get0_pubkey(x); if (pkey == NULL) { BIO_printf(bp, "%12sUnable to load Public Key\n", ""); ERR_print_errors(bp); } else { EVP_PKEY_print_public(bp, pkey, 16, NULL); } } if (!(cflag & X509_FLAG_NO_ATTRIBUTES)) { if (BIO_printf(bp, "%8sAttributes:\n", "") <= 0) goto err; if (X509_REQ_get_attr_count(x) == 0) { if (BIO_printf(bp, "%12sa0:00\n", "") <= 0) goto err; } else { for (i = 0; i < X509_REQ_get_attr_count(x); i++) { ASN1_TYPE *at; X509_ATTRIBUTE *a; ASN1_BIT_STRING *bs = NULL; ASN1_OBJECT *aobj; int j, type = 0, count = 1, ii = 0; a = X509_REQ_get_attr(x, i); aobj = X509_ATTRIBUTE_get0_object(a); if (X509_REQ_extension_nid(OBJ_obj2nid(aobj))) continue; if (BIO_printf(bp, "%12s", "") <= 0) goto err; if ((j = i2a_ASN1_OBJECT(bp, aobj)) > 0) { ii = 0; count = X509_ATTRIBUTE_count(a); get_next: at = X509_ATTRIBUTE_get0_type(a, ii); type = at->type; bs = at->value.asn1_string; } for (j = 25 - j; j > 0; j--) if (BIO_write(bp, " ", 1) != 1) goto err; if (BIO_puts(bp, ":") <= 0) goto err; if ((type == V_ASN1_PRINTABLESTRING) || (type == V_ASN1_T61STRING) || (type == V_ASN1_UTF8STRING) || (type == V_ASN1_IA5STRING)) { if (BIO_write(bp, (char *)bs->data, bs->length) != bs->length) goto err; BIO_puts(bp, "\n"); } else { BIO_puts(bp, "unable to print attribute\n"); } if (++ii < count) goto get_next; } } } if (!(cflag & X509_FLAG_NO_EXTENSIONS)) { exts = X509_REQ_get_extensions(x); if (exts) { BIO_printf(bp, "%8sRequested Extensions:\n", ""); for (i = 0; i < sk_X509_EXTENSION_num(exts); i++) { ASN1_OBJECT *obj; X509_EXTENSION *ex; int critical; ex = sk_X509_EXTENSION_value(exts, i); if (BIO_printf(bp, "%12s", "") <= 0) goto err; obj = X509_EXTENSION_get_object(ex); i2a_ASN1_OBJECT(bp, obj); critical = X509_EXTENSION_get_critical(ex); if (BIO_printf(bp, ": %s\n", critical ? "critical" : "") <= 0) goto err; if (!X509V3_EXT_print(bp, ex, cflag, 16)) { BIO_printf(bp, "%16s", ""); ASN1_STRING_print(bp, X509_EXTENSION_get_data(ex)); } if (BIO_write(bp, "\n", 1) <= 0) goto err; } sk_X509_EXTENSION_pop_free(exts, X509_EXTENSION_free); } } if (!(cflag & X509_FLAG_NO_SIGDUMP)) { X509_ALGOR *sig_alg; ASN1_BIT_STRING *sig; X509_REQ_get0_signature(&sig, &sig_alg, x); if (!X509_signature_print(bp, sig_alg, sig)) goto err; } return (1); err: X509err(X509_F_X509_REQ_PRINT_EX, ERR_R_BUF_LIB); return (0); } crypto/x509/t_req.c:63: error: INTEGER_OVERFLOW_L2 ([-9223372036854775808, 9223372036854775807] + 1):signed64. Showing all 7 steps of the trace crypto/x509/t_req.c:62:13: <LHS trace> 60. } 61. if (!(cflag & X509_FLAG_NO_VERSION)) { 62. l = X509_REQ_get_version(x); ^ 63. if (BIO_printf(bp, "%8sVersion: %ld (0x%lx)\n", "", l + 1, l) <= 0) 64. goto err; crypto/x509/t_req.c:62:13: Call 60. } 61. if (!(cflag & X509_FLAG_NO_VERSION)) { 62. l = X509_REQ_get_version(x); ^ 63. if (BIO_printf(bp, "%8sVersion: %ld (0x%lx)\n", "", l + 1, l) <= 0) 64. goto err; crypto/x509/x509_req.c:272:12: Call 270. long X509_REQ_get_version(const X509_REQ *req) 271. { 272. return ASN1_INTEGER_get(req->req_info.version); ^ 273. } 274. crypto/asn1/a_int.c:564:9: Assignment 562. int64_t r; 563. if (a == NULL) 564. return 0; ^ 565. i = ASN1_INTEGER_get_int64(&r, a); 566. if (i == 0) crypto/x509/x509_req.c:272:5: Assignment 270. long X509_REQ_get_version(const X509_REQ *req) 271. { 272. return ASN1_INTEGER_get(req->req_info.version); ^ 273. } 274. crypto/x509/t_req.c:62:9: Assignment 60. } 61. if (!(cflag & X509_FLAG_NO_VERSION)) { 62. l = X509_REQ_get_version(x); ^ 63. if (BIO_printf(bp, "%8sVersion: %ld (0x%lx)\n", "", l + 1, l) <= 0) 64. goto err; crypto/x509/t_req.c:63:13: Binary operation: ([-9223372036854775808, 9223372036854775807] + 1):signed64 61. if (!(cflag & X509_FLAG_NO_VERSION)) { 62. l = X509_REQ_get_version(x); 63. if (BIO_printf(bp, "%8sVersion: %ld (0x%lx)\n", "", l + 1, l) <= 0) ^ 64. goto err; 65. }
https://github.com/openssl/openssl/blob/cb926df2fa42bd1e396a600ff6212ee4f4e04118/crypto/x509/t_req.c/#L63
d2a_code_trace_data_45126
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:178: error: Null Dereference pointer `&pb->buf_ptr` last assigned on line 167 could be null and is dereferenced by call to `put_bits()` at line 178, column 5. libavcodec/aacenc.c:162:1: start of procedure put_audio_specific_config() 160. * @see 1.6.2.1 "Syntax - AudioSpecificConfig" 161. */ 162. static void put_audio_specific_config(AVCodecContext *avctx) ^ 163. { 164. PutBitContext pb; libavcodec/aacenc.c:165:5: 163. { 164. PutBitContext pb; 165. AACEncContext *s = avctx->priv_data; ^ 166. 167. init_put_bits(&pb, avctx->extradata, avctx->extradata_size*8); libavcodec/aacenc.c:167:5: 165. AACEncContext *s = avctx->priv_data; 166. 167. init_put_bits(&pb, avctx->extradata, avctx->extradata_size*8); ^ 168. put_bits(&pb, 5, 2); //object type - AAC-LC 169. 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:168:5: 166. 167. init_put_bits(&pb, avctx->extradata, avctx->extradata_size*8); 168. put_bits(&pb, 5, 2); //object type - AAC-LC ^ 169. put_bits(&pb, 4, s->samplerate_index); //sample rate index 170. 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:169:5: 167. init_put_bits(&pb, avctx->extradata, avctx->extradata_size*8); 168. put_bits(&pb, 5, 2); //object type - AAC-LC 169. put_bits(&pb, 4, s->samplerate_index); //sample rate index ^ 170. put_bits(&pb, 4, s->channels); 171. //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:170:5: 168. put_bits(&pb, 5, 2); //object type - AAC-LC 169. put_bits(&pb, 4, s->samplerate_index); //sample rate index 170. put_bits(&pb, 4, s->channels); ^ 171. //GASpecificConfig 172. 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:172:5: 170. put_bits(&pb, 4, s->channels); 171. //GASpecificConfig 172. put_bits(&pb, 1, 0); //frame length - 1024 samples ^ 173. put_bits(&pb, 1, 0); //does not depend on core coder 174. 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:173:5: 171. //GASpecificConfig 172. put_bits(&pb, 1, 0); //frame length - 1024 samples 173. put_bits(&pb, 1, 0); //does not depend on core coder ^ 174. put_bits(&pb, 1, 0); //is not extension 175. 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, 1, 0); //frame length - 1024 samples 173. put_bits(&pb, 1, 0); //does not depend on core coder 174. put_bits(&pb, 1, 0); //is not extension ^ 175. 176. //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:177:5: 175. 176. //Explicitly Mark SBR absent 177. put_bits(&pb, 11, 0x2b7); //sync extension ^ 178. put_bits(&pb, 5, AOT_SBR); 179. 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:178:5: 176. //Explicitly Mark SBR absent 177. put_bits(&pb, 11, 0x2b7); //sync extension 178. put_bits(&pb, 5, AOT_SBR); ^ 179. put_bits(&pb, 1, 0); 180. 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/941e9f22386e923183dc4c5392d0ef2a85b68d51/libavcodec/aacenc.c/#L178
d2a_code_trace_data_45127
static int fill_default_ref_list(H264Context *h){ MpegEncContext * const s = &h->s; int i; int smallest_poc_greater_than_current = -1; int structure_sel; Picture sorted_short_ref[32]; Picture field_entry_list[2][32]; Picture *frame_list[2]; if (FIELD_PICTURE) { structure_sel = PICT_FRAME; frame_list[0] = field_entry_list[0]; frame_list[1] = field_entry_list[1]; } else { structure_sel = 0; frame_list[0] = h->default_ref_list[0]; frame_list[1] = h->default_ref_list[1]; } if(h->slice_type==FF_B_TYPE){ int list; int len[2]; int short_len[2]; int out_i; int limit= INT_MIN; for(out_i=0; out_i<h->short_ref_count; out_i++){ int best_i=INT_MIN; int best_poc=INT_MAX; for(i=0; i<h->short_ref_count; i++){ const int poc= h->short_ref[i]->poc; if(poc > limit && poc < best_poc){ best_poc= poc; best_i= i; } } assert(best_i != INT_MIN); limit= best_poc; sorted_short_ref[out_i]= *h->short_ref[best_i]; tprintf(h->s.avctx, "sorted poc: %d->%d poc:%d fn:%d\n", best_i, out_i, sorted_short_ref[out_i].poc, sorted_short_ref[out_i].frame_num); if (-1 == smallest_poc_greater_than_current) { if (h->short_ref[best_i]->poc >= s->current_picture_ptr->poc) { smallest_poc_greater_than_current = out_i; } } } tprintf(h->s.avctx, "current poc: %d, smallest_poc_greater_than_current: %d\n", s->current_picture_ptr->poc, smallest_poc_greater_than_current); for(list=0; list<2; list++){ int index = 0; int j= -99; int step= list ? -1 : 1; for(i=0; i<h->short_ref_count && index < h->ref_count[list]; i++, j+=step) { int sel; while(j<0 || j>= h->short_ref_count){ if(j != -99 && step == (list ? -1 : 1)) return -1; step = -step; j= smallest_poc_greater_than_current + (step>>1); } sel = sorted_short_ref[j].reference | structure_sel; if(sel != PICT_FRAME) continue; frame_list[list][index ]= sorted_short_ref[j]; frame_list[list][index++].pic_id= sorted_short_ref[j].frame_num; } short_len[list] = index; for(i = 0; i < 16 && index < h->ref_count[ list ]; i++){ int sel; if(h->long_ref[i] == NULL) continue; sel = h->long_ref[i]->reference | structure_sel; if(sel != PICT_FRAME) continue; frame_list[ list ][index ]= *h->long_ref[i]; frame_list[ list ][index++].pic_id= i; } len[list] = index; } for(list=0; list<2; list++){ if (FIELD_PICTURE) len[list] = split_field_ref_list(h->default_ref_list[list], h->ref_count[list], frame_list[list], len[list], s->picture_structure, short_len[list]); if(list && len[0] > 1 && len[0] == len[1]) for(i=0; h->default_ref_list[0][i].data[0] == h->default_ref_list[1][i].data[0]; i++) if(i == len[0]){ FFSWAP(Picture, h->default_ref_list[1][0], h->default_ref_list[1][1]); break; } if(len[list] < h->ref_count[ list ]) memset(&h->default_ref_list[list][len[list]], 0, sizeof(Picture)*(h->ref_count[ list ] - len[list])); } }else{ int index=0; int short_len; for(i=0; i<h->short_ref_count; i++){ int sel; sel = h->short_ref[i]->reference | structure_sel; if(sel != PICT_FRAME) continue; frame_list[0][index ]= *h->short_ref[i]; frame_list[0][index++].pic_id= h->short_ref[i]->frame_num; } short_len = index; for(i = 0; i < 16; i++){ int sel; if(h->long_ref[i] == NULL) continue; sel = h->long_ref[i]->reference | structure_sel; if(sel != PICT_FRAME) continue; frame_list[0][index ]= *h->long_ref[i]; frame_list[0][index++].pic_id= i; } if (FIELD_PICTURE) index = split_field_ref_list(h->default_ref_list[0], h->ref_count[0], frame_list[0], index, s->picture_structure, short_len); if(index < h->ref_count[0]) memset(&h->default_ref_list[0][index], 0, sizeof(Picture)*(h->ref_count[0] - index)); } #ifdef TRACE for (i=0; i<h->ref_count[0]; i++) { tprintf(h->s.avctx, "List0: %s fn:%d 0x%p\n", (h->default_ref_list[0][i].long_ref ? "LT" : "ST"), h->default_ref_list[0][i].pic_id, h->default_ref_list[0][i].data[0]); } if(h->slice_type==FF_B_TYPE){ for (i=0; i<h->ref_count[1]; i++) { tprintf(h->s.avctx, "List1: %s fn:%d 0x%p\n", (h->default_ref_list[1][i].long_ref ? "LT" : "ST"), h->default_ref_list[1][i].pic_id, h->default_ref_list[1][i].data[0]); } } #endif return 0; } libavcodec/h264.c:4138: error: Buffer Overrun L3 Offset: [-2147483648, +oo] Size: 32 by call to `fill_default_ref_list`. libavcodec/h264.c:3862:1: Parameter `h->short_ref_count` 3860. * @return 0 if okay, <0 if an error occurred, 1 if decoding must not be multithreaded 3861. */ 3862. static int decode_slice_header(H264Context *h, H264Context *h0){ ^ 3863. MpegEncContext * const s = &h->s; 3864. MpegEncContext * const s0 = &h0->s; libavcodec/h264.c:4138:9: Call 4136. 4137. if(!default_ref_list_done){ 4138. fill_default_ref_list(h); ^ 4139. } 4140. libavcodec/h264.c:2870:13: <Offset trace> 2868. /* sort frame according to poc in B slice */ 2869. for(out_i=0; out_i<h->short_ref_count; out_i++){ 2870. int best_i=INT_MIN; ^ 2871. int best_poc=INT_MAX; 2872. libavcodec/h264.c:2870:13: Assignment 2868. /* sort frame according to poc in B slice */ 2869. for(out_i=0; out_i<h->short_ref_count; out_i++){ 2870. int best_i=INT_MIN; ^ 2871. int best_poc=INT_MAX; 2872. libavcodec/h264.c:2842:1: <Length trace> 2840. * fills the default_ref_list. 2841. */ 2842. static int fill_default_ref_list(H264Context *h){ ^ 2843. MpegEncContext * const s = &h->s; 2844. int i; libavcodec/h264.c:2842:1: Parameter `h->short_ref[*]` 2840. * fills the default_ref_list. 2841. */ 2842. static int fill_default_ref_list(H264Context *h){ ^ 2843. MpegEncContext * const s = &h->s; 2844. int i; libavcodec/h264.c:2884:39: Array access: Offset: [-2147483648, +oo] Size: 32 by call to `fill_default_ref_list` 2882. 2883. limit= best_poc; 2884. sorted_short_ref[out_i]= *h->short_ref[best_i]; ^ 2885. tprintf(h->s.avctx, "sorted poc: %d->%d poc:%d fn:%d\n", best_i, out_i, sorted_short_ref[out_i].poc, sorted_short_ref[out_i].frame_num); 2886. if (-1 == smallest_poc_greater_than_current) {
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/h264.c/#L2884
d2a_code_trace_data_45128
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:4049: error: Null Dereference pointer `today` last assigned on line 4047 could be null and is dereferenced at line 4049, column 69. avconv.c:4043:1: start of procedure opt_vstats() 4041. } 4042. 4043. static int opt_vstats(const char *opt, const char *arg) ^ 4044. { 4045. char filename[40]; avconv.c:4046:5: 4044. { 4045. char filename[40]; 4046. time_t today2 = time(NULL); ^ 4047. struct tm *today = localtime(&today2); 4048. avconv.c:4047:5: 4045. char filename[40]; 4046. time_t today2 = time(NULL); 4047. struct tm *today = localtime(&today2); ^ 4048. 4049. snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min, avconv.c:4049:5: 4047. struct tm *today = localtime(&today2); 4048. 4049. snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min, ^ 4050. today->tm_sec); 4051. return opt_vstats_file(opt, filename);
https://github.com/libav/libav/blob/e551a6f49a13f2e992c42bc00a8b45ad636e52ad/avconv.c/#L4049
d2a_code_trace_data_45129
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } test/bntest.c:1522: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_GF2m_mod_mul`. Showing all 18 steps of the trace test/bntest.c:1497:1: Parameter `ctx->stack.depth` 1495. } 1496. 1497. > int test_gf2m_mod_exp(BIO *bp, BN_CTX *ctx) 1498. { 1499. BIGNUM *a, *b[2], *c, *d, *e, *f; test/bntest.c:1520:13: Call 1518. BN_bntest_rand(d, 512, 0, 0); 1519. for (j = 0; j < 2; j++) { 1520. BN_GF2m_mod_exp(e, a, c, b[j], ctx); ^ 1521. BN_GF2m_mod_exp(f, a, d, b[j], ctx); 1522. BN_GF2m_mod_mul(e, e, f, b[j], ctx); crypto/bn/bn_gf2m.c:955:1: Parameter `ctx->stack.depth` 953. * for best performance, use the BN_GF2m_mod_exp_arr function. 954. */ 955. > int BN_GF2m_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, 956. const BIGNUM *p, BN_CTX *ctx) 957. { test/bntest.c:1521:13: Call 1519. for (j = 0; j < 2; j++) { 1520. BN_GF2m_mod_exp(e, a, c, b[j], ctx); 1521. BN_GF2m_mod_exp(f, a, d, b[j], ctx); ^ 1522. BN_GF2m_mod_mul(e, e, f, b[j], ctx); 1523. BN_add(f, c, d); crypto/bn/bn_gf2m.c:955:1: Parameter `ctx->stack.depth` 953. * for best performance, use the BN_GF2m_mod_exp_arr function. 954. */ 955. > int BN_GF2m_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, 956. const BIGNUM *p, BN_CTX *ctx) 957. { test/bntest.c:1522:13: Call 1520. BN_GF2m_mod_exp(e, a, c, b[j], ctx); 1521. BN_GF2m_mod_exp(f, a, d, b[j], ctx); 1522. BN_GF2m_mod_mul(e, e, f, b[j], ctx); ^ 1523. BN_add(f, c, d); 1524. BN_GF2m_mod_exp(f, a, f, b[j], ctx); 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. { crypto/bn/bn_gf2m.c:489:11: Call 487. goto err; 488. } 489. ret = BN_GF2m_mod_mul_arr(r, a, b, arr, ctx); ^ 490. bn_check_top(r); 491. err: crypto/bn/bn_gf2m.c:432:5: Call 430. } 431. 432. BN_CTX_start(ctx); ^ 433. if ((s = BN_CTX_get(ctx)) == NULL) 434. goto err; crypto/bn/bn_ctx.c:181:1: Parameter `*ctx->stack.indexes` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_gf2m.c:462:5: Call 460. 461. err: 462. BN_CTX_end(ctx); ^ 463. return ret; 464. } crypto/bn/bn_ctx.c:195:1: Parameter `*ctx->stack.indexes` 193. } 194. 195. > void BN_CTX_end(BN_CTX *ctx) 196. { 197. CTXDBG_ENTRY("BN_CTX_end", ctx); crypto/bn/bn_ctx.c:201:27: Call 199. ctx->err_stack--; 200. else { 201. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 202. /* Does this stack frame have anything to release? */ 203. if (fp < ctx->used) crypto/bn/bn_ctx.c:271:1: <Offset trace> 269. } 270. 271. > static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:271:1: Parameter `st->depth` 269. } 270. 271. > static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:271:1: <Length trace> 269. } 270. 271. > static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:271:1: Parameter `*st->indexes` 269. } 270. 271. > static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:273:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_GF2m_mod_mul` 271. static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; ^ 274. } 275.
https://github.com/openssl/openssl/blob/b3618f44a7b8504bfb0a64e8a33e6b8e56d4d516/crypto/bn/bn_ctx.c/#L273
d2a_code_trace_data_45130
static int flac_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt) { AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; FLACContext *s = avctx->priv_data; int bytes_read = 0; int ret; *got_frame_ptr = 0; if (s->max_framesize == 0) { s->max_framesize = ff_flac_get_max_frame_size(s->max_blocksize ? s->max_blocksize : FLAC_MAX_BLOCKSIZE, FLAC_MAX_CHANNELS, 32); } if (buf_size < FLAC_MIN_FRAME_SIZE) return buf_size; if (AV_RB32(buf) == MKBETAG('f','L','a','C')) { if (!s->got_streaminfo && (ret = parse_streaminfo(s, buf, buf_size))) { av_log(s->avctx, AV_LOG_ERROR, "invalid header\n"); return ret; } return get_metadata_size(buf, buf_size); } init_get_bits(&s->gb, buf, buf_size*8); if ((ret = decode_frame(s)) < 0) { av_log(s->avctx, AV_LOG_ERROR, "decode_frame() failed\n"); return ret; } bytes_read = (get_bits_count(&s->gb)+7)/8; frame->nb_samples = s->blocksize; if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return ret; } s->dsp.decorrelate[s->ch_mode](frame->data, s->decoded, s->channels, s->blocksize, s->sample_shift); if (bytes_read > buf_size) { av_log(s->avctx, AV_LOG_ERROR, "overread: %d\n", bytes_read - buf_size); return AVERROR_INVALIDDATA; } if (bytes_read < buf_size) { av_log(s->avctx, AV_LOG_DEBUG, "underread: %d orig size: %d\n", buf_size - bytes_read, buf_size); } *got_frame_ptr = 1; return bytes_read; } libavcodec/flacdec.c:517: error: Null Dereference pointer `s->gb.buffer` last assigned on line 516 could be null and is dereferenced by call to `decode_frame()` at line 517, column 16. libavcodec/flacdec.c:482:1: start of procedure flac_decode_frame() 480. } 481. 482. static int flac_decode_frame(AVCodecContext *avctx, void *data, ^ 483. int *got_frame_ptr, AVPacket *avpkt) 484. { libavcodec/flacdec.c:485:5: 483. int *got_frame_ptr, AVPacket *avpkt) 484. { 485. AVFrame *frame = data; ^ 486. const uint8_t *buf = avpkt->data; 487. int buf_size = avpkt->size; libavcodec/flacdec.c:486:5: 484. { 485. AVFrame *frame = data; 486. const uint8_t *buf = avpkt->data; ^ 487. int buf_size = avpkt->size; 488. FLACContext *s = avctx->priv_data; libavcodec/flacdec.c:487:5: 485. AVFrame *frame = data; 486. const uint8_t *buf = avpkt->data; 487. int buf_size = avpkt->size; ^ 488. FLACContext *s = avctx->priv_data; 489. int bytes_read = 0; libavcodec/flacdec.c:488:5: 486. const uint8_t *buf = avpkt->data; 487. int buf_size = avpkt->size; 488. FLACContext *s = avctx->priv_data; ^ 489. int bytes_read = 0; 490. int ret; libavcodec/flacdec.c:489:5: 487. int buf_size = avpkt->size; 488. FLACContext *s = avctx->priv_data; 489. int bytes_read = 0; ^ 490. int ret; 491. libavcodec/flacdec.c:492:5: 490. int ret; 491. 492. *got_frame_ptr = 0; ^ 493. 494. if (s->max_framesize == 0) { libavcodec/flacdec.c:494:9: Taking true branch 492. *got_frame_ptr = 0; 493. 494. if (s->max_framesize == 0) { ^ 495. s->max_framesize = 496. ff_flac_get_max_frame_size(s->max_blocksize ? s->max_blocksize : FLAC_MAX_BLOCKSIZE, libavcodec/flacdec.c:496:40: Condition is true 494. if (s->max_framesize == 0) { 495. s->max_framesize = 496. ff_flac_get_max_frame_size(s->max_blocksize ? s->max_blocksize : FLAC_MAX_BLOCKSIZE, ^ 497. FLAC_MAX_CHANNELS, 32); 498. } libavcodec/flacdec.c:495:9: 493. 494. if (s->max_framesize == 0) { 495. s->max_framesize = ^ 496. ff_flac_get_max_frame_size(s->max_blocksize ? s->max_blocksize : FLAC_MAX_BLOCKSIZE, 497. FLAC_MAX_CHANNELS, 32); libavcodec/flac.c:148:1: start of procedure ff_flac_get_max_frame_size() 146. } 147. 148. int ff_flac_get_max_frame_size(int blocksize, int ch, int bps) ^ 149. { 150. /* Technically, there is no limit to FLAC frame size, but an encoder libavcodec/flac.c:156:5: 154. int count; 155. 156. count = 16; /* frame header */ ^ 157. count += ch * ((7+bps+7)/8); /* subframe headers */ 158. if (ch == 2) { libavcodec/flac.c:157:5: 155. 156. count = 16; /* frame header */ 157. count += ch * ((7+bps+7)/8); /* subframe headers */ ^ 158. if (ch == 2) { 159. /* for stereo, need to account for using decorrelation */ libavcodec/flac.c:158:9: Taking false branch 156. count = 16; /* frame header */ 157. count += ch * ((7+bps+7)/8); /* subframe headers */ 158. if (ch == 2) { ^ 159. /* for stereo, need to account for using decorrelation */ 160. count += (( 2*bps+1) * blocksize + 7) / 8; libavcodec/flac.c:162:9: 160. count += (( 2*bps+1) * blocksize + 7) / 8; 161. } else { 162. count += ( ch*bps * blocksize + 7) / 8; ^ 163. } 164. count += 2; /* frame footer */ libavcodec/flac.c:164:5: 162. count += ( ch*bps * blocksize + 7) / 8; 163. } 164. count += 2; /* frame footer */ ^ 165. 166. return count; libavcodec/flac.c:166:5: 164. count += 2; /* frame footer */ 165. 166. return count; ^ 167. } 168. libavcodec/flac.c:167:1: return from a call to ff_flac_get_max_frame_size 165. 166. return count; 167. } ^ 168. 169. int avpriv_flac_is_extradata_valid(AVCodecContext *avctx, libavcodec/flacdec.c:503:9: Taking false branch 501. this amount corresponds to the smallest valid FLAC frame possible. 502. FF F8 69 02 00 00 9A 00 00 34 46 */ 503. if (buf_size < FLAC_MIN_FRAME_SIZE) ^ 504. return buf_size; 505. libavcodec/flacdec.c:507:9: 505. 506. /* check for inline header */ 507. if (AV_RB32(buf) == MKBETAG('f','L','a','C')) { ^ 508. if (!s->got_streaminfo && (ret = parse_streaminfo(s, buf, buf_size))) { 509. av_log(s->avctx, AV_LOG_ERROR, "invalid header\n"); libavutil/ppc/intreadwrite.h:73:1: start of procedure av_read_bswap32() 71. } 72. 73. static av_always_inline uint32_t av_read_bswap32(const void *p) ^ 74. { 75. uint32_t v; libavutil/ppc/intreadwrite.h:76:5: Skipping __infer_skip_gcc_asm_stmt(): function or method not found 74. { 75. uint32_t v; 76. __asm__ ("lwbrx %0, %y1" : "=r"(v) : "Z"(*(const uint32_t*)p)); ^ 77. return v; 78. } libavutil/ppc/intreadwrite.h:77:5: 75. uint32_t v; 76. __asm__ ("lwbrx %0, %y1" : "=r"(v) : "Z"(*(const uint32_t*)p)); 77. return v; ^ 78. } 79. libavutil/ppc/intreadwrite.h:78:1: return from a call to av_read_bswap32 76. __asm__ ("lwbrx %0, %y1" : "=r"(v) : "Z"(*(const uint32_t*)p)); 77. return v; 78. } ^ 79. 80. static av_always_inline void av_write_bswap32(void *p, uint32_t v) libavcodec/flacdec.c:507:9: Taking false branch 505. 506. /* check for inline header */ 507. if (AV_RB32(buf) == MKBETAG('f','L','a','C')) { ^ 508. if (!s->got_streaminfo && (ret = parse_streaminfo(s, buf, buf_size))) { 509. av_log(s->avctx, AV_LOG_ERROR, "invalid header\n"); libavcodec/flacdec.c:516:5: 514. 515. /* decode frame */ 516. init_get_bits(&s->gb, buf, buf_size*8); ^ 517. if ((ret = decode_frame(s)) < 0) { 518. av_log(s->avctx, AV_LOG_ERROR, "decode_frame() failed\n"); libavcodec/get_bits.h:376:1: start of procedure init_get_bits() 374. * @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow. 375. */ 376. static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer, ^ 377. int bit_size) 378. { libavcodec/get_bits.h:380:5: 378. { 379. int buffer_size; 380. int ret = 0; ^ 381. 382. if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) { libavcodec/get_bits.h:382:9: Taking true branch 380. int ret = 0; 381. 382. if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) { ^ 383. bit_size = 0; 384. buffer = NULL; libavcodec/get_bits.h:383:9: 381. 382. if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) { 383. bit_size = 0; ^ 384. buffer = NULL; 385. ret = AVERROR_INVALIDDATA; libavcodec/get_bits.h:384:9: 382. if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) { 383. bit_size = 0; 384. buffer = NULL; ^ 385. ret = AVERROR_INVALIDDATA; 386. } libavcodec/get_bits.h:385:9: 383. bit_size = 0; 384. buffer = NULL; 385. ret = AVERROR_INVALIDDATA; ^ 386. } 387. libavcodec/get_bits.h:388:5: 386. } 387. 388. buffer_size = (bit_size + 7) >> 3; ^ 389. 390. s->buffer = buffer; libavcodec/get_bits.h:390:5: 388. buffer_size = (bit_size + 7) >> 3; 389. 390. s->buffer = buffer; ^ 391. s->size_in_bits = bit_size; 392. #if !UNCHECKED_BITSTREAM_READER libavcodec/get_bits.h:391:5: 389. 390. s->buffer = buffer; 391. s->size_in_bits = bit_size; ^ 392. #if !UNCHECKED_BITSTREAM_READER 393. s->size_in_bits_plus8 = bit_size + 8; libavcodec/get_bits.h:393:5: 391. s->size_in_bits = bit_size; 392. #if !UNCHECKED_BITSTREAM_READER 393. s->size_in_bits_plus8 = bit_size + 8; ^ 394. #endif 395. s->buffer_end = buffer + buffer_size; libavcodec/get_bits.h:395:5: 393. s->size_in_bits_plus8 = bit_size + 8; 394. #endif 395. s->buffer_end = buffer + buffer_size; ^ 396. s->index = 0; 397. libavcodec/get_bits.h:396:5: 394. #endif 395. s->buffer_end = buffer + buffer_size; 396. s->index = 0; ^ 397. 398. return ret; libavcodec/get_bits.h:398:5: 396. s->index = 0; 397. 398. return ret; ^ 399. } 400. libavcodec/get_bits.h:399:1: return from a call to init_get_bits 397. 398. return ret; 399. } ^ 400. 401. /** libavcodec/flacdec.c:517:9: 515. /* decode frame */ 516. init_get_bits(&s->gb, buf, buf_size*8); 517. if ((ret = decode_frame(s)) < 0) { ^ 518. av_log(s->avctx, AV_LOG_ERROR, "decode_frame() failed\n"); 519. return ret; libavcodec/flacdec.c:399:1: start of procedure decode_frame() 397. } 398. 399. static int decode_frame(FLACContext *s) ^ 400. { 401. int i, ret; libavcodec/flacdec.c:402:5: 400. { 401. int i, ret; 402. GetBitContext *gb = &s->gb; ^ 403. FLACFrameInfo fi; 404. libavcodec/flacdec.c:405:9: 403. FLACFrameInfo fi; 404. 405. if ((ret = ff_flac_decode_frame_header(s->avctx, gb, &fi, 0)) < 0) { ^ 406. av_log(s->avctx, AV_LOG_ERROR, "invalid frame header\n"); 407. return ret; libavcodec/flac.c:50:1: start of procedure ff_flac_decode_frame_header() 48. } 49. 50. int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb, ^ 51. FLACFrameInfo *fi, int log_level_offset) 52. { libavcodec/flac.c:56:9: Taking false branch 54. 55. /* frame sync code */ 56. if ((get_bits(gb, 15) & 0x7FFF) != 0x7FFC) { ^ 57. av_log(avctx, AV_LOG_ERROR + log_level_offset, "invalid sync code\n"); 58. return AVERROR_INVALIDDATA; libavcodec/flac.c:62:5: 60. 61. /* variable block size stream code */ 62. fi->is_var_size = get_bits1(gb); ^ 63. 64. /* block size and sample rate codes */ libavcodec/get_bits.h:272:1: start of procedure get_bits1() 270. } 271. 272. static inline unsigned int get_bits1(GetBitContext *s) ^ 273. { 274. unsigned int index = s->index; libavcodec/get_bits.h:274:5: 272. static inline unsigned int get_bits1(GetBitContext *s) 273. { 274. unsigned int index = s->index; ^ 275. uint8_t result = s->buffer[index >> 3]; 276. #ifdef BITSTREAM_READER_LE libavcodec/get_bits.h:275:5: 273. { 274. unsigned int index = s->index; 275. uint8_t result = s->buffer[index >> 3]; ^ 276. #ifdef BITSTREAM_READER_LE 277. result >>= index & 7; libavcodec/get_bits.h:277:5: 275. uint8_t result = s->buffer[index >> 3]; 276. #ifdef BITSTREAM_READER_LE 277. result >>= index & 7; ^ 278. result &= 1; 279. #else libavcodec/get_bits.h:278:5: 276. #ifdef BITSTREAM_READER_LE 277. result >>= index & 7; 278. result &= 1; ^ 279. #else 280. result <<= index & 7; libavcodec/get_bits.h:284:9: Taking false branch 282. #endif 283. #if !UNCHECKED_BITSTREAM_READER 284. if (s->index < s->size_in_bits_plus8) ^ 285. #endif 286. index++; libavcodec/get_bits.h:287:5: 285. #endif 286. index++; 287. s->index = index; ^ 288. 289. return result; libavcodec/get_bits.h:289:5: 287. s->index = index; 288. 289. return result; ^ 290. } 291. libavcodec/get_bits.h:290:1: return from a call to get_bits1 288. 289. return result; 290. } ^ 291. 292. static inline unsigned int show_bits1(GetBitContext *s) libavcodec/flac.c:65:5: Skipping get_bits(): empty list of specs 63. 64. /* block size and sample rate codes */ 65. bs_code = get_bits(gb, 4); ^ 66. sr_code = get_bits(gb, 4); 67. libavcodec/flac.c:66:5: Skipping get_bits(): empty list of specs 64. /* block size and sample rate codes */ 65. bs_code = get_bits(gb, 4); 66. sr_code = get_bits(gb, 4); ^ 67. 68. /* channels and decorrelation */ libavcodec/flac.c:69:5: Skipping get_bits(): empty list of specs 67. 68. /* channels and decorrelation */ 69. fi->ch_mode = get_bits(gb, 4); ^ 70. if (fi->ch_mode < FLAC_MAX_CHANNELS) { 71. fi->channels = fi->ch_mode + 1; libavcodec/flac.c:70:9: Taking true branch 68. /* channels and decorrelation */ 69. fi->ch_mode = get_bits(gb, 4); 70. if (fi->ch_mode < FLAC_MAX_CHANNELS) { ^ 71. fi->channels = fi->ch_mode + 1; 72. fi->ch_mode = FLAC_CHMODE_INDEPENDENT; libavcodec/flac.c:71:9: 69. fi->ch_mode = get_bits(gb, 4); 70. if (fi->ch_mode < FLAC_MAX_CHANNELS) { 71. fi->channels = fi->ch_mode + 1; ^ 72. fi->ch_mode = FLAC_CHMODE_INDEPENDENT; 73. } else if (fi->ch_mode < FLAC_MAX_CHANNELS + FLAC_CHMODE_MID_SIDE) { libavcodec/flac.c:72:9: 70. if (fi->ch_mode < FLAC_MAX_CHANNELS) { 71. fi->channels = fi->ch_mode + 1; 72. fi->ch_mode = FLAC_CHMODE_INDEPENDENT; ^ 73. } else if (fi->ch_mode < FLAC_MAX_CHANNELS + FLAC_CHMODE_MID_SIDE) { 74. fi->channels = 2; libavcodec/flac.c:83:5: Skipping get_bits(): empty list of specs 81. 82. /* bits per sample */ 83. bps_code = get_bits(gb, 3); ^ 84. if (bps_code == 3 || bps_code == 7) { 85. av_log(avctx, AV_LOG_ERROR + log_level_offset, libavcodec/flac.c:84:9: Taking false branch 82. /* bits per sample */ 83. bps_code = get_bits(gb, 3); 84. if (bps_code == 3 || bps_code == 7) { ^ 85. av_log(avctx, AV_LOG_ERROR + log_level_offset, 86. "invalid sample size code (%d)\n", libavcodec/flac.c:84:26: Taking false branch 82. /* bits per sample */ 83. bps_code = get_bits(gb, 3); 84. if (bps_code == 3 || bps_code == 7) { ^ 85. av_log(avctx, AV_LOG_ERROR + log_level_offset, 86. "invalid sample size code (%d)\n", libavcodec/flac.c:90:5: 88. return AVERROR_INVALIDDATA; 89. } 90. fi->bps = sample_size_table[bps_code]; ^ 91. 92. /* reserved bit */ libavcodec/flac.c:93:9: 91. 92. /* reserved bit */ 93. if (get_bits1(gb)) { ^ 94. av_log(avctx, AV_LOG_ERROR + log_level_offset, 95. "broken stream, invalid padding\n"); libavcodec/get_bits.h:272:1: start of procedure get_bits1() 270. } 271. 272. static inline unsigned int get_bits1(GetBitContext *s) ^ 273. { 274. unsigned int index = s->index; libavcodec/get_bits.h:274:5: 272. static inline unsigned int get_bits1(GetBitContext *s) 273. { 274. unsigned int index = s->index; ^ 275. uint8_t result = s->buffer[index >> 3]; 276. #ifdef BITSTREAM_READER_LE libavcodec/get_bits.h:275:5: 273. { 274. unsigned int index = s->index; 275. uint8_t result = s->buffer[index >> 3]; ^ 276. #ifdef BITSTREAM_READER_LE 277. result >>= index & 7;
https://github.com/libav/libav/blob/77ab341c0c6cdf2bd437bb48d429e797d1e60da2/libavcodec/flacdec.c/#L517
d2a_code_trace_data_45131
void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) { unsigned long hash; OPENSSL_LH_NODE *nn, **rn; void *ret; lh->error = 0; rn = getrn(lh, data, &hash); if (*rn == NULL) { lh->num_no_delete++; return (NULL); } else { nn = *rn; *rn = nn->next; ret = nn->data; OPENSSL_free(nn); lh->num_delete++; } lh->num_items--; if ((lh->num_nodes > MIN_NODES) && (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes))) contract(lh); return (ret); } ssl/bio_ssl.c:80: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned64 by call to `SSL_free`. Showing all 14 steps of the trace ssl/bio_ssl.c:80:13: Call 78. if (BIO_get_shutdown(a)) { 79. if (BIO_get_init(a)) 80. SSL_free(bs->ssl); ^ 81. /* Clear all flags */ 82. BIO_clear_flags(a, ~0); ssl/ssl_lib.c:926:1: Parameter `s->initial_ctx->sessions->num_items` 924. } 925. 926. > void SSL_free(SSL *s) 927. { 928. int i; ssl/ssl_lib.c:963:9: Call 961. /* Make the next call work :-) */ 962. if (s->session != NULL) { 963. ssl_clear_bad_session(s); ^ 964. SSL_SESSION_free(s->session); 965. } ssl/ssl_sess.c:992:1: Parameter `s->initial_ctx->sessions->num_items` 990. } 991. 992. > int ssl_clear_bad_session(SSL *s) 993. { 994. if ((s->session != NULL) && ssl/ssl_sess.c:997:9: Call 995. !(s->shutdown & SSL_SENT_SHUTDOWN) && 996. !(SSL_in_init(s) || SSL_in_before(s))) { 997. SSL_CTX_remove_session(s->session_ctx, s->session); ^ 998. return (1); 999. } else ssl/ssl_sess.c:691:1: Parameter `ctx->sessions->num_items` 689. } 690. 691. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 692. { 693. return remove_session_lock(ctx, c, 1); ssl/ssl_sess.c:693:12: Call 691. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 692. { 693. return remove_session_lock(ctx, c, 1); ^ 694. } 695. ssl/ssl_sess.c:696:1: Parameter `ctx->sessions->num_items` 694. } 695. 696. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck) 697. { 698. SSL_SESSION *r; ssl/ssl_sess.c:706:17: Call 704. if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) == c) { 705. ret = 1; 706. r = lh_SSL_SESSION_delete(ctx->sessions, c); ^ 707. SSL_SESSION_list_remove(ctx, c); 708. } ssl/ssl_locl.h:581:1: Parameter `lh->num_items` 579. }; 580. 581. > DEFINE_LHASH_OF(SSL_SESSION); 582. /* Needed in ssl_cert.c */ 583. DEFINE_LHASH_OF(X509_NAME); ssl/ssl_locl.h:581:1: Call 579. }; 580. 581. > DEFINE_LHASH_OF(SSL_SESSION); 582. /* Needed in ssl_cert.c */ 583. DEFINE_LHASH_OF(X509_NAME); crypto/lhash/lhash.c:103:1: <LHS trace> 101. } 102. 103. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) 104. { 105. unsigned long hash; crypto/lhash/lhash.c:103:1: Parameter `lh->num_items` 101. } 102. 103. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) 104. { 105. unsigned long hash; crypto/lhash/lhash.c:123:5: Binary operation: ([0, +oo] - 1):unsigned64 by call to `SSL_free` 121. } 122. 123. lh->num_items--; ^ 124. if ((lh->num_nodes > MIN_NODES) && 125. (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
https://github.com/openssl/openssl/blob/2a7de0fd5d9baf946ef4d2c51096b04dd47a8143/crypto/lhash/lhash.c/#L123
d2a_code_trace_data_45132
static av_always_inline int epzs_motion_search_internal(MpegEncContext * s, int *mx_ptr, int *my_ptr, int P[10][2], int src_index, int ref_index, int16_t (*last_mv)[2], int ref_mv_scale, int flags, int size, int h) { MotionEstContext * const c= &s->me; int best[2]={0, 0}; int d; int dmin; int map_generation; int penalty_factor; const int ref_mv_stride= s->mb_stride; const int ref_mv_xy= s->mb_x + s->mb_y*ref_mv_stride; me_cmp_func cmpf, chroma_cmpf; LOAD_COMMON LOAD_COMMON2 if(c->pre_pass){ penalty_factor= c->pre_penalty_factor; cmpf= s->dsp.me_pre_cmp[size]; chroma_cmpf= s->dsp.me_pre_cmp[size+1]; }else{ penalty_factor= c->penalty_factor; cmpf= s->dsp.me_cmp[size]; chroma_cmpf= s->dsp.me_cmp[size+1]; } map_generation= update_map_generation(c); assert(cmpf); dmin= cmp(s, 0, 0, 0, 0, size, h, ref_index, src_index, cmpf, chroma_cmpf, flags); map[0]= map_generation; score_map[0]= dmin; if((s->pict_type == FF_B_TYPE && !(c->flags & FLAG_DIRECT)) || s->flags&CODEC_FLAG_MV0) dmin += (mv_penalty[pred_x] + mv_penalty[pred_y])*penalty_factor; if (s->first_slice_line) { CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift) CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16) }else{ if(dmin<((h*h*s->avctx->mv0_threshold)>>8) && ( P_LEFT[0] |P_LEFT[1] |P_TOP[0] |P_TOP[1] |P_TOPRIGHT[0]|P_TOPRIGHT[1])==0){ *mx_ptr= 0; *my_ptr= 0; c->skip=1; return dmin; } CHECK_MV( P_MEDIAN[0] >>shift , P_MEDIAN[1] >>shift) CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift) , (P_MEDIAN[1]>>shift)-1) CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift) , (P_MEDIAN[1]>>shift)+1) CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift)-1, (P_MEDIAN[1]>>shift) ) CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift)+1, (P_MEDIAN[1]>>shift) ) CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16) CHECK_MV(P_LEFT[0] >>shift, P_LEFT[1] >>shift) CHECK_MV(P_TOP[0] >>shift, P_TOP[1] >>shift) CHECK_MV(P_TOPRIGHT[0]>>shift, P_TOPRIGHT[1]>>shift) } if(dmin>h*h*4){ if(c->pre_pass){ CHECK_CLIPPED_MV((last_mv[ref_mv_xy-1][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy-1][1]*ref_mv_scale + (1<<15))>>16) if(!s->first_slice_line) CHECK_CLIPPED_MV((last_mv[ref_mv_xy-ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy-ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16) }else{ CHECK_CLIPPED_MV((last_mv[ref_mv_xy+1][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy+1][1]*ref_mv_scale + (1<<15))>>16) if(s->mb_y+1<s->end_mb_y) CHECK_CLIPPED_MV((last_mv[ref_mv_xy+ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy+ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16) } } if(c->avctx->last_predictor_count){ const int count= c->avctx->last_predictor_count; const int xstart= FFMAX(0, s->mb_x - count); const int ystart= FFMAX(0, s->mb_y - count); const int xend= FFMIN(s->mb_width , s->mb_x + count + 1); const int yend= FFMIN(s->mb_height, s->mb_y + count + 1); int mb_y; for(mb_y=ystart; mb_y<yend; mb_y++){ int mb_x; for(mb_x=xstart; mb_x<xend; mb_x++){ const int xy= mb_x + 1 + (mb_y + 1)*ref_mv_stride; int mx= (last_mv[xy][0]*ref_mv_scale + (1<<15))>>16; int my= (last_mv[xy][1]*ref_mv_scale + (1<<15))>>16; if(mx>xmax || mx<xmin || my>ymax || my<ymin) continue; CHECK_MV(mx,my) } } } dmin= diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags); *mx_ptr= best[0]; *my_ptr= best[1]; return dmin; } libavcodec/motion_est_template.c:1057: error: Uninitialized Value The value read from xmin was never initialized. libavcodec/motion_est_template.c:1057:9: 1055. } 1056. CHECK_MV( P_MEDIAN[0] >>shift , P_MEDIAN[1] >>shift) 1057. CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift) , (P_MEDIAN[1]>>shift)-1) ^ 1058. CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift) , (P_MEDIAN[1]>>shift)+1) 1059. CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift)-1, (P_MEDIAN[1]>>shift) )
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1057
d2a_code_trace_data_45133
static ossl_inline void packet_forward(PACKET *pkt, size_t len) { pkt->curr += len; pkt->remaining -= len; } test/servername_test.c:41: error: INTEGER_OVERFLOW_L2 ([0, 9223372036854775807] - 5):unsigned64 by call to `PACKET_forward`. Showing all 11 steps of the trace test/servername_test.c:34:19: Assignment 32. long len; 33. unsigned char *data; 34. PACKET pkt = {0}, pkt2 = {0}, pkt3 = {0}, pkt4 = {0}, pkt5 = {0}; ^ 35. unsigned int servname_type = 0, type = 0; 36. int ret = 0; test/servername_test.c:39:10: Call 37. 38. len = BIO_get_mem_data(bio, (char **)&data); 39. if (!TEST_true(PACKET_buf_init(&pkt, data, len)) ^ 40. /* Skip the record header */ 41. || !PACKET_forward(&pkt, SSL3_RT_HEADER_LENGTH) ssl/packet_locl.h:72:8: Parameter `pkt->remaining` 70. * is being used. 71. */ 72. __owur static ossl_inline int PACKET_buf_init(PACKET *pkt, ^ 73. const unsigned char *buf, 74. size_t len) test/servername_test.c:41:17: Call 39. if (!TEST_true(PACKET_buf_init(&pkt, data, len)) 40. /* Skip the record header */ 41. || !PACKET_forward(&pkt, SSL3_RT_HEADER_LENGTH) ^ 42. /* Skip the handshake message header */ 43. || !TEST_true(PACKET_forward(&pkt, SSL3_HM_HEADER_LENGTH)) ssl/packet_locl.h:467:8: Parameter `len` 465. 466. /* Move the current reading position forward |len| bytes */ 467. __owur static ossl_inline int PACKET_forward(PACKET *pkt, size_t len) ^ 468. { 469. if (PACKET_remaining(pkt) < len) 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/190b9a03b72a8029c27e4bd0ab000129e240a413/ssl/packet_locl.h/#L36
d2a_code_trace_data_45134
static int mov_write_udta_sdp(AVIOContext *pb, MOVTrack *track) { AVFormatContext *ctx = track->rtp_ctx; char buf[1000] = ""; int len; ff_sdp_write_media(buf, sizeof(buf), ctx->streams[0], track->src_track, NULL, NULL, 0, 0, ctx); av_strlcatf(buf, sizeof(buf), "a=control:streamid=%d\r\n", track->track_id); len = strlen(buf); avio_wb32(pb, len + 24); ffio_wfourcc(pb, "udta"); avio_wb32(pb, len + 16); ffio_wfourcc(pb, "hnti"); avio_wb32(pb, len + 8); ffio_wfourcc(pb, "sdp "); avio_write(pb, buf, len); return len + 24; } libavformat/movenc.c:1622: error: Null Dereference pointer `null` is dereferenced by call to `ff_sdp_write_media()` at line 1622, column 5. libavformat/movenc.c:1616:1: start of procedure mov_write_udta_sdp() 1614. } 1615. 1616. static int mov_write_udta_sdp(AVIOContext *pb, MOVTrack *track) ^ 1617. { 1618. AVFormatContext *ctx = track->rtp_ctx; libavformat/movenc.c:1618:5: 1616. static int mov_write_udta_sdp(AVIOContext *pb, MOVTrack *track) 1617. { 1618. AVFormatContext *ctx = track->rtp_ctx; ^ 1619. char buf[1000] = ""; 1620. int len; libavformat/movenc.c:1619:5: 1617. { 1618. AVFormatContext *ctx = track->rtp_ctx; 1619. char buf[1000] = ""; ^ 1620. int len; 1621. libavformat/movenc.c:1622:5: 1620. int len; 1621. 1622. ff_sdp_write_media(buf, sizeof(buf), ctx->streams[0], track->src_track, ^ 1623. NULL, NULL, 0, 0, ctx); 1624. av_strlcatf(buf, sizeof(buf), "a=control:streamid=%d\r\n", track->track_id); libavformat/sdp.c:593:1: start of procedure ff_sdp_write_media() 591. } 592. 593. void ff_sdp_write_media(char *buff, int size, AVStream *st, int idx, ^ 594. const char *dest_addr, const char *dest_type, 595. int port, int ttl, AVFormatContext *fmt) libavformat/sdp.c:597:5: 595. int port, int ttl, AVFormatContext *fmt) 596. { 597. AVCodecContext *c = st->codec; ^ 598. const char *type; 599. int payload_type; libavformat/sdp.c:601:5: Skipping ff_rtp_get_payload_type(): empty list of specs 599. int payload_type; 600. 601. payload_type = ff_rtp_get_payload_type(fmt, c, idx); ^ 602. 603. switch (c->codec_type) { libavformat/sdp.c:603:5: 601. payload_type = ff_rtp_get_payload_type(fmt, c, idx); 602. 603. switch (c->codec_type) { ^ 604. case AVMEDIA_TYPE_VIDEO : type = "video" ; break; 605. case AVMEDIA_TYPE_AUDIO : type = "audio" ; break; libavformat/sdp.c:604:9: Switch condition is false. Skipping switch case 602. 603. switch (c->codec_type) { 604. case AVMEDIA_TYPE_VIDEO : type = "video" ; break; ^ 605. case AVMEDIA_TYPE_AUDIO : type = "audio" ; break; 606. case AVMEDIA_TYPE_SUBTITLE: type = "text" ; break; libavformat/sdp.c:605:9: Switch condition is false. Skipping switch case 603. switch (c->codec_type) { 604. case AVMEDIA_TYPE_VIDEO : type = "video" ; break; 605. case AVMEDIA_TYPE_AUDIO : type = "audio" ; break; ^ 606. case AVMEDIA_TYPE_SUBTITLE: type = "text" ; break; 607. default : type = "application"; break; libavformat/sdp.c:606:9: Switch condition is false. Skipping switch case 604. case AVMEDIA_TYPE_VIDEO : type = "video" ; break; 605. case AVMEDIA_TYPE_AUDIO : type = "audio" ; break; 606. case AVMEDIA_TYPE_SUBTITLE: type = "text" ; break; ^ 607. default : type = "application"; break; 608. } libavformat/sdp.c:607:35: 605. case AVMEDIA_TYPE_AUDIO : type = "audio" ; break; 606. case AVMEDIA_TYPE_SUBTITLE: type = "text" ; break; 607. default : type = "application"; break; ^ 608. } 609. libavformat/sdp.c:610:5: 608. } 609. 610. av_strlcatf(buff, size, "m=%s %d RTP/AVP %d\r\n", type, port, payload_type); ^ 611. sdp_write_address(buff, size, dest_addr, dest_type, ttl); 612. if (c->bit_rate) { libavutil/avstring.c:99:1: start of procedure av_strlcatf() 97. } 98. 99. size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...) ^ 100. { 101. int len = strlen(dst); libavutil/avstring.c:101:5: 99. size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...) 100. { 101. int len = strlen(dst); ^ 102. va_list vl; 103. libavutil/avstring.c:104:5: 102. va_list vl; 103. 104. va_start(vl, fmt); ^ 105. len += vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl); 106. va_end(vl); libavutil/avstring.c:105:33: Condition is true 103. 104. va_start(vl, fmt); 105. len += vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl); ^ 106. va_end(vl); 107. libavutil/avstring.c:105:5: 103. 104. va_start(vl, fmt); 105. len += vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl); ^ 106. va_end(vl); 107. libavutil/avstring.c:106:5: 104. va_start(vl, fmt); 105. len += vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl); 106. va_end(vl); ^ 107. 108. return len; libavutil/avstring.c:108:5: 106. va_end(vl); 107. 108. return len; ^ 109. } 110. libavutil/avstring.c:109:1: return from a call to av_strlcatf 107. 108. return len; 109. } ^ 110. 111. char *av_d2str(double d) libavformat/sdp.c:611:5: 609. 610. av_strlcatf(buff, size, "m=%s %d RTP/AVP %d\r\n", type, port, payload_type); 611. sdp_write_address(buff, size, dest_addr, dest_type, ttl); ^ 612. if (c->bit_rate) { 613. av_strlcatf(buff, size, "b=AS:%d\r\n", c->bit_rate / 1000); libavformat/sdp.c:57:1: start of procedure sdp_write_address() 55. }; 56. 57. static void sdp_write_address(char *buff, int size, const char *dest_addr, ^ 58. const char *dest_type, int ttl) 59. { libavformat/sdp.c:60:9: Taking true branch 58. const char *dest_type, int ttl) 59. { 60. if (dest_addr) { ^ 61. if (!dest_type) 62. dest_type = "IP4"; libavformat/sdp.c:61:14: Taking false branch 59. { 60. if (dest_addr) { 61. if (!dest_type) ^ 62. dest_type = "IP4"; 63. if (ttl > 0 && !strcmp(dest_type, "IP4")) { libavformat/sdp.c:63:13: Taking true branch 61. if (!dest_type) 62. dest_type = "IP4"; 63. if (ttl > 0 && !strcmp(dest_type, "IP4")) { ^ 64. /* The TTL should only be specified for IPv4 multicast addresses, 65. * not for IPv6. */ libavformat/sdp.c:63:25: Taking false branch 61. if (!dest_type) 62. dest_type = "IP4"; 63. if (ttl > 0 && !strcmp(dest_type, "IP4")) { ^ 64. /* The TTL should only be specified for IPv4 multicast addresses, 65. * not for IPv6. */ libavformat/sdp.c:68:13: 66. av_strlcatf(buff, size, "c=IN %s %s/%d\r\n", dest_type, dest_addr, ttl); 67. } else { 68. av_strlcatf(buff, size, "c=IN %s %s\r\n", dest_type, dest_addr); ^ 69. } 70. } libavutil/avstring.c:99:1: start of procedure av_strlcatf() 97. } 98. 99. size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...) ^ 100. { 101. int len = strlen(dst); libavutil/avstring.c:101:5: 99. size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...) 100. { 101. int len = strlen(dst); ^ 102. va_list vl; 103. libavutil/avstring.c:104:5: 102. va_list vl; 103. 104. va_start(vl, fmt); ^ 105. len += vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl); 106. va_end(vl); libavutil/avstring.c:105:33: Condition is true 103. 104. va_start(vl, fmt); 105. len += vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl); ^ 106. va_end(vl); 107. libavutil/avstring.c:105:5: 103. 104. va_start(vl, fmt); 105. len += vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl); ^ 106. va_end(vl); 107. libavutil/avstring.c:106:5: 104. va_start(vl, fmt); 105. len += vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl); 106. va_end(vl); ^ 107. 108. return len; libavutil/avstring.c:108:5: 106. va_end(vl); 107. 108. return len; ^ 109. } 110. libavutil/avstring.c:109:1: return from a call to av_strlcatf 107. 108. return len; 109. } ^ 110. 111. char *av_d2str(double d) libavformat/sdp.c:60:5: 58. const char *dest_type, int ttl) 59. { 60. if (dest_addr) { ^ 61. if (!dest_type) 62. dest_type = "IP4"; libavformat/sdp.c:71:1: return from a call to sdp_write_address 69. } 70. } 71. } ^ 72. 73. static void sdp_write_header(char *buff, int size, struct sdp_session_level *s) libavformat/sdp.c:612:9: Taking true branch 610. av_strlcatf(buff, size, "m=%s %d RTP/AVP %d\r\n", type, port, payload_type); 611. sdp_write_address(buff, size, dest_addr, dest_type, ttl); 612. if (c->bit_rate) { ^ 613. av_strlcatf(buff, size, "b=AS:%d\r\n", c->bit_rate / 1000); 614. } libavformat/sdp.c:613:9: 611. sdp_write_address(buff, size, dest_addr, dest_type, ttl); 612. if (c->bit_rate) { 613. av_strlcatf(buff, size, "b=AS:%d\r\n", c->bit_rate / 1000); ^ 614. } 615. libavutil/avstring.c:99:1: start of procedure av_strlcatf() 97. } 98. 99. size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...) ^ 100. { 101. int len = strlen(dst); libavutil/avstring.c:101:5: 99. size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...) 100. { 101. int len = strlen(dst); ^ 102. va_list vl; 103. libavutil/avstring.c:104:5: 102. va_list vl; 103. 104. va_start(vl, fmt); ^ 105. len += vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl); 106. va_end(vl); libavutil/avstring.c:105:33: Condition is true 103. 104. va_start(vl, fmt); 105. len += vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl); ^ 106. va_end(vl); 107. libavutil/avstring.c:105:5: 103. 104. va_start(vl, fmt); 105. len += vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl); ^ 106. va_end(vl); 107. libavutil/avstring.c:106:5: 104. va_start(vl, fmt); 105. len += vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl); 106. va_end(vl); ^ 107. 108. return len; libavutil/avstring.c:108:5: 106. va_end(vl); 107. 108. return len; ^ 109. } 110. libavutil/avstring.c:109:1: return from a call to av_strlcatf 107. 108. return len; 109. } ^ 110. 111. char *av_d2str(double d) libavformat/sdp.c:616:5: Skipping sdp_write_media_attributes(): empty list of specs 614. } 615. 616. sdp_write_media_attributes(buff, size, c, payload_type, fmt); ^ 617. } 618. libavformat/sdp.c:617:1: return from a call to ff_sdp_write_media 615. 616. sdp_write_media_attributes(buff, size, c, payload_type, fmt); 617. } ^ 618. 619. int av_sdp_create(AVFormatContext *ac[], int n_files, char *buf, int size)
https://github.com/libav/libav/blob/ce58ead40dd16f272ec1f127f04f69df67c7cd35/libavformat/movenc.c/#L1622
d2a_code_trace_data_45135
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; } libavformat/rtpenc_h263_rfc2190.c:117: error: Integer Overflow L2 ([1, +oo] - 8):unsigned32 by call to `bitstream_read`. libavformat/rtpenc_h263_rfc2190.c:117:20: Call 115. bitstream_init(&bc, buf, size * 8); 116. if (bitstream_read(&bc, 22) == 0x20) { /* Picture Start Code */ 117. info.tr = bitstream_read(&bc, 8); ^ 118. bitstream_skip(&bc, 2); /* PTYPE start, H.261 disambiguation */ 119. bitstream_skip(&bc, 3); /* Split screen, document camera, freeze picture release */ 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] - 8):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/7ff018c1cb43a5fe5ee2049d325cdd785852067a/libavcodec/bitstream.h/#L139
d2a_code_trace_data_45136
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/sm2/sm2_sign.c:235: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, 536870848] by call to `EC_POINT_mul`. Showing all 19 steps of the trace crypto/sm2/sm2_sign.c:230:14: Call 228. 229. for (;;) { 230. if (!BN_priv_rand_range(k, order)) { ^ 231. SM2err(SM2_F_SM2_SIG_GEN, ERR_R_INTERNAL_ERROR); 232. goto done; 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/sm2/sm2_sign.c:235:14: Call 233. } 234. 235. if (!EC_POINT_mul(group, kG, k, NULL, NULL, ctx) ^ 236. || !EC_POINT_get_affine_coordinates(group, kG, x1, NULL, 237. ctx) 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_45137
static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) { BN_ULONG *A, *a = NULL; const BN_ULONG *B; int i; bn_check_top(b); if (words > (INT_MAX / (4 * BN_BITS2))) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_BIGNUM_TOO_LONG); return NULL; } if (BN_get_flags(b, BN_FLG_STATIC_DATA)) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA); return (NULL); } if (BN_get_flags(b,BN_FLG_SECURE)) a = A = OPENSSL_secure_zalloc(words * sizeof(*a)); else a = A = OPENSSL_zalloc(words * sizeof(*a)); if (A == NULL) { BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE); return (NULL); } #if 1 B = b->d; if (B != NULL) { for (i = b->top >> 2; i > 0; i--, A += 4, B += 4) { BN_ULONG a0, a1, a2, a3; a0 = B[0]; a1 = B[1]; a2 = B[2]; a3 = B[3]; A[0] = a0; A[1] = a1; A[2] = a2; A[3] = a3; } switch (b->top & 3) { case 3: A[2] = B[2]; case 2: A[1] = B[1]; case 1: A[0] = B[0]; case 0: ; } } #else memset(A, 0, sizeof(*A) * words); memcpy(A, b->d, sizeof(b->d[0]) * b->top); #endif return (a); } apps/s_client.c:253: error: BUFFER_OVERRUN_L3 Offset: [3, +oo] (⇐ [0, +oo] + 3) Size: [0, 8388607] by call to `BN_rshift1`. Showing all 20 steps of the trace apps/s_client.c:252:9: Call 250. int ret = 251. g != NULL && N != NULL && bn_ctx != NULL && BN_is_odd(N) && 252. BN_is_prime_ex(N, SRP_NUMBER_ITERATIONS_FOR_PRIME, bn_ctx, NULL) == 1 && ^ 253. p != NULL && BN_rshift1(p, N) && 254. /* p = (N-1)/2 */ crypto/bn/bn_prime.c:197:12: Call 195. BN_GENCB *cb) 196. { 197. return BN_is_prime_fasttest_ex(a, checks, ctx_passed, 0, cb); ^ 198. } 199. crypto/bn/bn_prime.c:281:13: Call 279. /* now 1 <= check < A */ 280. 281. j = witness(check, A, A1, A1_odd, k, ctx, mont); ^ 282. if (j == -1) 283. goto err; crypto/bn/bn_prime.c:378:10: Call 376. BN_MONT_CTX *mont) 377. { 378. if (!BN_mod_exp_mont(w, w, a1_odd, a, ctx, mont)) /* w := w^a1_odd mod a */ ^ 379. return -1; 380. if (BN_is_one(w)) crypto/bn/bn_exp.c:356:14: Call 354. 355. if (a->neg || BN_ucmp(a, m) >= 0) { 356. if (!BN_nnmod(val[0], a, m, ctx)) ^ 357. goto err; 358. aa = val[0]; crypto/bn/bn_mod.c:20:11: Call 18. */ 19. 20. if (!(BN_mod(r, m, d, ctx))) ^ 21. return 0; 22. if (!r->neg) crypto/bn/bn_div.c:140:1: Parameter `*dv->d` 138. * If 'dv' or 'rm' is NULL, the respective value is not returned. 139. */ 140. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 141. BN_CTX *ctx) 142. { apps/s_client.c:253:22: Call 251. g != NULL && N != NULL && bn_ctx != NULL && BN_is_odd(N) && 252. BN_is_prime_ex(N, SRP_NUMBER_ITERATIONS_FOR_PRIME, bn_ctx, NULL) == 1 && 253. p != NULL && BN_rshift1(p, N) && ^ 254. /* p = (N-1)/2 */ 255. BN_is_prime_ex(p, SRP_NUMBER_ITERATIONS_FOR_PRIME, bn_ctx, NULL) == 1 && crypto/bn/bn_shift.c:46:1: Parameter `*r->d` 44. } 45. 46. > int BN_rshift1(BIGNUM *r, const BIGNUM *a) 47. { 48. BN_ULONG *ap, *rp, t, c; crypto/bn/bn_shift.c:55:9: Call 53. 54. if (BN_is_zero(a)) { 55. BN_zero(r); ^ 56. return (1); 57. } crypto/bn/bn_lib.c:463:1: Parameter `*a->d` 461. } 462. 463. > int BN_set_word(BIGNUM *a, BN_ULONG w) 464. { 465. bn_check_top(a); crypto/bn/bn_lib.c:466:9: Call 464. { 465. bn_check_top(a); 466. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 467. return (0); 468. a->neg = 0; crypto/bn/bn_lcl.h:676:1: Parameter `*a->d` 674. int bn_probable_prime_dh_coprime(BIGNUM *rnd, int bits, BN_CTX *ctx); 675. 676. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits) 677. { 678. if (bits > (INT_MAX - BN_BITS2 + 1)) crypto/bn/bn_lcl.h:684:12: Call 682. return a; 683. 684. return bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2); ^ 685. } 686. crypto/bn/bn_lib.c:323:1: Parameter `*b->d` 321. */ 322. 323. > BIGNUM *bn_expand2(BIGNUM *b, int words) 324. { 325. bn_check_top(b); crypto/bn/bn_lib.c:328:23: Call 326. 327. if (words > b->dmax) { 328. BN_ULONG *a = bn_expand_internal(b, words); ^ 329. if (!a) 330. return NULL; crypto/bn/bn_lib.c:246:1: <Length trace> 244. /* This is used by bn_expand2() */ 245. /* The caller MUST check that words > b->dmax before calling this */ 246. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 247. { 248. BN_ULONG *A, *a = NULL; crypto/bn/bn_lib.c:246:1: Parameter `*b->d` 244. /* This is used by bn_expand2() */ 245. /* The caller MUST check that words > b->dmax before calling this */ 246. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 247. { 248. BN_ULONG *A, *a = NULL; crypto/bn/bn_lib.c:272:5: Assignment 270. 271. #if 1 272. B = b->d; ^ 273. /* Check if the previous number needs to be copied */ 274. if (B != NULL) { crypto/bn/bn_lib.c:289:18: Array access: Offset: [3, +oo] (⇐ [0, +oo] + 3) Size: [0, 8388607] by call to `BN_rshift1` 287. a1 = B[1]; 288. a2 = B[2]; 289. a3 = B[3]; ^ 290. A[0] = a0; 291. A[1] = a1;
https://github.com/openssl/openssl/blob/748e85308ef4f3e672975b3604ea2d76424fa404/crypto/bn/bn_lib.c/#L289
d2a_code_trace_data_45138
char *CRYPTO_strdup(const char *str, const char* file, int line) { char *ret; if (str == NULL) return NULL; ret = CRYPTO_malloc(strlen(str) + 1, file, line); if (ret != NULL) strcpy(ret, str); return ret; } apps/rehash.c:226: error: BUFFER_OVERRUN_L3 Offset: [0, 4095] Size: [1, 4096] by call to `add_entry`. Showing all 12 steps of the trace apps/rehash.c:193:1: Array declaration 191. * This can be -1 if bad filename, or an error count. 192. */ 193. > static int handle_symlink(const char *filename, const char *fullpath) 194. { 195. unsigned int hash = 0; apps/rehash.c:226:12: Call 224. linktarget[n] = 0; 225. 226. return add_entry(type, hash, linktarget, NULL, 0, id); ^ 227. } 228. apps/rehash.c:124:1: Parameter `filename->strlen` 122. * Process an entry; return number of errors. 123. */ 124. > static int add_entry(enum Type type, unsigned int hash, const char *filename, 125. const unsigned char *digest, int need_symlink, 126. unsigned short old_id) apps/rehash.c:171:24: Call 169. *ep = nilhentry; 170. ep->old_id = ~0; 171. ep->filename = OPENSSL_strdup(filename); ^ 172. if (bp->last_entry) 173. bp->last_entry->next = ep; crypto/o_str.c:15:1: <Offset trace> 13. #include "internal/cryptlib.h" 14. 15. > char *CRYPTO_strdup(const char *str, const char* file, int line) 16. { 17. char *ret; crypto/o_str.c:15:1: Parameter `str->strlen` 13. #include "internal/cryptlib.h" 14. 15. > char *CRYPTO_strdup(const char *str, const char* file, int line) 16. { 17. char *ret; crypto/o_str.c:15:1: <Length trace> 13. #include "internal/cryptlib.h" 14. 15. > char *CRYPTO_strdup(const char *str, const char* file, int line) 16. { 17. char *ret; crypto/o_str.c:15:1: Parameter `str->strlen` 13. #include "internal/cryptlib.h" 14. 15. > char *CRYPTO_strdup(const char *str, const char* file, int line) 16. { 17. char *ret; crypto/o_str.c:21:11: Call 19. if (str == NULL) 20. return NULL; 21. ret = CRYPTO_malloc(strlen(str) + 1, file, line); ^ 22. if (ret != NULL) 23. strcpy(ret, str); crypto/mem.c:201:9: Assignment 199. 200. if (num == 0) 201. return NULL; ^ 202. 203. FAILTEST(); crypto/o_str.c:21:5: Assignment 19. if (str == NULL) 20. return NULL; 21. ret = CRYPTO_malloc(strlen(str) + 1, file, line); ^ 22. if (ret != NULL) 23. strcpy(ret, str); crypto/o_str.c:23:9: Array access: Offset: [0, 4095] Size: [1, 4096] by call to `add_entry` 21. ret = CRYPTO_malloc(strlen(str) + 1, file, line); 22. if (ret != NULL) 23. strcpy(ret, str); ^ 24. return ret; 25. }
https://github.com/openssl/openssl/blob/3bbec1afed1c65b6f7f645b27808b070e6e7a509/crypto/o_str.c/#L23
d2a_code_trace_data_45139
static void deinterlace_bottom_field_inplace(uint8_t *src1, int src_wrap, int width, int height) { uint8_t *src_m1, *src_0, *src_p1, *src_p2; int y; uint8_t *buf; buf = (uint8_t*)av_malloc(width); src_m1 = src1; memcpy(buf,src_m1,width); src_0=&src_m1[src_wrap]; src_p1=&src_0[src_wrap]; src_p2=&src_p1[src_wrap]; for(y=0;y<(height-2);y+=2) { deinterlace_line_inplace(buf,src_m1,src_0,src_p1,src_p2,width); src_m1 = src_p1; src_0 = src_p2; src_p1 += 2*src_wrap; src_p2 += 2*src_wrap; } deinterlace_line_inplace(buf,src_m1,src_0,src_0,src_0,width); av_free(buf); } libavcodec/imgconvert.c:1486: error: Null Dereference pointer `buf` last assigned on line 1483 could be null and is dereferenced by call to `memcpy()` at line 1486, column 5. libavcodec/imgconvert.c:1477:1: start of procedure deinterlace_bottom_field_inplace() 1475. } 1476. 1477. static void deinterlace_bottom_field_inplace(uint8_t *src1, int src_wrap, ^ 1478. int width, int height) 1479. { libavcodec/imgconvert.c:1483:5: 1481. int y; 1482. uint8_t *buf; 1483. buf = (uint8_t*)av_malloc(width); ^ 1484. 1485. src_m1 = src1; libavutil/mem.c:64:1: start of procedure av_malloc() 62. linker will do it automatically. */ 63. 64. void *av_malloc(unsigned int size) ^ 65. { 66. void *ptr = NULL; libavutil/mem.c:66:5: 64. void *av_malloc(unsigned int size) 65. { 66. void *ptr = NULL; ^ 67. #if CONFIG_MEMALIGN_HACK 68. long diff; libavutil/mem.c:72:8: Taking true branch 70. 71. /* let's disallow possible ambiguous cases */ 72. if(size > (INT_MAX-16) ) ^ 73. return NULL; 74. libavutil/mem.c:73:9: 71. /* let's disallow possible ambiguous cases */ 72. if(size > (INT_MAX-16) ) 73. return NULL; ^ 74. 75. #if CONFIG_MEMALIGN_HACK libavutil/mem.c:117:1: return from a call to av_malloc 115. #endif 116. return ptr; 117. } ^ 118. 119. void *av_realloc(void *ptr, unsigned int size) libavcodec/imgconvert.c:1485:5: 1483. buf = (uint8_t*)av_malloc(width); 1484. 1485. src_m1 = src1; ^ 1486. memcpy(buf,src_m1,width); 1487. src_0=&src_m1[src_wrap]; libavcodec/imgconvert.c:1486:5: 1484. 1485. src_m1 = src1; 1486. memcpy(buf,src_m1,width); ^ 1487. src_0=&src_m1[src_wrap]; 1488. src_p1=&src_0[src_wrap];
https://github.com/libav/libav/blob/5301a05d3ea208c140b41515468f98f5d94ddab9/libavcodec/imgconvert.c/#L1486
d2a_code_trace_data_45140
int MAIN(int argc, char **argv) { int ret=1,i; int verbose=0,Verbose=0; int use_supported = 0; #ifndef OPENSSL_NO_SSL_TRACE int stdname = 0; #endif const char **pp; const char *p; int badops=0; SSL_CTX *ctx=NULL; SSL *ssl=NULL; char *ciphers=NULL; const SSL_METHOD *meth=NULL; STACK_OF(SSL_CIPHER) *sk; char buf[512]; BIO *STDout=NULL; #if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3) meth=SSLv23_server_method(); #elif !defined(OPENSSL_NO_SSL3) meth=SSLv3_server_method(); #elif !defined(OPENSSL_NO_SSL2) meth=SSLv2_server_method(); #endif apps_startup(); if (bio_err == NULL) bio_err=BIO_new_fp(stderr,BIO_NOCLOSE); STDout=BIO_new_fp(stdout,BIO_NOCLOSE); #ifdef OPENSSL_SYS_VMS { BIO *tmpbio = BIO_new(BIO_f_linebuffer()); STDout = BIO_push(tmpbio, STDout); } #endif if (!load_config(bio_err, NULL)) goto end; argc--; argv++; while (argc >= 1) { if (strcmp(*argv,"-v") == 0) verbose=1; else if (strcmp(*argv,"-V") == 0) verbose=Verbose=1; else if (strcmp(*argv,"-s") == 0) use_supported = 1; #ifndef OPENSSL_NO_SSL_TRACE else if (strcmp(*argv,"-stdname") == 0) stdname=verbose=1; #endif #ifndef OPENSSL_NO_SSL2 else if (strcmp(*argv,"-ssl2") == 0) meth=SSLv2_client_method(); #endif #ifndef OPENSSL_NO_SSL3 else if (strcmp(*argv,"-ssl3") == 0) meth=SSLv3_client_method(); #endif #ifndef OPENSSL_NO_TLS1 else if (strcmp(*argv,"-tls1") == 0) meth=TLSv1_client_method(); #endif else if ((strncmp(*argv,"-h",2) == 0) || (strcmp(*argv,"-?") == 0)) { badops=1; break; } else { ciphers= *argv; } argc--; argv++; } if (badops) { for (pp=ciphers_usage; (*pp != NULL); pp++) BIO_printf(bio_err,"%s",*pp); goto end; } OpenSSL_add_ssl_algorithms(); ctx=SSL_CTX_new(meth); if (ctx == NULL) goto err; if (ciphers != NULL) { if(!SSL_CTX_set_cipher_list(ctx,ciphers)) { BIO_printf(bio_err, "Error in cipher list\n"); goto err; } } ssl=SSL_new(ctx); if (ssl == NULL) goto err; if (use_supported) sk=SSL_get1_supported_ciphers(ssl); else sk=SSL_get_ciphers(ssl); if (!verbose) { for (i=0; i<sk_SSL_CIPHER_num(sk); i++) { SSL_CIPHER *c = sk_SSL_CIPHER_value(sk,i); p = SSL_CIPHER_get_name(c); if (p == NULL) break; if (i != 0) BIO_printf(STDout,":"); BIO_printf(STDout,"%s",p); } BIO_printf(STDout,"\n"); } else { for (i=0; i<sk_SSL_CIPHER_num(sk); i++) { SSL_CIPHER *c; c = sk_SSL_CIPHER_value(sk,i); if (Verbose) { unsigned long id = SSL_CIPHER_get_id(c); int id0 = (int)(id >> 24); int id1 = (int)((id >> 16) & 0xffL); int id2 = (int)((id >> 8) & 0xffL); int id3 = (int)(id & 0xffL); if ((id & 0xff000000L) == 0x02000000L) BIO_printf(STDout, " 0x%02X,0x%02X,0x%02X - ", id1, id2, id3); else if ((id & 0xff000000L) == 0x03000000L) BIO_printf(STDout, " 0x%02X,0x%02X - ", id2, id3); else BIO_printf(STDout, "0x%02X,0x%02X,0x%02X,0x%02X - ", id0, id1, id2, id3); } #ifndef OPENSSL_NO_SSL_TRACE if (stdname) { const char *nm = SSL_CIPHER_standard_name(c); if (nm == NULL) nm = "UNKNOWN"; BIO_printf(STDout, "%s - ", nm); } #endif BIO_puts(STDout,SSL_CIPHER_description(c,buf,sizeof buf)); } } ret=0; if (0) { err: SSL_load_error_strings(); ERR_print_errors(bio_err); } end: if (use_supported && sk) sk_SSL_CIPHER_free(sk); if (ctx != NULL) SSL_CTX_free(ctx); if (ssl != NULL) SSL_free(ssl); if (STDout != NULL) BIO_free_all(STDout); apps_shutdown(); OPENSSL_EXIT(ret); } apps/ciphers.c:248: error: UNINITIALIZED_VALUE The value read from sk was never initialized. Showing all 1 steps of the trace apps/ciphers.c:248:3: 246. end: 247. if (use_supported && sk) 248. > sk_SSL_CIPHER_free(sk); 249. if (ctx != NULL) SSL_CTX_free(ctx); 250. if (ssl != NULL) SSL_free(ssl);
https://github.com/openssl/openssl/blob/66f96fe2d519147097c118d4bf60704c69ed0635/apps/ciphers.c/#L248
d2a_code_trace_data_45141
void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) { unsigned long hash; OPENSSL_LH_NODE *nn, **rn; void *ret; lh->error = 0; rn = getrn(lh, data, &hash); if (*rn == NULL) { lh->num_no_delete++; return NULL; } else { nn = *rn; *rn = nn->next; ret = nn->data; OPENSSL_free(nn); lh->num_delete++; } lh->num_items--; if ((lh->num_nodes > MIN_NODES) && (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes))) contract(lh); return ret; } test/handshake_helper.c:1461: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned64 by call to `SSL_set_session`. Showing all 19 steps of the trace test/handshake_helper.c:1396:1: Parameter `server_ctx->sessions->num_items` 1394. * parsing.) 1395. */ 1396. > static HANDSHAKE_RESULT *do_handshake_internal( 1397. SSL_CTX *server_ctx, SSL_CTX *server2_ctx, SSL_CTX *client_ctx, 1398. const SSL_TEST_CTX *test_ctx, const SSL_TEST_EXTRA_CONF *extra, test/handshake_helper.c:1442:10: Call 1440. 1441. /* Setup SSL and buffers; additional configuration happens below. */ 1442. if (!create_peer(&server, server_ctx)) { ^ 1443. TEST_note("creating server context"); 1444. goto err; test/handshake_helper.c:755:1: Parameter `ctx->sessions->num_items` 753. } PEER; 754. 755. > static int create_peer(PEER *peer, SSL_CTX *ctx) 756. { 757. static const int peer_buffer_size = 64 * 1024; test/handshake_helper.c:761:10: Call 759. unsigned char *read_buf = NULL, *write_buf = NULL; 760. 761. if (!TEST_ptr(ssl = SSL_new(ctx)) ^ 762. || !TEST_ptr(write_buf = OPENSSL_zalloc(peer_buffer_size)) 763. || !TEST_ptr(read_buf = OPENSSL_zalloc(peer_buffer_size))) ssl/ssl_lib.c:669:1: Parameter `ctx->sessions->num_items` 667. } 668. 669. > SSL *SSL_new(SSL_CTX *ctx) 670. { 671. SSL *s; test/handshake_helper.c:1461:21: Call 1459. && !TEST_true(SSL_CTX_add_session(server_ctx, 1460. serv_sess_in))) 1461. || !TEST_true(SSL_set_session(client.ssl, session_in))) ^ 1462. goto err; 1463. sess_id_len = 0; ssl/ssl_sess.c:844:1: Parameter `s->session_ctx->sessions->num_items` 842. } 843. 844. > int SSL_set_session(SSL *s, SSL_SESSION *session) 845. { 846. ssl_clear_bad_session(s); ssl/ssl_sess.c:846:5: Call 844. int SSL_set_session(SSL *s, SSL_SESSION *session) 845. { 846. ssl_clear_bad_session(s); ^ 847. if (s->ctx->method != s->method) { 848. if (!SSL_set_ssl_method(s, s->ctx->method)) ssl/ssl_sess.c:1139:1: Parameter `s->session_ctx->sessions->num_items` 1137. } 1138. 1139. > int ssl_clear_bad_session(SSL *s) 1140. { 1141. if ((s->session != NULL) && ssl/ssl_sess.c:1144:9: Call 1142. !(s->shutdown & SSL_SENT_SHUTDOWN) && 1143. !(SSL_in_init(s) || SSL_in_before(s))) { 1144. SSL_CTX_remove_session(s->session_ctx, s->session); ^ 1145. return 1; 1146. } else ssl/ssl_sess.c:757:1: Parameter `ctx->sessions->num_items` 755. } 756. 757. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 758. { 759. return remove_session_lock(ctx, c, 1); ssl/ssl_sess.c:759:12: Call 757. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 758. { 759. return remove_session_lock(ctx, c, 1); ^ 760. } 761. ssl/ssl_sess.c:762:1: Parameter `ctx->sessions->num_items` 760. } 761. 762. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck) 763. { 764. SSL_SESSION *r; ssl/ssl_sess.c:772:17: Call 770. if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) != NULL) { 771. ret = 1; 772. r = lh_SSL_SESSION_delete(ctx->sessions, r); ^ 773. SSL_SESSION_list_remove(ctx, r); 774. } ssl/ssl_locl.h:727:1: Parameter `lh->num_items` 725. } TLSEXT_INDEX; 726. 727. > DEFINE_LHASH_OF(SSL_SESSION); 728. /* Needed in ssl_cert.c */ 729. DEFINE_LHASH_OF(X509_NAME); ssl/ssl_locl.h:727:1: Call 725. } TLSEXT_INDEX; 726. 727. > DEFINE_LHASH_OF(SSL_SESSION); 728. /* Needed in ssl_cert.c */ 729. DEFINE_LHASH_OF(X509_NAME); crypto/lhash/lhash.c:126:1: <LHS trace> 124. } 125. 126. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) 127. { 128. unsigned long hash; crypto/lhash/lhash.c:126:1: Parameter `lh->num_items` 124. } 125. 126. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) 127. { 128. unsigned long hash; crypto/lhash/lhash.c:146:5: Binary operation: ([0, +oo] - 1):unsigned64 by call to `SSL_set_session` 144. } 145. 146. lh->num_items--; ^ 147. if ((lh->num_nodes > MIN_NODES) && 148. (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
https://github.com/openssl/openssl/blob/41145c35bfee8f2b0822288fcb23a807d06d8e89/crypto/lhash/lhash.c/#L146
d2a_code_trace_data_45142
static unsigned constant_time_ge(unsigned a, unsigned b) { a -= b; return DUPLICATE_MSB_TO_ALL(~a); } ssl/d1_pkt.c:710: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [0, 17728]):unsigned32 by call to `dtls1_process_record`. Showing all 11 steps of the trace ssl/d1_pkt.c:584:4: Assignment 582. if (s->packet_length != DTLS1_RT_HEADER_LENGTH) 583. { 584. s->packet_length = 0; ^ 585. goto again; 586. } ssl/d1_pkt.c:710:7: Call 708. } 709. 710. if (!dtls1_process_record(s)) ^ 711. { 712. rr->length = 0; ssl/d1_pkt.c:375:1: Parameter `s->s3->rrec.length` 373. #endif 374. 375. > static int 376. dtls1_process_record(SSL *s) 377. { ssl/d1_pkt.c:470:4: Call 468. * */ 469. mac = mac_tmp; 470. ssl3_cbc_copy_mac(mac_tmp, rr, mac_size, orig_len); ^ 471. rr->length -= mac_size; 472. } ssl/s3_cbc.c:254:1: Parameter `orig_len` 252. #define CBC_MAC_ROTATE_IN_PLACE 253. 254. > void ssl3_cbc_copy_mac(unsigned char* out, 255. const SSL3_RECORD *rec, 256. unsigned md_size,unsigned orig_len) ssl/s3_cbc.c:300:29: Call 298. { 299. unsigned char mac_started = constant_time_ge(i, mac_start); 300. unsigned char mac_ended = constant_time_ge(i, mac_end); ^ 301. unsigned char b = rec->data[i]; 302. rotated_mac[j++] |= b & mac_started & ~mac_ended; ssl/s3_cbc.c:87:1: <LHS trace> 85. 86. /* constant_time_ge returns 0xff if a>=b and 0x00 otherwise. */ 87. > static unsigned constant_time_ge(unsigned a, unsigned b) 88. { 89. a -= b; ssl/s3_cbc.c:87:1: Parameter `a` 85. 86. /* constant_time_ge returns 0xff if a>=b and 0x00 otherwise. */ 87. > static unsigned constant_time_ge(unsigned a, unsigned b) 88. { 89. a -= b; ssl/s3_cbc.c:87:1: <RHS trace> 85. 86. /* constant_time_ge returns 0xff if a>=b and 0x00 otherwise. */ 87. > static unsigned constant_time_ge(unsigned a, unsigned b) 88. { 89. a -= b; ssl/s3_cbc.c:87:1: Parameter `b` 85. 86. /* constant_time_ge returns 0xff if a>=b and 0x00 otherwise. */ 87. > static unsigned constant_time_ge(unsigned a, unsigned b) 88. { 89. a -= b; ssl/s3_cbc.c:89:2: Binary operation: ([0, +oo] - [0, 17728]):unsigned32 by call to `dtls1_process_record` 87. static unsigned constant_time_ge(unsigned a, unsigned b) 88. { 89. a -= b; ^ 90. return DUPLICATE_MSB_TO_ALL(~a); 91. }
https://github.com/openssl/openssl/blob/4af793036f6ef4f0a1078e5d7155426a98d50e37/ssl/s3_cbc.c/#L89
d2a_code_trace_data_45143
static int nsv_parse_NSVf_header(AVFormatContext *s, AVFormatParameters *ap) { NSVContext *nsv = s->priv_data; AVIOContext *pb = s->pb; unsigned int av_unused file_size; unsigned int size; int64_t duration; int strings_size; int table_entries; int table_entries_used; av_dlog(s, "%s()\n", __FUNCTION__); nsv->state = NSV_UNSYNC; size = avio_rl32(pb); if (size < 28) return -1; nsv->NSVf_end = size; file_size = (uint32_t)avio_rl32(pb); av_dlog(s, "NSV NSVf chunk_size %u\n", size); av_dlog(s, "NSV NSVf file_size %u\n", file_size); nsv->duration = duration = avio_rl32(pb); av_dlog(s, "NSV NSVf duration %"PRId64" ms\n", duration); strings_size = avio_rl32(pb); table_entries = avio_rl32(pb); table_entries_used = avio_rl32(pb); av_dlog(s, "NSV NSVf info-strings size: %d, table entries: %d, bis %d\n", strings_size, table_entries, table_entries_used); if (pb->eof_reached) return -1; av_dlog(s, "NSV got header; filepos %"PRId64"\n", avio_tell(pb)); if (strings_size > 0) { char *strings; char *p, *endp; char *token, *value; char quote; p = strings = av_mallocz(strings_size + 1); endp = strings + strings_size; avio_read(pb, strings, strings_size); while (p < endp) { while (*p == ' ') p++; if (p >= endp-2) break; token = p; p = strchr(p, '='); if (!p || p >= endp-2) break; *p++ = '\0'; quote = *p++; value = p; p = strchr(p, quote); if (!p || p >= endp) break; *p++ = '\0'; av_dlog(s, "NSV NSVf INFO: %s='%s'\n", token, value); av_metadata_set2(&s->metadata, token, value, 0); } av_free(strings); } if (pb->eof_reached) return -1; av_dlog(s, "NSV got infos; filepos %"PRId64"\n", avio_tell(pb)); if (table_entries_used > 0) { int i; nsv->index_entries = table_entries_used; if((unsigned)table_entries_used >= UINT_MAX / sizeof(uint32_t)) return -1; nsv->nsvs_file_offset = av_malloc((unsigned)table_entries_used * sizeof(uint32_t)); for(i=0;i<table_entries_used;i++) nsv->nsvs_file_offset[i] = avio_rl32(pb) + size; if(table_entries > table_entries_used && avio_rl32(pb) == MKTAG('T','O','C','2')) { nsv->nsvs_timestamps = av_malloc((unsigned)table_entries_used*sizeof(uint32_t)); for(i=0;i<table_entries_used;i++) { nsv->nsvs_timestamps[i] = avio_rl32(pb); } } } av_dlog(s, "NSV got index; filepos %"PRId64"\n", avio_tell(pb)); #ifdef DEBUG_DUMP_INDEX #define V(v) ((v<0x20 || v > 127)?'.':v) av_dlog(s, "NSV %d INDEX ENTRIES:\n", table_entries); av_dlog(s, "NSV [dataoffset][fileoffset]\n", table_entries); for (i = 0; i < table_entries; i++) { unsigned char b[8]; avio_seek(pb, size + nsv->nsvs_file_offset[i], SEEK_SET); avio_read(pb, b, 8); av_dlog(s, "NSV [0x%08lx][0x%08lx]: %02x %02x %02x %02x %02x %02x %02x %02x" "%c%c%c%c%c%c%c%c\n", nsv->nsvs_file_offset[i], size + nsv->nsvs_file_offset[i], b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7], V(b[0]), V(b[1]), V(b[2]), V(b[3]), V(b[4]), V(b[5]), V(b[6]), V(b[7]) ); } #undef V #endif avio_seek(pb, nsv->base_offset + size, SEEK_SET); if (pb->eof_reached) return -1; nsv->state = NSV_HAS_READ_NSVF; return 0; } libavformat/nsvdec.c:348: error: Null Dereference pointer `nsv->nsvs_file_offset` last assigned on line 345 could be null and is dereferenced at line 348, column 13. libavformat/nsvdec.c:266:1: start of procedure nsv_parse_NSVf_header() 264. } 265. 266. static int nsv_parse_NSVf_header(AVFormatContext *s, AVFormatParameters *ap) ^ 267. { 268. NSVContext *nsv = s->priv_data; libavformat/nsvdec.c:268:5: 266. static int nsv_parse_NSVf_header(AVFormatContext *s, AVFormatParameters *ap) 267. { 268. NSVContext *nsv = s->priv_data; ^ 269. AVIOContext *pb = s->pb; 270. unsigned int av_unused file_size; libavformat/nsvdec.c:269:5: 267. { 268. NSVContext *nsv = s->priv_data; 269. AVIOContext *pb = s->pb; ^ 270. unsigned int av_unused file_size; 271. unsigned int size; libavformat/nsvdec.c:279:5: 277. av_dlog(s, "%s()\n", __FUNCTION__); 278. 279. nsv->state = NSV_UNSYNC; /* in case we fail */ ^ 280. 281. size = avio_rl32(pb); libavformat/nsvdec.c:281:5: 279. nsv->state = NSV_UNSYNC; /* in case we fail */ 280. 281. size = avio_rl32(pb); ^ 282. if (size < 28) 283. return -1; libavformat/aviobuf.c:706:1: start of procedure avio_rl32() 704. } 705. 706. unsigned int avio_rl32(AVIOContext *s) ^ 707. { 708. unsigned int val; libavformat/aviobuf.c:709:5: 707. { 708. unsigned int val; 709. val = avio_rl16(s); ^ 710. val |= avio_rl16(s) << 16; 711. return val; libavformat/aviobuf.c:690:1: start of procedure avio_rl16() 688. } 689. 690. unsigned int avio_rl16(AVIOContext *s) ^ 691. { 692. unsigned int val; libavformat/aviobuf.c:693:5: 691. { 692. unsigned int val; 693. val = avio_r8(s); ^ 694. val |= avio_r8(s) << 8; 695. return val; libavformat/aviobuf.c:600:1: start of procedure avio_r8() 598. 599. /* XXX: put an inline version */ 600. int avio_r8(AVIOContext *s) ^ 601. { 602. if (s->buf_ptr >= s->buf_end) libavformat/aviobuf.c:602:9: Taking false branch 600. int avio_r8(AVIOContext *s) 601. { 602. if (s->buf_ptr >= s->buf_end) ^ 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) libavformat/aviobuf.c:604:9: Taking true branch 602. if (s->buf_ptr >= s->buf_end) 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) ^ 605. return *s->buf_ptr++; 606. return 0; libavformat/aviobuf.c:605:9: 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) 605. return *s->buf_ptr++; ^ 606. return 0; 607. } libavformat/aviobuf.c:607:1: return from a call to avio_r8 605. return *s->buf_ptr++; 606. return 0; 607. } ^ 608. 609. #if FF_API_OLD_AVIO libavformat/aviobuf.c:694:5: 692. unsigned int val; 693. val = avio_r8(s); 694. val |= avio_r8(s) << 8; ^ 695. return val; 696. } libavformat/aviobuf.c:600:1: start of procedure avio_r8() 598. 599. /* XXX: put an inline version */ 600. int avio_r8(AVIOContext *s) ^ 601. { 602. if (s->buf_ptr >= s->buf_end) libavformat/aviobuf.c:602:9: Taking false branch 600. int avio_r8(AVIOContext *s) 601. { 602. if (s->buf_ptr >= s->buf_end) ^ 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) libavformat/aviobuf.c:604:9: Taking true branch 602. if (s->buf_ptr >= s->buf_end) 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) ^ 605. return *s->buf_ptr++; 606. return 0; libavformat/aviobuf.c:605:9: 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) 605. return *s->buf_ptr++; ^ 606. return 0; 607. } libavformat/aviobuf.c:607:1: return from a call to avio_r8 605. return *s->buf_ptr++; 606. return 0; 607. } ^ 608. 609. #if FF_API_OLD_AVIO libavformat/aviobuf.c:695:5: 693. val = avio_r8(s); 694. val |= avio_r8(s) << 8; 695. return val; ^ 696. } 697. libavformat/aviobuf.c:696:1: return from a call to avio_rl16 694. val |= avio_r8(s) << 8; 695. return val; 696. } ^ 697. 698. unsigned int avio_rl24(AVIOContext *s) libavformat/aviobuf.c:710:5: 708. unsigned int val; 709. val = avio_rl16(s); 710. val |= avio_rl16(s) << 16; ^ 711. return val; 712. } libavformat/aviobuf.c:690:1: start of procedure avio_rl16() 688. } 689. 690. unsigned int avio_rl16(AVIOContext *s) ^ 691. { 692. unsigned int val; libavformat/aviobuf.c:693:5: 691. { 692. unsigned int val; 693. val = avio_r8(s); ^ 694. val |= avio_r8(s) << 8; 695. return val; libavformat/aviobuf.c:600:1: start of procedure avio_r8() 598. 599. /* XXX: put an inline version */ 600. int avio_r8(AVIOContext *s) ^ 601. { 602. if (s->buf_ptr >= s->buf_end) libavformat/aviobuf.c:602:9: Taking false branch 600. int avio_r8(AVIOContext *s) 601. { 602. if (s->buf_ptr >= s->buf_end) ^ 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) libavformat/aviobuf.c:604:9: Taking true branch 602. if (s->buf_ptr >= s->buf_end) 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) ^ 605. return *s->buf_ptr++; 606. return 0; libavformat/aviobuf.c:605:9: 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) 605. return *s->buf_ptr++; ^ 606. return 0; 607. } libavformat/aviobuf.c:607:1: return from a call to avio_r8 605. return *s->buf_ptr++; 606. return 0; 607. } ^ 608. 609. #if FF_API_OLD_AVIO libavformat/aviobuf.c:694:5: 692. unsigned int val; 693. val = avio_r8(s); 694. val |= avio_r8(s) << 8; ^ 695. return val; 696. } libavformat/aviobuf.c:600:1: start of procedure avio_r8() 598. 599. /* XXX: put an inline version */ 600. int avio_r8(AVIOContext *s) ^ 601. { 602. if (s->buf_ptr >= s->buf_end) libavformat/aviobuf.c:602:9: Taking false branch 600. int avio_r8(AVIOContext *s) 601. { 602. if (s->buf_ptr >= s->buf_end) ^ 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) libavformat/aviobuf.c:604:9: Taking true branch 602. if (s->buf_ptr >= s->buf_end) 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) ^ 605. return *s->buf_ptr++; 606. return 0; libavformat/aviobuf.c:605:9: 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) 605. return *s->buf_ptr++; ^ 606. return 0; 607. } libavformat/aviobuf.c:607:1: return from a call to avio_r8 605. return *s->buf_ptr++; 606. return 0; 607. } ^ 608. 609. #if FF_API_OLD_AVIO libavformat/aviobuf.c:695:5: 693. val = avio_r8(s); 694. val |= avio_r8(s) << 8; 695. return val; ^ 696. } 697. libavformat/aviobuf.c:696:1: return from a call to avio_rl16 694. val |= avio_r8(s) << 8; 695. return val; 696. } ^ 697. 698. unsigned int avio_rl24(AVIOContext *s) libavformat/aviobuf.c:711:5: 709. val = avio_rl16(s); 710. val |= avio_rl16(s) << 16; 711. return val; ^ 712. } 713. libavformat/aviobuf.c:712:1: return from a call to avio_rl32 710. val |= avio_rl16(s) << 16; 711. return val; 712. } ^ 713. 714. uint64_t avio_rl64(AVIOContext *s) libavformat/nsvdec.c:282:9: Taking false branch 280. 281. size = avio_rl32(pb); 282. if (size < 28) ^ 283. return -1; 284. nsv->NSVf_end = size; libavformat/nsvdec.c:284:5: 282. if (size < 28) 283. return -1; 284. nsv->NSVf_end = size; ^ 285. 286. //s->file_size = (uint32_t)avio_rl32(pb); libavformat/nsvdec.c:287:5: 285. 286. //s->file_size = (uint32_t)avio_rl32(pb); 287. file_size = (uint32_t)avio_rl32(pb); ^ 288. av_dlog(s, "NSV NSVf chunk_size %u\n", size); 289. av_dlog(s, "NSV NSVf file_size %u\n", file_size); libavformat/aviobuf.c:706:1: start of procedure avio_rl32() 704. } 705. 706. unsigned int avio_rl32(AVIOContext *s) ^ 707. { 708. unsigned int val; libavformat/aviobuf.c:709:5: 707. { 708. unsigned int val; 709. val = avio_rl16(s); ^ 710. val |= avio_rl16(s) << 16; 711. return val; libavformat/aviobuf.c:690:1: start of procedure avio_rl16() 688. } 689. 690. unsigned int avio_rl16(AVIOContext *s) ^ 691. { 692. unsigned int val; libavformat/aviobuf.c:693:5: 691. { 692. unsigned int val; 693. val = avio_r8(s); ^ 694. val |= avio_r8(s) << 8; 695. return val; libavformat/aviobuf.c:600:1: start of procedure avio_r8() 598. 599. /* XXX: put an inline version */ 600. int avio_r8(AVIOContext *s) ^ 601. { 602. if (s->buf_ptr >= s->buf_end) libavformat/aviobuf.c:602:9: Taking false branch 600. int avio_r8(AVIOContext *s) 601. { 602. if (s->buf_ptr >= s->buf_end) ^ 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) libavformat/aviobuf.c:604:9: Taking true branch 602. if (s->buf_ptr >= s->buf_end) 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) ^ 605. return *s->buf_ptr++; 606. return 0; libavformat/aviobuf.c:605:9: 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) 605. return *s->buf_ptr++; ^ 606. return 0; 607. } libavformat/aviobuf.c:607:1: return from a call to avio_r8 605. return *s->buf_ptr++; 606. return 0; 607. } ^ 608. 609. #if FF_API_OLD_AVIO libavformat/aviobuf.c:694:5: 692. unsigned int val; 693. val = avio_r8(s); 694. val |= avio_r8(s) << 8; ^ 695. return val; 696. } libavformat/aviobuf.c:600:1: start of procedure avio_r8() 598. 599. /* XXX: put an inline version */ 600. int avio_r8(AVIOContext *s) ^ 601. { 602. if (s->buf_ptr >= s->buf_end) libavformat/aviobuf.c:602:9: Taking false branch 600. int avio_r8(AVIOContext *s) 601. { 602. if (s->buf_ptr >= s->buf_end) ^ 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) libavformat/aviobuf.c:604:9: Taking true branch 602. if (s->buf_ptr >= s->buf_end) 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) ^ 605. return *s->buf_ptr++; 606. return 0; libavformat/aviobuf.c:605:9: 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) 605. return *s->buf_ptr++; ^ 606. return 0; 607. } libavformat/aviobuf.c:607:1: return from a call to avio_r8 605. return *s->buf_ptr++; 606. return 0; 607. } ^ 608. 609. #if FF_API_OLD_AVIO libavformat/aviobuf.c:695:5: 693. val = avio_r8(s); 694. val |= avio_r8(s) << 8; 695. return val; ^ 696. } 697. libavformat/aviobuf.c:696:1: return from a call to avio_rl16 694. val |= avio_r8(s) << 8; 695. return val; 696. } ^ 697. 698. unsigned int avio_rl24(AVIOContext *s) libavformat/aviobuf.c:710:5: 708. unsigned int val; 709. val = avio_rl16(s); 710. val |= avio_rl16(s) << 16; ^ 711. return val; 712. } libavformat/aviobuf.c:690:1: start of procedure avio_rl16() 688. } 689. 690. unsigned int avio_rl16(AVIOContext *s) ^ 691. { 692. unsigned int val; libavformat/aviobuf.c:693:5: 691. { 692. unsigned int val; 693. val = avio_r8(s); ^ 694. val |= avio_r8(s) << 8; 695. return val; libavformat/aviobuf.c:600:1: start of procedure avio_r8() 598. 599. /* XXX: put an inline version */ 600. int avio_r8(AVIOContext *s) ^ 601. { 602. if (s->buf_ptr >= s->buf_end) libavformat/aviobuf.c:602:9: Taking false branch 600. int avio_r8(AVIOContext *s) 601. { 602. if (s->buf_ptr >= s->buf_end) ^ 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) libavformat/aviobuf.c:604:9: Taking true branch 602. if (s->buf_ptr >= s->buf_end) 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) ^ 605. return *s->buf_ptr++; 606. return 0; libavformat/aviobuf.c:605:9: 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) 605. return *s->buf_ptr++; ^ 606. return 0; 607. } libavformat/aviobuf.c:607:1: return from a call to avio_r8 605. return *s->buf_ptr++; 606. return 0; 607. } ^ 608. 609. #if FF_API_OLD_AVIO libavformat/aviobuf.c:694:5: 692. unsigned int val; 693. val = avio_r8(s); 694. val |= avio_r8(s) << 8; ^ 695. return val; 696. } libavformat/aviobuf.c:600:1: start of procedure avio_r8() 598. 599. /* XXX: put an inline version */ 600. int avio_r8(AVIOContext *s) ^ 601. { 602. if (s->buf_ptr >= s->buf_end) libavformat/aviobuf.c:602:9: Taking false branch 600. int avio_r8(AVIOContext *s) 601. { 602. if (s->buf_ptr >= s->buf_end) ^ 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) libavformat/aviobuf.c:604:9: Taking true branch 602. if (s->buf_ptr >= s->buf_end) 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) ^ 605. return *s->buf_ptr++; 606. return 0; libavformat/aviobuf.c:605:9: 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) 605. return *s->buf_ptr++; ^ 606. return 0; 607. } libavformat/aviobuf.c:607:1: return from a call to avio_r8 605. return *s->buf_ptr++; 606. return 0; 607. } ^ 608. 609. #if FF_API_OLD_AVIO libavformat/aviobuf.c:695:5: 693. val = avio_r8(s); 694. val |= avio_r8(s) << 8; 695. return val; ^ 696. } 697. libavformat/aviobuf.c:696:1: return from a call to avio_rl16 694. val |= avio_r8(s) << 8; 695. return val; 696. } ^ 697. 698. unsigned int avio_rl24(AVIOContext *s) libavformat/aviobuf.c:711:5: 709. val = avio_rl16(s); 710. val |= avio_rl16(s) << 16; 711. return val; ^ 712. } 713. libavformat/aviobuf.c:712:1: return from a call to avio_rl32 710. val |= avio_rl16(s) << 16; 711. return val; 712. } ^ 713. 714. uint64_t avio_rl64(AVIOContext *s) libavformat/nsvdec.c:291:5: 289. av_dlog(s, "NSV NSVf file_size %u\n", file_size); 290. 291. nsv->duration = duration = avio_rl32(pb); /* in ms */ ^ 292. av_dlog(s, "NSV NSVf duration %"PRId64" ms\n", duration); 293. // XXX: store it in AVStreams libavformat/aviobuf.c:706:1: start of procedure avio_rl32() 704. } 705. 706. unsigned int avio_rl32(AVIOContext *s) ^ 707. { 708. unsigned int val; libavformat/aviobuf.c:709:5: 707. { 708. unsigned int val; 709. val = avio_rl16(s); ^ 710. val |= avio_rl16(s) << 16; 711. return val; libavformat/aviobuf.c:690:1: start of procedure avio_rl16() 688. } 689. 690. unsigned int avio_rl16(AVIOContext *s) ^ 691. { 692. unsigned int val; libavformat/aviobuf.c:693:5: 691. { 692. unsigned int val; 693. val = avio_r8(s); ^ 694. val |= avio_r8(s) << 8; 695. return val; libavformat/aviobuf.c:600:1: start of procedure avio_r8() 598. 599. /* XXX: put an inline version */ 600. int avio_r8(AVIOContext *s) ^ 601. { 602. if (s->buf_ptr >= s->buf_end) libavformat/aviobuf.c:602:9: Taking false branch 600. int avio_r8(AVIOContext *s) 601. { 602. if (s->buf_ptr >= s->buf_end) ^ 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) libavformat/aviobuf.c:604:9: Taking true branch 602. if (s->buf_ptr >= s->buf_end) 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) ^ 605. return *s->buf_ptr++; 606. return 0; libavformat/aviobuf.c:605:9: 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) 605. return *s->buf_ptr++; ^ 606. return 0; 607. } libavformat/aviobuf.c:607:1: return from a call to avio_r8 605. return *s->buf_ptr++; 606. return 0; 607. } ^ 608. 609. #if FF_API_OLD_AVIO libavformat/aviobuf.c:694:5: 692. unsigned int val; 693. val = avio_r8(s); 694. val |= avio_r8(s) << 8; ^ 695. return val; 696. } libavformat/aviobuf.c:600:1: start of procedure avio_r8() 598. 599. /* XXX: put an inline version */ 600. int avio_r8(AVIOContext *s) ^ 601. { 602. if (s->buf_ptr >= s->buf_end) libavformat/aviobuf.c:602:9: Taking false branch 600. int avio_r8(AVIOContext *s) 601. { 602. if (s->buf_ptr >= s->buf_end) ^ 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) libavformat/aviobuf.c:604:9: Taking true branch 602. if (s->buf_ptr >= s->buf_end) 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) ^ 605. return *s->buf_ptr++; 606. return 0; libavformat/aviobuf.c:605:9: 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) 605. return *s->buf_ptr++; ^ 606. return 0; 607. } libavformat/aviobuf.c:607:1: return from a call to avio_r8 605. return *s->buf_ptr++; 606. return 0; 607. } ^ 608. 609. #if FF_API_OLD_AVIO libavformat/aviobuf.c:695:5: 693. val = avio_r8(s); 694. val |= avio_r8(s) << 8; 695. return val; ^ 696. } 697. libavformat/aviobuf.c:696:1: return from a call to avio_rl16 694. val |= avio_r8(s) << 8; 695. return val; 696. } ^ 697. 698. unsigned int avio_rl24(AVIOContext *s) libavformat/aviobuf.c:710:5: 708. unsigned int val; 709. val = avio_rl16(s); 710. val |= avio_rl16(s) << 16; ^ 711. return val; 712. } libavformat/aviobuf.c:690:1: start of procedure avio_rl16() 688. } 689. 690. unsigned int avio_rl16(AVIOContext *s) ^ 691. { 692. unsigned int val; libavformat/aviobuf.c:693:5: 691. { 692. unsigned int val; 693. val = avio_r8(s); ^ 694. val |= avio_r8(s) << 8; 695. return val; libavformat/aviobuf.c:600:1: start of procedure avio_r8() 598. 599. /* XXX: put an inline version */ 600. int avio_r8(AVIOContext *s) ^ 601. { 602. if (s->buf_ptr >= s->buf_end) libavformat/aviobuf.c:602:9: Taking false branch 600. int avio_r8(AVIOContext *s) 601. { 602. if (s->buf_ptr >= s->buf_end) ^ 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) libavformat/aviobuf.c:604:9: Taking true branch 602. if (s->buf_ptr >= s->buf_end) 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) ^ 605. return *s->buf_ptr++; 606. return 0; libavformat/aviobuf.c:605:9: 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) 605. return *s->buf_ptr++; ^ 606. return 0; 607. } libavformat/aviobuf.c:607:1: return from a call to avio_r8 605. return *s->buf_ptr++; 606. return 0; 607. } ^ 608. 609. #if FF_API_OLD_AVIO libavformat/aviobuf.c:694:5: 692. unsigned int val; 693. val = avio_r8(s); 694. val |= avio_r8(s) << 8; ^ 695. return val; 696. } libavformat/aviobuf.c:600:1: start of procedure avio_r8() 598. 599. /* XXX: put an inline version */ 600. int avio_r8(AVIOContext *s) ^ 601. { 602. if (s->buf_ptr >= s->buf_end) libavformat/aviobuf.c:602:9: Taking false branch 600. int avio_r8(AVIOContext *s) 601. { 602. if (s->buf_ptr >= s->buf_end) ^ 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) libavformat/aviobuf.c:604:9: Taking true branch 602. if (s->buf_ptr >= s->buf_end) 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) ^ 605. return *s->buf_ptr++; 606. return 0; libavformat/aviobuf.c:605:9: 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) 605. return *s->buf_ptr++; ^ 606. return 0; 607. } libavformat/aviobuf.c:607:1: return from a call to avio_r8 605. return *s->buf_ptr++; 606. return 0; 607. } ^ 608. 609. #if FF_API_OLD_AVIO libavformat/aviobuf.c:695:5: 693. val = avio_r8(s); 694. val |= avio_r8(s) << 8; 695. return val; ^ 696. } 697. libavformat/aviobuf.c:696:1: return from a call to avio_rl16 694. val |= avio_r8(s) << 8; 695. return val; 696. } ^ 697. 698. unsigned int avio_rl24(AVIOContext *s) libavformat/aviobuf.c:711:5: 709. val = avio_rl16(s); 710. val |= avio_rl16(s) << 16; 711. return val; ^ 712. } 713. libavformat/aviobuf.c:712:1: return from a call to avio_rl32 710. val |= avio_rl16(s) << 16; 711. return val; 712. } ^ 713. 714. uint64_t avio_rl64(AVIOContext *s) libavformat/nsvdec.c:295:5: 293. // XXX: store it in AVStreams 294. 295. strings_size = avio_rl32(pb); ^ 296. table_entries = avio_rl32(pb); 297. table_entries_used = avio_rl32(pb); libavformat/aviobuf.c:706:1: start of procedure avio_rl32() 704. } 705. 706. unsigned int avio_rl32(AVIOContext *s) ^ 707. { 708. unsigned int val; libavformat/aviobuf.c:709:5: 707. { 708. unsigned int val; 709. val = avio_rl16(s); ^ 710. val |= avio_rl16(s) << 16; 711. return val; libavformat/aviobuf.c:690:1: start of procedure avio_rl16() 688. } 689. 690. unsigned int avio_rl16(AVIOContext *s) ^ 691. { 692. unsigned int val; libavformat/aviobuf.c:693:5: 691. { 692. unsigned int val; 693. val = avio_r8(s); ^ 694. val |= avio_r8(s) << 8; 695. return val; libavformat/aviobuf.c:600:1: start of procedure avio_r8() 598. 599. /* XXX: put an inline version */ 600. int avio_r8(AVIOContext *s) ^ 601. { 602. if (s->buf_ptr >= s->buf_end) libavformat/aviobuf.c:602:9: Taking false branch 600. int avio_r8(AVIOContext *s) 601. { 602. if (s->buf_ptr >= s->buf_end) ^ 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) libavformat/aviobuf.c:604:9: Taking true branch 602. if (s->buf_ptr >= s->buf_end) 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) ^ 605. return *s->buf_ptr++; 606. return 0; libavformat/aviobuf.c:605:9: 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) 605. return *s->buf_ptr++; ^ 606. return 0; 607. } libavformat/aviobuf.c:607:1: return from a call to avio_r8 605. return *s->buf_ptr++; 606. return 0; 607. } ^ 608. 609. #if FF_API_OLD_AVIO libavformat/aviobuf.c:694:5: 692. unsigned int val; 693. val = avio_r8(s); 694. val |= avio_r8(s) << 8; ^ 695. return val; 696. } libavformat/aviobuf.c:600:1: start of procedure avio_r8() 598. 599. /* XXX: put an inline version */ 600. int avio_r8(AVIOContext *s) ^ 601. { 602. if (s->buf_ptr >= s->buf_end) libavformat/aviobuf.c:602:9: Taking false branch 600. int avio_r8(AVIOContext *s) 601. { 602. if (s->buf_ptr >= s->buf_end) ^ 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) libavformat/aviobuf.c:604:9: Taking true branch 602. if (s->buf_ptr >= s->buf_end) 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) ^ 605. return *s->buf_ptr++; 606. return 0; libavformat/aviobuf.c:605:9: 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) 605. return *s->buf_ptr++; ^ 606. return 0; 607. } libavformat/aviobuf.c:607:1: return from a call to avio_r8 605. return *s->buf_ptr++; 606. return 0; 607. } ^ 608. 609. #if FF_API_OLD_AVIO libavformat/aviobuf.c:695:5: 693. val = avio_r8(s); 694. val |= avio_r8(s) << 8; 695. return val; ^ 696. } 697. libavformat/aviobuf.c:696:1: return from a call to avio_rl16 694. val |= avio_r8(s) << 8; 695. return val; 696. } ^ 697. 698. unsigned int avio_rl24(AVIOContext *s) libavformat/aviobuf.c:710:5: 708. unsigned int val; 709. val = avio_rl16(s); 710. val |= avio_rl16(s) << 16; ^ 711. return val; 712. } libavformat/aviobuf.c:690:1: start of procedure avio_rl16() 688. } 689. 690. unsigned int avio_rl16(AVIOContext *s) ^ 691. { 692. unsigned int val; libavformat/aviobuf.c:693:5: 691. { 692. unsigned int val; 693. val = avio_r8(s); ^ 694. val |= avio_r8(s) << 8; 695. return val; libavformat/aviobuf.c:600:1: start of procedure avio_r8() 598. 599. /* XXX: put an inline version */ 600. int avio_r8(AVIOContext *s) ^ 601. { 602. if (s->buf_ptr >= s->buf_end) libavformat/aviobuf.c:602:9: Taking false branch 600. int avio_r8(AVIOContext *s) 601. { 602. if (s->buf_ptr >= s->buf_end) ^ 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) libavformat/aviobuf.c:604:9: Taking true branch 602. if (s->buf_ptr >= s->buf_end) 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) ^ 605. return *s->buf_ptr++; 606. return 0; libavformat/aviobuf.c:605:9: 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) 605. return *s->buf_ptr++; ^ 606. return 0; 607. } libavformat/aviobuf.c:607:1: return from a call to avio_r8 605. return *s->buf_ptr++; 606. return 0; 607. } ^ 608. 609. #if FF_API_OLD_AVIO libavformat/aviobuf.c:694:5: 692. unsigned int val; 693. val = avio_r8(s); 694. val |= avio_r8(s) << 8; ^ 695. return val; 696. } libavformat/aviobuf.c:600:1: start of procedure avio_r8() 598. 599. /* XXX: put an inline version */ 600. int avio_r8(AVIOContext *s) ^ 601. { 602. if (s->buf_ptr >= s->buf_end) libavformat/aviobuf.c:602:9: Taking false branch 600. int avio_r8(AVIOContext *s) 601. { 602. if (s->buf_ptr >= s->buf_end) ^ 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) libavformat/aviobuf.c:604:9: Taking true branch 602. if (s->buf_ptr >= s->buf_end) 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) ^ 605. return *s->buf_ptr++; 606. return 0; libavformat/aviobuf.c:605:9: 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) 605. return *s->buf_ptr++; ^ 606. return 0; 607. } libavformat/aviobuf.c:607:1: return from a call to avio_r8 605. return *s->buf_ptr++; 606. return 0; 607. } ^ 608. 609. #if FF_API_OLD_AVIO libavformat/aviobuf.c:695:5: 693. val = avio_r8(s); 694. val |= avio_r8(s) << 8; 695. return val; ^ 696. } 697. libavformat/aviobuf.c:696:1: return from a call to avio_rl16 694. val |= avio_r8(s) << 8; 695. return val; 696. } ^ 697. 698. unsigned int avio_rl24(AVIOContext *s) libavformat/aviobuf.c:711:5: 709. val = avio_rl16(s); 710. val |= avio_rl16(s) << 16; 711. return val; ^ 712. } 713. libavformat/aviobuf.c:712:1: return from a call to avio_rl32 710. val |= avio_rl16(s) << 16; 711. return val; 712. } ^ 713. 714. uint64_t avio_rl64(AVIOContext *s) libavformat/nsvdec.c:296:5: 294. 295. strings_size = avio_rl32(pb); 296. table_entries = avio_rl32(pb); ^ 297. table_entries_used = avio_rl32(pb); 298. av_dlog(s, "NSV NSVf info-strings size: %d, table entries: %d, bis %d\n", libavformat/aviobuf.c:706:1: start of procedure avio_rl32() 704. } 705. 706. unsigned int avio_rl32(AVIOContext *s) ^ 707. { 708. unsigned int val; libavformat/aviobuf.c:709:5: 707. { 708. unsigned int val; 709. val = avio_rl16(s); ^ 710. val |= avio_rl16(s) << 16; 711. return val; libavformat/aviobuf.c:690:1: start of procedure avio_rl16() 688. } 689. 690. unsigned int avio_rl16(AVIOContext *s) ^ 691. { 692. unsigned int val; libavformat/aviobuf.c:693:5: 691. { 692. unsigned int val; 693. val = avio_r8(s); ^ 694. val |= avio_r8(s) << 8; 695. return val; libavformat/aviobuf.c:600:1: start of procedure avio_r8() 598. 599. /* XXX: put an inline version */ 600. int avio_r8(AVIOContext *s) ^ 601. { 602. if (s->buf_ptr >= s->buf_end) libavformat/aviobuf.c:602:9: Taking false branch 600. int avio_r8(AVIOContext *s) 601. { 602. if (s->buf_ptr >= s->buf_end) ^ 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) libavformat/aviobuf.c:604:9: Taking true branch 602. if (s->buf_ptr >= s->buf_end) 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) ^ 605. return *s->buf_ptr++; 606. return 0; libavformat/aviobuf.c:605:9: 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) 605. return *s->buf_ptr++; ^ 606. return 0; 607. } libavformat/aviobuf.c:607:1: return from a call to avio_r8 605. return *s->buf_ptr++; 606. return 0; 607. } ^ 608. 609. #if FF_API_OLD_AVIO libavformat/aviobuf.c:694:5: 692. unsigned int val; 693. val = avio_r8(s); 694. val |= avio_r8(s) << 8; ^ 695. return val; 696. } libavformat/aviobuf.c:600:1: start of procedure avio_r8() 598. 599. /* XXX: put an inline version */ 600. int avio_r8(AVIOContext *s) ^ 601. { 602. if (s->buf_ptr >= s->buf_end) libavformat/aviobuf.c:602:9: Taking false branch 600. int avio_r8(AVIOContext *s) 601. { 602. if (s->buf_ptr >= s->buf_end) ^ 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) libavformat/aviobuf.c:604:9: Taking true branch 602. if (s->buf_ptr >= s->buf_end) 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) ^ 605. return *s->buf_ptr++; 606. return 0; libavformat/aviobuf.c:605:9: 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) 605. return *s->buf_ptr++; ^ 606. return 0; 607. } libavformat/aviobuf.c:607:1: return from a call to avio_r8 605. return *s->buf_ptr++; 606. return 0; 607. } ^ 608. 609. #if FF_API_OLD_AVIO libavformat/aviobuf.c:695:5: 693. val = avio_r8(s); 694. val |= avio_r8(s) << 8; 695. return val; ^ 696. } 697. libavformat/aviobuf.c:696:1: return from a call to avio_rl16 694. val |= avio_r8(s) << 8; 695. return val; 696. } ^ 697. 698. unsigned int avio_rl24(AVIOContext *s) libavformat/aviobuf.c:710:5: 708. unsigned int val; 709. val = avio_rl16(s); 710. val |= avio_rl16(s) << 16; ^ 711. return val; 712. } libavformat/aviobuf.c:690:1: start of procedure avio_rl16() 688. } 689. 690. unsigned int avio_rl16(AVIOContext *s) ^ 691. { 692. unsigned int val; libavformat/aviobuf.c:693:5: 691. { 692. unsigned int val; 693. val = avio_r8(s); ^ 694. val |= avio_r8(s) << 8; 695. return val; libavformat/aviobuf.c:600:1: start of procedure avio_r8() 598. 599. /* XXX: put an inline version */ 600. int avio_r8(AVIOContext *s) ^ 601. { 602. if (s->buf_ptr >= s->buf_end) libavformat/aviobuf.c:602:9: Taking false branch 600. int avio_r8(AVIOContext *s) 601. { 602. if (s->buf_ptr >= s->buf_end) ^ 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) libavformat/aviobuf.c:604:9: Taking true branch 602. if (s->buf_ptr >= s->buf_end) 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) ^ 605. return *s->buf_ptr++; 606. return 0; libavformat/aviobuf.c:605:9: 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) 605. return *s->buf_ptr++; ^ 606. return 0; 607. } libavformat/aviobuf.c:607:1: return from a call to avio_r8 605. return *s->buf_ptr++; 606. return 0; 607. } ^ 608. 609. #if FF_API_OLD_AVIO libavformat/aviobuf.c:694:5: 692. unsigned int val; 693. val = avio_r8(s); 694. val |= avio_r8(s) << 8; ^ 695. return val; 696. } libavformat/aviobuf.c:600:1: start of procedure avio_r8() 598. 599. /* XXX: put an inline version */ 600. int avio_r8(AVIOContext *s) ^ 601. { 602. if (s->buf_ptr >= s->buf_end) libavformat/aviobuf.c:602:9: Taking false branch 600. int avio_r8(AVIOContext *s) 601. { 602. if (s->buf_ptr >= s->buf_end) ^ 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) libavformat/aviobuf.c:604:9: Taking true branch 602. if (s->buf_ptr >= s->buf_end) 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) ^ 605. return *s->buf_ptr++; 606. return 0; libavformat/aviobuf.c:605:9: 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) 605. return *s->buf_ptr++; ^ 606. return 0; 607. } libavformat/aviobuf.c:607:1: return from a call to avio_r8 605. return *s->buf_ptr++; 606. return 0; 607. } ^ 608. 609. #if FF_API_OLD_AVIO libavformat/aviobuf.c:695:5: 693. val = avio_r8(s); 694. val |= avio_r8(s) << 8; 695. return val; ^ 696. } 697. libavformat/aviobuf.c:696:1: return from a call to avio_rl16 694. val |= avio_r8(s) << 8; 695. return val; 696. } ^ 697. 698. unsigned int avio_rl24(AVIOContext *s) libavformat/aviobuf.c:711:5: 709. val = avio_rl16(s); 710. val |= avio_rl16(s) << 16; 711. return val; ^ 712. } 713. libavformat/aviobuf.c:712:1: return from a call to avio_rl32 710. val |= avio_rl16(s) << 16; 711. return val; 712. } ^ 713. 714. uint64_t avio_rl64(AVIOContext *s) libavformat/nsvdec.c:297:5: 295. strings_size = avio_rl32(pb); 296. table_entries = avio_rl32(pb); 297. table_entries_used = avio_rl32(pb); ^ 298. av_dlog(s, "NSV NSVf info-strings size: %d, table entries: %d, bis %d\n", 299. strings_size, table_entries, table_entries_used); libavformat/aviobuf.c:706:1: start of procedure avio_rl32() 704. } 705. 706. unsigned int avio_rl32(AVIOContext *s) ^ 707. { 708. unsigned int val; libavformat/aviobuf.c:709:5: 707. { 708. unsigned int val; 709. val = avio_rl16(s); ^ 710. val |= avio_rl16(s) << 16; 711. return val; libavformat/aviobuf.c:690:1: start of procedure avio_rl16() 688. } 689. 690. unsigned int avio_rl16(AVIOContext *s) ^ 691. { 692. unsigned int val; libavformat/aviobuf.c:693:5: 691. { 692. unsigned int val; 693. val = avio_r8(s); ^ 694. val |= avio_r8(s) << 8; 695. return val; libavformat/aviobuf.c:600:1: start of procedure avio_r8() 598. 599. /* XXX: put an inline version */ 600. int avio_r8(AVIOContext *s) ^ 601. { 602. if (s->buf_ptr >= s->buf_end) libavformat/aviobuf.c:602:9: Taking false branch 600. int avio_r8(AVIOContext *s) 601. { 602. if (s->buf_ptr >= s->buf_end) ^ 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) libavformat/aviobuf.c:604:9: Taking true branch 602. if (s->buf_ptr >= s->buf_end) 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) ^ 605. return *s->buf_ptr++; 606. return 0; libavformat/aviobuf.c:605:9: 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) 605. return *s->buf_ptr++; ^ 606. return 0; 607. } libavformat/aviobuf.c:607:1: return from a call to avio_r8 605. return *s->buf_ptr++; 606. return 0; 607. } ^ 608. 609. #if FF_API_OLD_AVIO libavformat/aviobuf.c:694:5: 692. unsigned int val; 693. val = avio_r8(s); 694. val |= avio_r8(s) << 8; ^ 695. return val; 696. } libavformat/aviobuf.c:600:1: start of procedure avio_r8() 598. 599. /* XXX: put an inline version */ 600. int avio_r8(AVIOContext *s) ^ 601. { 602. if (s->buf_ptr >= s->buf_end) libavformat/aviobuf.c:602:9: Taking false branch 600. int avio_r8(AVIOContext *s) 601. { 602. if (s->buf_ptr >= s->buf_end) ^ 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) libavformat/aviobuf.c:604:9: Taking true branch 602. if (s->buf_ptr >= s->buf_end) 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) ^ 605. return *s->buf_ptr++; 606. return 0; libavformat/aviobuf.c:605:9: 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) 605. return *s->buf_ptr++; ^ 606. return 0; 607. } libavformat/aviobuf.c:607:1: return from a call to avio_r8 605. return *s->buf_ptr++; 606. return 0; 607. } ^ 608. 609. #if FF_API_OLD_AVIO libavformat/aviobuf.c:695:5: 693. val = avio_r8(s); 694. val |= avio_r8(s) << 8; 695. return val; ^ 696. } 697. libavformat/aviobuf.c:696:1: return from a call to avio_rl16 694. val |= avio_r8(s) << 8; 695. return val; 696. } ^ 697. 698. unsigned int avio_rl24(AVIOContext *s) libavformat/aviobuf.c:710:5: 708. unsigned int val; 709. val = avio_rl16(s); 710. val |= avio_rl16(s) << 16; ^ 711. return val; 712. } libavformat/aviobuf.c:690:1: start of procedure avio_rl16() 688. } 689. 690. unsigned int avio_rl16(AVIOContext *s) ^ 691. { 692. unsigned int val; libavformat/aviobuf.c:693:5: 691. { 692. unsigned int val; 693. val = avio_r8(s); ^ 694. val |= avio_r8(s) << 8; 695. return val; libavformat/aviobuf.c:600:1: start of procedure avio_r8() 598. 599. /* XXX: put an inline version */ 600. int avio_r8(AVIOContext *s) ^ 601. { 602. if (s->buf_ptr >= s->buf_end) libavformat/aviobuf.c:602:9: Taking false branch 600. int avio_r8(AVIOContext *s) 601. { 602. if (s->buf_ptr >= s->buf_end) ^ 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) libavformat/aviobuf.c:604:9: Taking true branch 602. if (s->buf_ptr >= s->buf_end) 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) ^ 605. return *s->buf_ptr++; 606. return 0; libavformat/aviobuf.c:605:9: 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) 605. return *s->buf_ptr++; ^ 606. return 0; 607. } libavformat/aviobuf.c:607:1: return from a call to avio_r8 605. return *s->buf_ptr++; 606. return 0; 607. } ^ 608. 609. #if FF_API_OLD_AVIO libavformat/aviobuf.c:694:5: 692. unsigned int val; 693. val = avio_r8(s); 694. val |= avio_r8(s) << 8; ^ 695. return val; 696. } libavformat/aviobuf.c:600:1: start of procedure avio_r8() 598. 599. /* XXX: put an inline version */ 600. int avio_r8(AVIOContext *s) ^ 601. { 602. if (s->buf_ptr >= s->buf_end) libavformat/aviobuf.c:602:9: Taking false branch 600. int avio_r8(AVIOContext *s) 601. { 602. if (s->buf_ptr >= s->buf_end) ^ 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) libavformat/aviobuf.c:604:9: Taking true branch 602. if (s->buf_ptr >= s->buf_end) 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) ^ 605. return *s->buf_ptr++; 606. return 0; libavformat/aviobuf.c:605:9: 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) 605. return *s->buf_ptr++; ^ 606. return 0; 607. } libavformat/aviobuf.c:607:1: return from a call to avio_r8 605. return *s->buf_ptr++; 606. return 0; 607. } ^ 608. 609. #if FF_API_OLD_AVIO libavformat/aviobuf.c:695:5: 693. val = avio_r8(s); 694. val |= avio_r8(s) << 8; 695. return val; ^ 696. } 697. libavformat/aviobuf.c:696:1: return from a call to avio_rl16 694. val |= avio_r8(s) << 8; 695. return val; 696. } ^ 697. 698. unsigned int avio_rl24(AVIOContext *s) libavformat/aviobuf.c:711:5: 709. val = avio_rl16(s); 710. val |= avio_rl16(s) << 16; 711. return val; ^ 712. } 713. libavformat/aviobuf.c:712:1: return from a call to avio_rl32 710. val |= avio_rl16(s) << 16; 711. return val; 712. } ^ 713. 714. uint64_t avio_rl64(AVIOContext *s) libavformat/nsvdec.c:300:9: Taking false branch 298. av_dlog(s, "NSV NSVf info-strings size: %d, table entries: %d, bis %d\n", 299. strings_size, table_entries, table_entries_used); 300. if (pb->eof_reached) ^ 301. return -1; 302. libavformat/nsvdec.c:305:9: Taking false branch 303. av_dlog(s, "NSV got header; filepos %"PRId64"\n", avio_tell(pb)); 304. 305. if (strings_size > 0) { ^ 306. char *strings; /* last byte will be '\0' to play safe with str*() */ 307. char *p, *endp; libavformat/nsvdec.c:335:9: Taking false branch 333. av_free(strings); 334. } 335. if (pb->eof_reached) ^ 336. return -1; 337. libavformat/nsvdec.c:340:9: Taking true branch 338. av_dlog(s, "NSV got infos; filepos %"PRId64"\n", avio_tell(pb)); 339. 340. if (table_entries_used > 0) { ^ 341. int i; 342. nsv->index_entries = table_entries_used; libavformat/nsvdec.c:342:9: 340. if (table_entries_used > 0) { 341. int i; 342. nsv->index_entries = table_entries_used; ^ 343. if((unsigned)table_entries_used >= UINT_MAX / sizeof(uint32_t)) 344. return -1; libavformat/nsvdec.c:343:12: Taking false branch 341. int i; 342. nsv->index_entries = table_entries_used; 343. if((unsigned)table_entries_used >= UINT_MAX / sizeof(uint32_t)) ^ 344. return -1; 345. nsv->nsvs_file_offset = av_malloc((unsigned)table_entries_used * sizeof(uint32_t)); libavformat/nsvdec.c:345:9: 343. if((unsigned)table_entries_used >= UINT_MAX / sizeof(uint32_t)) 344. return -1; 345. nsv->nsvs_file_offset = av_malloc((unsigned)table_entries_used * sizeof(uint32_t)); ^ 346. 347. for(i=0;i<table_entries_used;i++) 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) libavformat/nsvdec.c:347:13: 345. nsv->nsvs_file_offset = av_malloc((unsigned)table_entries_used * sizeof(uint32_t)); 346. 347. for(i=0;i<table_entries_used;i++) ^ 348. nsv->nsvs_file_offset[i] = avio_rl32(pb) + size; 349. libavformat/nsvdec.c:347:17: Loop condition is true. Entering loop body 345. nsv->nsvs_file_offset = av_malloc((unsigned)table_entries_used * sizeof(uint32_t)); 346. 347. for(i=0;i<table_entries_used;i++) ^ 348. nsv->nsvs_file_offset[i] = avio_rl32(pb) + size; 349. libavformat/nsvdec.c:348:13: 346. 347. for(i=0;i<table_entries_used;i++) 348. nsv->nsvs_file_offset[i] = avio_rl32(pb) + size; ^ 349. 350. if(table_entries > table_entries_used && libavformat/aviobuf.c:706:1: start of procedure avio_rl32() 704. } 705. 706. unsigned int avio_rl32(AVIOContext *s) ^ 707. { 708. unsigned int val; libavformat/aviobuf.c:709:5: 707. { 708. unsigned int val; 709. val = avio_rl16(s); ^ 710. val |= avio_rl16(s) << 16; 711. return val; libavformat/aviobuf.c:690:1: start of procedure avio_rl16() 688. } 689. 690. unsigned int avio_rl16(AVIOContext *s) ^ 691. { 692. unsigned int val; libavformat/aviobuf.c:693:5: 691. { 692. unsigned int val; 693. val = avio_r8(s); ^ 694. val |= avio_r8(s) << 8; 695. return val; libavformat/aviobuf.c:600:1: start of procedure avio_r8() 598. 599. /* XXX: put an inline version */ 600. int avio_r8(AVIOContext *s) ^ 601. { 602. if (s->buf_ptr >= s->buf_end) libavformat/aviobuf.c:602:9: Taking false branch 600. int avio_r8(AVIOContext *s) 601. { 602. if (s->buf_ptr >= s->buf_end) ^ 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) libavformat/aviobuf.c:604:9: Taking true branch 602. if (s->buf_ptr >= s->buf_end) 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) ^ 605. return *s->buf_ptr++; 606. return 0; libavformat/aviobuf.c:605:9: 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) 605. return *s->buf_ptr++; ^ 606. return 0; 607. } libavformat/aviobuf.c:607:1: return from a call to avio_r8 605. return *s->buf_ptr++; 606. return 0; 607. } ^ 608. 609. #if FF_API_OLD_AVIO libavformat/aviobuf.c:694:5: 692. unsigned int val; 693. val = avio_r8(s); 694. val |= avio_r8(s) << 8; ^ 695. return val; 696. } libavformat/aviobuf.c:600:1: start of procedure avio_r8() 598. 599. /* XXX: put an inline version */ 600. int avio_r8(AVIOContext *s) ^ 601. { 602. if (s->buf_ptr >= s->buf_end) libavformat/aviobuf.c:602:9: Taking false branch 600. int avio_r8(AVIOContext *s) 601. { 602. if (s->buf_ptr >= s->buf_end) ^ 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) libavformat/aviobuf.c:604:9: Taking true branch 602. if (s->buf_ptr >= s->buf_end) 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) ^ 605. return *s->buf_ptr++; 606. return 0; libavformat/aviobuf.c:605:9: 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) 605. return *s->buf_ptr++; ^ 606. return 0; 607. } libavformat/aviobuf.c:607:1: return from a call to avio_r8 605. return *s->buf_ptr++; 606. return 0; 607. } ^ 608. 609. #if FF_API_OLD_AVIO libavformat/aviobuf.c:695:5: 693. val = avio_r8(s); 694. val |= avio_r8(s) << 8; 695. return val; ^ 696. } 697. libavformat/aviobuf.c:696:1: return from a call to avio_rl16 694. val |= avio_r8(s) << 8; 695. return val; 696. } ^ 697. 698. unsigned int avio_rl24(AVIOContext *s) libavformat/aviobuf.c:710:5: 708. unsigned int val; 709. val = avio_rl16(s); 710. val |= avio_rl16(s) << 16; ^ 711. return val; 712. } libavformat/aviobuf.c:690:1: start of procedure avio_rl16() 688. } 689. 690. unsigned int avio_rl16(AVIOContext *s) ^ 691. { 692. unsigned int val; libavformat/aviobuf.c:693:5: 691. { 692. unsigned int val; 693. val = avio_r8(s); ^ 694. val |= avio_r8(s) << 8; 695. return val; libavformat/aviobuf.c:600:1: start of procedure avio_r8() 598. 599. /* XXX: put an inline version */ 600. int avio_r8(AVIOContext *s) ^ 601. { 602. if (s->buf_ptr >= s->buf_end) libavformat/aviobuf.c:602:9: Taking false branch 600. int avio_r8(AVIOContext *s) 601. { 602. if (s->buf_ptr >= s->buf_end) ^ 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) libavformat/aviobuf.c:604:9: Taking true branch 602. if (s->buf_ptr >= s->buf_end) 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) ^ 605. return *s->buf_ptr++; 606. return 0; libavformat/aviobuf.c:605:9: 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) 605. return *s->buf_ptr++; ^ 606. return 0; 607. } libavformat/aviobuf.c:607:1: return from a call to avio_r8 605. return *s->buf_ptr++; 606. return 0; 607. } ^ 608. 609. #if FF_API_OLD_AVIO libavformat/aviobuf.c:694:5: 692. unsigned int val; 693. val = avio_r8(s); 694. val |= avio_r8(s) << 8; ^ 695. return val; 696. } libavformat/aviobuf.c:600:1: start of procedure avio_r8() 598. 599. /* XXX: put an inline version */ 600. int avio_r8(AVIOContext *s) ^ 601. { 602. if (s->buf_ptr >= s->buf_end) libavformat/aviobuf.c:602:9: Taking false branch 600. int avio_r8(AVIOContext *s) 601. { 602. if (s->buf_ptr >= s->buf_end) ^ 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) libavformat/aviobuf.c:604:9: Taking true branch 602. if (s->buf_ptr >= s->buf_end) 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) ^ 605. return *s->buf_ptr++; 606. return 0; libavformat/aviobuf.c:605:9: 603. fill_buffer(s); 604. if (s->buf_ptr < s->buf_end) 605. return *s->buf_ptr++; ^ 606. return 0; 607. } libavformat/aviobuf.c:607:1: return from a call to avio_r8 605. return *s->buf_ptr++; 606. return 0; 607. } ^ 608. 609. #if FF_API_OLD_AVIO libavformat/aviobuf.c:695:5: 693. val = avio_r8(s); 694. val |= avio_r8(s) << 8; 695. return val; ^ 696. } 697. libavformat/aviobuf.c:696:1: return from a call to avio_rl16 694. val |= avio_r8(s) << 8; 695. return val; 696. } ^ 697. 698. unsigned int avio_rl24(AVIOContext *s) libavformat/aviobuf.c:711:5: 709. val = avio_rl16(s); 710. val |= avio_rl16(s) << 16; 711. return val; ^ 712. } 713. libavformat/aviobuf.c:712:1: return from a call to avio_rl32 710. val |= avio_rl16(s) << 16; 711. return val; 712. } ^ 713. 714. uint64_t avio_rl64(AVIOContext *s)
https://github.com/libav/libav/blob/1674bd2abe877b857f1be12b152e4ec496307963/libavformat/nsvdec.c/#L348
d2a_code_trace_data_45144
static void doall_util_fn(OPENSSL_LHASH *lh, int use_arg, OPENSSL_LH_DOALL_FUNC func, OPENSSL_LH_DOALL_FUNCARG func_arg, void *arg) { int i; OPENSSL_LH_NODE *a, *n; if (lh == NULL) return; for (i = lh->num_nodes - 1; i >= 0; i--) { a = lh->b[i]; while (a != NULL) { n = a->next; if (use_arg) func_arg(a->data, arg); else func(a->data); a = n; } } } ssl/ssl_lib.c:3421: error: INTEGER_OVERFLOW_L2 ([0, 1+max(0, `s->session_ctx->sessions->num_nodes`)] - 1):unsigned32 by call to `SSL_CTX_flush_sessions`. Showing all 11 steps of the trace ssl/ssl_lib.c:3354:1: Parameter `s->session_ctx->sessions->num_nodes` 3352. } 3353. 3354. > void ssl_update_cache(SSL *s, int mode) 3355. { 3356. int i; ssl/ssl_lib.c:3421:13: Call 3419. stat = &s->session_ctx->stats.sess_accept_good; 3420. if ((tsan_load(stat) & 0xff) == 0xff) 3421. SSL_CTX_flush_sessions(s->session_ctx, (unsigned long)time(NULL)); ^ 3422. } 3423. } ssl/ssl_sess.c:1106:1: Parameter `s->sessions->num_nodes` 1104. IMPLEMENT_LHASH_DOALL_ARG(SSL_SESSION, TIMEOUT_PARAM); 1105. 1106. > void SSL_CTX_flush_sessions(SSL_CTX *s, long t) 1107. { 1108. unsigned long i; ssl/ssl_sess.c:1119:5: Call 1117. i = lh_SSL_SESSION_get_down_load(s->sessions); 1118. lh_SSL_SESSION_set_down_load(s->sessions, 0); 1119. lh_SSL_SESSION_doall_TIMEOUT_PARAM(tp.cache, timeout_cb, &tp); ^ 1120. lh_SSL_SESSION_set_down_load(s->sessions, i); 1121. CRYPTO_THREAD_unlock(s->lock); ssl/ssl_sess.c:1104:1: Parameter `lh->num_nodes` 1102. } 1103. 1104. > IMPLEMENT_LHASH_DOALL_ARG(SSL_SESSION, TIMEOUT_PARAM); 1105. 1106. void SSL_CTX_flush_sessions(SSL_CTX *s, long t) ssl/ssl_sess.c:1104:1: Call 1102. } 1103. 1104. > IMPLEMENT_LHASH_DOALL_ARG(SSL_SESSION, TIMEOUT_PARAM); 1105. 1106. void SSL_CTX_flush_sessions(SSL_CTX *s, long t) crypto/lhash/lhash.c:207:1: Parameter `lh->num_nodes` 205. } 206. 207. > void OPENSSL_LH_doall_arg(OPENSSL_LHASH *lh, OPENSSL_LH_DOALL_FUNCARG func, void *arg) 208. { 209. doall_util_fn(lh, 1, (OPENSSL_LH_DOALL_FUNC)0, func, arg); crypto/lhash/lhash.c:209:5: Call 207. void OPENSSL_LH_doall_arg(OPENSSL_LHASH *lh, OPENSSL_LH_DOALL_FUNCARG func, void *arg) 208. { 209. doall_util_fn(lh, 1, (OPENSSL_LH_DOALL_FUNC)0, func, arg); ^ 210. } 211. crypto/lhash/lhash.c:175:1: <LHS trace> 173. } 174. 175. > static void doall_util_fn(OPENSSL_LHASH *lh, int use_arg, 176. OPENSSL_LH_DOALL_FUNC func, 177. OPENSSL_LH_DOALL_FUNCARG func_arg, void *arg) crypto/lhash/lhash.c:175:1: Parameter `lh->num_nodes` 173. } 174. 175. > static void doall_util_fn(OPENSSL_LHASH *lh, int use_arg, 176. OPENSSL_LH_DOALL_FUNC func, 177. OPENSSL_LH_DOALL_FUNCARG func_arg, void *arg) crypto/lhash/lhash.c:189:10: Binary operation: ([0, 1+max(0, s->session_ctx->sessions->num_nodes)] - 1):unsigned32 by call to `SSL_CTX_flush_sessions` 187. * memory leaks otherwise 188. */ 189. for (i = lh->num_nodes - 1; i >= 0; i--) { ^ 190. a = lh->b[i]; 191. while (a != NULL) {
https://github.com/openssl/openssl/blob/b5ee517794cf546dc7e3d5a82b400955a7381053/crypto/lhash/lhash.c/#L189
d2a_code_trace_data_45145
static int select_server_ctx(SSL *s, void *arg, int ignore) { const char *servername = SSL_get_servername(s, TLSEXT_NAMETYPE_host_name); HANDSHAKE_EX_DATA *ex_data = (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx)); if (servername == NULL) { ex_data->servername = SSL_TEST_SERVERNAME_SERVER1; return SSL_TLSEXT_ERR_NOACK; } if (strcmp(servername, "server2") == 0) { SSL_CTX *new_ctx = (SSL_CTX*)arg; SSL_set_SSL_CTX(s, new_ctx); SSL_clear_options(s, 0xFFFFFFFFL); SSL_set_options(s, SSL_CTX_get_options(new_ctx)); ex_data->servername = SSL_TEST_SERVERNAME_SERVER2; return SSL_TLSEXT_ERR_OK; } else if (strcmp(servername, "server1") == 0) { ex_data->servername = SSL_TEST_SERVERNAME_SERVER1; return SSL_TLSEXT_ERR_OK; } else if (ignore) { ex_data->servername = SSL_TEST_SERVERNAME_SERVER1; return SSL_TLSEXT_ERR_NOACK; } else { return SSL_TLSEXT_ERR_ALERT_FATAL; } } test/handshake_helper.c:91: error: NULL_DEREFERENCE pointer `ex_data` last assigned on line 87 could be null and is dereferenced at line 91, column 9. Showing all 19 steps of the trace test/handshake_helper.c:84:1: start of procedure select_server_ctx() 82. * An empty SNI extension also returns SSL_TSLEXT_ERR_NOACK. 83. */ 84. > static int select_server_ctx(SSL *s, void *arg, int ignore) 85. { 86. const char *servername = SSL_get_servername(s, TLSEXT_NAMETYPE_host_name); test/handshake_helper.c:86:5: 84. static int select_server_ctx(SSL *s, void *arg, int ignore) 85. { 86. > const char *servername = SSL_get_servername(s, TLSEXT_NAMETYPE_host_name); 87. HANDSHAKE_EX_DATA *ex_data = 88. (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx)); ssl/ssl_lib.c:2052:1: start of procedure SSL_get_servername() 2050. */ 2051. 2052. > const char *SSL_get_servername(const SSL *s, const int type) 2053. { 2054. if (type != TLSEXT_NAMETYPE_host_name) ssl/ssl_lib.c:2054:9: Taking false branch 2052. const char *SSL_get_servername(const SSL *s, const int type) 2053. { 2054. if (type != TLSEXT_NAMETYPE_host_name) ^ 2055. return NULL; 2056. ssl/ssl_lib.c:2057:12: Condition is true 2055. return NULL; 2056. 2057. return s->session && !s->tlsext_hostname ? ^ 2058. s->session->tlsext_hostname : s->tlsext_hostname; 2059. } ssl/ssl_lib.c:2057:27: Condition is true 2055. return NULL; 2056. 2057. return s->session && !s->tlsext_hostname ? ^ 2058. s->session->tlsext_hostname : s->tlsext_hostname; 2059. } ssl/ssl_lib.c:2057:12: 2055. return NULL; 2056. 2057. > return s->session && !s->tlsext_hostname ? 2058. s->session->tlsext_hostname : s->tlsext_hostname; 2059. } ssl/ssl_lib.c:2057:5: 2055. return NULL; 2056. 2057. > return s->session && !s->tlsext_hostname ? 2058. s->session->tlsext_hostname : s->tlsext_hostname; 2059. } ssl/ssl_lib.c:2059:1: return from a call to SSL_get_servername 2057. return s->session && !s->tlsext_hostname ? 2058. s->session->tlsext_hostname : s->tlsext_hostname; 2059. > } 2060. 2061. int SSL_get_servername_type(const SSL *s) test/handshake_helper.c:87:5: 85. { 86. const char *servername = SSL_get_servername(s, TLSEXT_NAMETYPE_host_name); 87. > HANDSHAKE_EX_DATA *ex_data = 88. (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx)); 89. ssl/ssl_lib.c:3496:1: start of procedure SSL_get_ex_data() 3494. } 3495. 3496. > void *SSL_get_ex_data(const SSL *s, int idx) 3497. { 3498. return (CRYPTO_get_ex_data(&s->ex_data, idx)); ssl/ssl_lib.c:3498:5: 3496. void *SSL_get_ex_data(const SSL *s, int idx) 3497. { 3498. > return (CRYPTO_get_ex_data(&s->ex_data, idx)); 3499. } 3500. crypto/ex_data.c:369:1: start of procedure CRYPTO_get_ex_data() 367. * particular index in the class used by this variable 368. */ 369. > void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx) 370. { 371. if (ad->sk == NULL || idx >= sk_void_num(ad->sk)) crypto/ex_data.c:371:9: Taking true branch 369. void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx) 370. { 371. if (ad->sk == NULL || idx >= sk_void_num(ad->sk)) ^ 372. return NULL; 373. return sk_void_value(ad->sk, idx); crypto/ex_data.c:372:9: 370. { 371. if (ad->sk == NULL || idx >= sk_void_num(ad->sk)) 372. > return NULL; 373. return sk_void_value(ad->sk, idx); 374. } crypto/ex_data.c:374:1: return from a call to CRYPTO_get_ex_data 372. return NULL; 373. return sk_void_value(ad->sk, idx); 374. > } ssl/ssl_lib.c:3499:1: return from a call to SSL_get_ex_data 3497. { 3498. return (CRYPTO_get_ex_data(&s->ex_data, idx)); 3499. > } 3500. 3501. int SSL_CTX_set_ex_data(SSL_CTX *s, int idx, void *arg) test/handshake_helper.c:90:9: Taking true branch 88. (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx)); 89. 90. if (servername == NULL) { ^ 91. ex_data->servername = SSL_TEST_SERVERNAME_SERVER1; 92. return SSL_TLSEXT_ERR_NOACK; test/handshake_helper.c:91:9: 89. 90. if (servername == NULL) { 91. > ex_data->servername = SSL_TEST_SERVERNAME_SERVER1; 92. return SSL_TLSEXT_ERR_NOACK; 93. }
https://github.com/openssl/openssl/blob/70c22888c1648fe8652e77107f3c74bf2212de36/test/handshake_helper.c/#L91
d2a_code_trace_data_45146
static void mov_create_chapter_track(AVFormatContext *s, int tracknum) { MOVMuxContext *mov = s->priv_data; MOVTrack *track = &mov->tracks[tracknum]; AVPacket pkt = { .stream_index = tracknum, .flags = AV_PKT_FLAG_KEY }; int i, len; track->mode = mov->mode; track->tag = MKTAG('t','e','x','t'); track->timescale = MOV_TIMESCALE; track->enc = avcodec_alloc_context3(NULL); track->enc->codec_type = AVMEDIA_TYPE_SUBTITLE; for (i = 0; i < s->nb_chapters; i++) { AVChapter *c = s->chapters[i]; AVDictionaryEntry *t; int64_t end = av_rescale_q(c->end, c->time_base, (AVRational){1,MOV_TIMESCALE}); pkt.pts = pkt.dts = av_rescale_q(c->start, c->time_base, (AVRational){1,MOV_TIMESCALE}); pkt.duration = end - pkt.dts; if ((t = av_dict_get(c->metadata, "title", NULL, 0))) { len = strlen(t->value); pkt.size = len+2; pkt.data = av_malloc(pkt.size); AV_WB16(pkt.data, len); memcpy(pkt.data+2, t->value, len); ff_mov_write_packet(s, &pkt); av_freep(&pkt.data); } } } libavformat/movenc.c:2169: error: Null Dereference pointer `pkt.data` last assigned on line 2168 could be null and is dereferenced at line 2169, column 13. libavformat/movenc.c:2144:1: start of procedure mov_create_chapter_track() 2142. // QuickTime chapters involve an additional text track with the chapter names 2143. // as samples, and a tref pointing from the other tracks to the chapter one. 2144. static void mov_create_chapter_track(AVFormatContext *s, int tracknum) ^ 2145. { 2146. MOVMuxContext *mov = s->priv_data; libavformat/movenc.c:2146:5: 2144. static void mov_create_chapter_track(AVFormatContext *s, int tracknum) 2145. { 2146. MOVMuxContext *mov = s->priv_data; ^ 2147. MOVTrack *track = &mov->tracks[tracknum]; 2148. AVPacket pkt = { .stream_index = tracknum, .flags = AV_PKT_FLAG_KEY }; libavformat/movenc.c:2147:5: 2145. { 2146. MOVMuxContext *mov = s->priv_data; 2147. MOVTrack *track = &mov->tracks[tracknum]; ^ 2148. AVPacket pkt = { .stream_index = tracknum, .flags = AV_PKT_FLAG_KEY }; 2149. int i, len; libavformat/movenc.c:2148:5: 2146. MOVMuxContext *mov = s->priv_data; 2147. MOVTrack *track = &mov->tracks[tracknum]; 2148. AVPacket pkt = { .stream_index = tracknum, .flags = AV_PKT_FLAG_KEY }; ^ 2149. int i, len; 2150. libavformat/movenc.c:2151:5: 2149. int i, len; 2150. 2151. track->mode = mov->mode; ^ 2152. track->tag = MKTAG('t','e','x','t'); 2153. track->timescale = MOV_TIMESCALE; libavformat/movenc.c:2152:5: 2150. 2151. track->mode = mov->mode; 2152. track->tag = MKTAG('t','e','x','t'); ^ 2153. track->timescale = MOV_TIMESCALE; 2154. track->enc = avcodec_alloc_context3(NULL); libavformat/movenc.c:2153:5: 2151. track->mode = mov->mode; 2152. track->tag = MKTAG('t','e','x','t'); 2153. track->timescale = MOV_TIMESCALE; ^ 2154. track->enc = avcodec_alloc_context3(NULL); 2155. track->enc->codec_type = AVMEDIA_TYPE_SUBTITLE; libavformat/movenc.c:2154:5: 2152. track->tag = MKTAG('t','e','x','t'); 2153. track->timescale = MOV_TIMESCALE; 2154. track->enc = avcodec_alloc_context3(NULL); ^ 2155. track->enc->codec_type = AVMEDIA_TYPE_SUBTITLE; 2156. libavcodec/options.c:599:1: start of procedure avcodec_alloc_context3() 597. } 598. 599. AVCodecContext *avcodec_alloc_context3(AVCodec *codec){ ^ 600. AVCodecContext *avctx= av_malloc(sizeof(AVCodecContext)); 601. libavcodec/options.c:600:5: 598. 599. AVCodecContext *avcodec_alloc_context3(AVCodec *codec){ 600. AVCodecContext *avctx= av_malloc(sizeof(AVCodecContext)); ^ 601. 602. if(avctx==NULL) return NULL; libavutil/mem.c:64:1: start of procedure av_malloc() 62. linker will do it automatically. */ 63. 64. void *av_malloc(size_t size) ^ 65. { 66. void *ptr = NULL; libavutil/mem.c:66:5: 64. void *av_malloc(size_t size) 65. { 66. void *ptr = NULL; ^ 67. #if CONFIG_MEMALIGN_HACK 68. long diff; libavutil/mem.c:72:8: Taking false branch 70. 71. /* let's disallow possible ambiguous cases */ 72. if(size > (INT_MAX-32) ) ^ 73. return NULL; 74. libavutil/mem.c:83:9: Taking false branch 81. ((char*)ptr)[-1]= diff; 82. #elif HAVE_POSIX_MEMALIGN 83. if (posix_memalign(&ptr,32,size)) ^ 84. ptr = NULL; 85. #elif HAVE_MEMALIGN libavutil/mem.c:114:5: 112. ptr = malloc(size); 113. #endif 114. return ptr; ^ 115. } 116. libavutil/mem.c:115:1: return from a call to av_malloc 113. #endif 114. return ptr; 115. } ^ 116. 117. void *av_realloc(void *ptr, size_t size) libavcodec/options.c:602:8: Taking false branch 600. AVCodecContext *avctx= av_malloc(sizeof(AVCodecContext)); 601. 602. if(avctx==NULL) return NULL; ^ 603. 604. if(avcodec_get_context_defaults3(avctx, codec) < 0){ libavcodec/options.c:604:8: Taking false branch 602. if(avctx==NULL) return NULL; 603. 604. if(avcodec_get_context_defaults3(avctx, codec) < 0){ ^ 605. av_free(avctx); 606. return NULL; libavcodec/options.c:609:5: 607. } 608. 609. return avctx; ^ 610. } 611. libavcodec/options.c:610:1: return from a call to avcodec_alloc_context3 608. 609. return avctx; 610. } ^ 611. 612. #if FF_API_ALLOC_CONTEXT libavformat/movenc.c:2155:5: 2153. track->timescale = MOV_TIMESCALE; 2154. track->enc = avcodec_alloc_context3(NULL); 2155. track->enc->codec_type = AVMEDIA_TYPE_SUBTITLE; ^ 2156. 2157. for (i = 0; i < s->nb_chapters; i++) { libavformat/movenc.c:2157:10: 2155. track->enc->codec_type = AVMEDIA_TYPE_SUBTITLE; 2156. 2157. for (i = 0; i < s->nb_chapters; i++) { ^ 2158. AVChapter *c = s->chapters[i]; 2159. AVDictionaryEntry *t; libavformat/movenc.c:2157:17: Loop condition is true. Entering loop body 2155. track->enc->codec_type = AVMEDIA_TYPE_SUBTITLE; 2156. 2157. for (i = 0; i < s->nb_chapters; i++) { ^ 2158. AVChapter *c = s->chapters[i]; 2159. AVDictionaryEntry *t; libavformat/movenc.c:2158:9: 2156. 2157. for (i = 0; i < s->nb_chapters; i++) { 2158. AVChapter *c = s->chapters[i]; ^ 2159. AVDictionaryEntry *t; 2160. libavformat/movenc.c:2161:9: 2159. AVDictionaryEntry *t; 2160. 2161. int64_t end = av_rescale_q(c->end, c->time_base, (AVRational){1,MOV_TIMESCALE}); ^ 2162. pkt.pts = pkt.dts = av_rescale_q(c->start, c->time_base, (AVRational){1,MOV_TIMESCALE}); 2163. pkt.duration = end - pkt.dts; libavutil/mathematics.c:133:1: start of procedure av_rescale_q() 131. } 132. 133. int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq){ ^ 134. int64_t b= bq.num * (int64_t)cq.den; 135. int64_t c= cq.num * (int64_t)bq.den; libavutil/mathematics.c:134:5: 132. 133. int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq){ 134. int64_t b= bq.num * (int64_t)cq.den; ^ 135. int64_t c= cq.num * (int64_t)bq.den; 136. return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF); libavutil/mathematics.c:135:5: 133. int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq){ 134. int64_t b= bq.num * (int64_t)cq.den; 135. int64_t c= cq.num * (int64_t)bq.den; ^ 136. return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF); 137. } libavutil/mathematics.c:136:5: Skipping av_rescale_rnd(): empty list of specs 134. int64_t b= bq.num * (int64_t)cq.den; 135. int64_t c= cq.num * (int64_t)bq.den; 136. return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF); ^ 137. } 138. libavutil/mathematics.c:137:1: return from a call to av_rescale_q 135. int64_t c= cq.num * (int64_t)bq.den; 136. return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF); 137. } ^ 138. 139. int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b){ libavformat/movenc.c:2162:9: 2160. 2161. int64_t end = av_rescale_q(c->end, c->time_base, (AVRational){1,MOV_TIMESCALE}); 2162. pkt.pts = pkt.dts = av_rescale_q(c->start, c->time_base, (AVRational){1,MOV_TIMESCALE}); ^ 2163. pkt.duration = end - pkt.dts; 2164. libavutil/mathematics.c:133:1: start of procedure av_rescale_q() 131. } 132. 133. int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq){ ^ 134. int64_t b= bq.num * (int64_t)cq.den; 135. int64_t c= cq.num * (int64_t)bq.den; libavutil/mathematics.c:134:5: 132. 133. int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq){ 134. int64_t b= bq.num * (int64_t)cq.den; ^ 135. int64_t c= cq.num * (int64_t)bq.den; 136. return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF); libavutil/mathematics.c:135:5: 133. int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq){ 134. int64_t b= bq.num * (int64_t)cq.den; 135. int64_t c= cq.num * (int64_t)bq.den; ^ 136. return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF); 137. } libavutil/mathematics.c:136:5: Skipping av_rescale_rnd(): empty list of specs 134. int64_t b= bq.num * (int64_t)cq.den; 135. int64_t c= cq.num * (int64_t)bq.den; 136. return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF); ^ 137. } 138. libavutil/mathematics.c:137:1: return from a call to av_rescale_q 135. int64_t c= cq.num * (int64_t)bq.den; 136. return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF); 137. } ^ 138. 139. int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b){ libavformat/movenc.c:2163:9: 2161. int64_t end = av_rescale_q(c->end, c->time_base, (AVRational){1,MOV_TIMESCALE}); 2162. pkt.pts = pkt.dts = av_rescale_q(c->start, c->time_base, (AVRational){1,MOV_TIMESCALE}); 2163. pkt.duration = end - pkt.dts; ^ 2164. 2165. if ((t = av_dict_get(c->metadata, "title", NULL, 0))) { libavformat/movenc.c:2165:14: Taking true branch 2163. pkt.duration = end - pkt.dts; 2164. 2165. if ((t = av_dict_get(c->metadata, "title", NULL, 0))) { ^ 2166. len = strlen(t->value); 2167. pkt.size = len+2; libavformat/movenc.c:2166:13: 2164. 2165. if ((t = av_dict_get(c->metadata, "title", NULL, 0))) { 2166. len = strlen(t->value); ^ 2167. pkt.size = len+2; 2168. pkt.data = av_malloc(pkt.size); libavformat/movenc.c:2167:13: 2165. if ((t = av_dict_get(c->metadata, "title", NULL, 0))) { 2166. len = strlen(t->value); 2167. pkt.size = len+2; ^ 2168. pkt.data = av_malloc(pkt.size); 2169. AV_WB16(pkt.data, len); libavformat/movenc.c:2168:13: 2166. len = strlen(t->value); 2167. pkt.size = len+2; 2168. pkt.data = av_malloc(pkt.size); ^ 2169. AV_WB16(pkt.data, len); 2170. memcpy(pkt.data+2, t->value, len); 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) libavformat/movenc.c:2169:13: 2167. pkt.size = len+2; 2168. pkt.data = av_malloc(pkt.size); 2169. AV_WB16(pkt.data, len); ^ 2170. memcpy(pkt.data+2, t->value, len); 2171. ff_mov_write_packet(s, &pkt); libavutil/bswap.h:58:1: start of procedure av_bswap16() 56. 57. #ifndef av_bswap16 58. static av_always_inline av_const uint16_t av_bswap16(uint16_t x) ^ 59. { 60. x= (x>>8) | (x<<8); libavutil/bswap.h:60:5: 58. static av_always_inline av_const uint16_t av_bswap16(uint16_t x) 59. { 60. x= (x>>8) | (x<<8); ^ 61. return x; 62. } libavutil/bswap.h:61:5: 59. { 60. x= (x>>8) | (x<<8); 61. return x; ^ 62. } 63. #endif libavutil/bswap.h:62:1: return from a call to av_bswap16 60. x= (x>>8) | (x<<8); 61. return x; 62. } ^ 63. #endif 64.
https://github.com/libav/libav/blob/4bf3c8f226252e18de8051fd0d417c1d39857b67/libavformat/movenc.c/#L2169
d2a_code_trace_data_45147
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:288: error: Uninitialized Value The value read from inbuffer[_] was never initialized. libavcodec/ra144.c:288:3: 286. *(ptr++)=((inbuffer[5]<<5)&0x60)|((inbuffer[6]>>11)&0x1f); 287. *(ptr++)=(inbuffer[6]>>4)&0x7f; 288. *(ptr++)=((inbuffer[6]<<4)&0xf0)|((inbuffer[7]>>12)&0xf); ^ 289. *(ptr++)=(inbuffer[7]>>5)&0x7f; 290. *(ptr++)=((inbuffer[7]<<2)&0x7c)|((inbuffer[8]>>14)&3);
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/ra144.c/#L288
d2a_code_trace_data_45148
int BN_hex2bn(BIGNUM **bn, const char *a) { BIGNUM *ret = NULL; BN_ULONG l = 0; int neg = 0, h, m, i, j, k, c; int num; if ((a == NULL) || (*a == '\0')) return (0); if (*a == '-') { neg = 1; a++; } for (i = 0; i <= (INT_MAX/4) && isxdigit((unsigned char)a[i]); i++) continue; if (i == 0 || i > INT_MAX/4) goto err; num = i + neg; if (bn == NULL) return (num); if (*bn == NULL) { if ((ret = BN_new()) == NULL) return (0); } else { ret = *bn; BN_zero(ret); } if (bn_expand(ret, i * 4) == NULL) goto err; j = i; m = 0; h = 0; while (j > 0) { m = ((BN_BYTES * 2) <= j) ? (BN_BYTES * 2) : j; l = 0; for (;;) { c = a[j - m]; k = OPENSSL_hexchar2int(c); if (k < 0) k = 0; l = (l << 4) | k; if (--m <= 0) { ret->d[h++] = l; break; } } j -= (BN_BYTES * 2); } ret->top = h; bn_correct_top(ret); *bn = ret; bn_check_top(ret); if (ret->top != 0) ret->neg = neg; return (num); err: if (*bn == NULL) BN_free(ret); return (0); } test/bntest.c:1639: error: BUFFER_OVERRUN_L2 Offset: [-13, 536870914] (⇐ [2, 4] + [-15, 536870910]) Size: 7 by call to `BN_asc2bn`. Showing all 10 steps of the trace test/bntest.c:1639:10: Call 1637. } 1638. 1639. if (!BN_asc2bn(&bn, "0x1234") ^ 1640. || !BN_is_word(bn, 0x1234) || BN_is_negative(bn)) { 1641. fprintf(stderr, "BN_asc2bn(0x1234) gave a bad result.\n"); crypto/bn/bn_print.c:269:1: Parameter `*a` 267. } 268. 269. > int BN_asc2bn(BIGNUM **bn, const char *a) 270. { 271. const char *p = a; crypto/bn/bn_print.c:271:5: Assignment 269. int BN_asc2bn(BIGNUM **bn, const char *a) 270. { 271. const char *p = a; ^ 272. 273. if (*p == '-') crypto/bn/bn_print.c:277:14: Call 275. 276. if (p[0] == '0' && (p[1] == 'X' || p[1] == 'x')) { 277. if (!BN_hex2bn(bn, p + 2)) ^ 278. return 0; 279. } else { crypto/bn/bn_print.c:141:10: <Offset trace> 139. } 140. 141. for (i = 0; i <= (INT_MAX/4) && isxdigit((unsigned char)a[i]); i++) ^ 142. continue; 143. crypto/bn/bn_print.c:141:10: Assignment 139. } 140. 141. for (i = 0; i <= (INT_MAX/4) && isxdigit((unsigned char)a[i]); i++) ^ 142. continue; 143. crypto/bn/bn_print.c:164:5: Assignment 162. goto err; 163. 164. j = i; /* least significant 'hex' */ ^ 165. m = 0; 166. h = 0; crypto/bn/bn_print.c:126:1: <Length trace> 124. } 125. 126. > int BN_hex2bn(BIGNUM **bn, const char *a) 127. { 128. BIGNUM *ret = NULL; crypto/bn/bn_print.c:126:1: Parameter `*a` 124. } 125. 126. > int BN_hex2bn(BIGNUM **bn, const char *a) 127. { 128. BIGNUM *ret = NULL; crypto/bn/bn_print.c:171:17: Array access: Offset: [-13, 536870914] (⇐ [2, 4] + [-15, 536870910]) Size: 7 by call to `BN_asc2bn` 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/0282aeb690d63fab73a07191b63300a2fe30d212/crypto/bn/bn_print.c/#L171
d2a_code_trace_data_45149
ERR_STATE *ERR_get_state(void) { ERR_STATE *state; int saveerrno = get_last_sys_error(); if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL)) return NULL; if (!RUN_ONCE(&err_init, err_do_init)) return NULL; state = CRYPTO_THREAD_get_local(&err_thread_local); if (state == (ERR_STATE*)-1) return NULL; if (state == NULL) { if (!CRYPTO_THREAD_set_local(&err_thread_local, (ERR_STATE*)-1)) return NULL; if ((state = OPENSSL_zalloc(sizeof(*state))) == NULL) { CRYPTO_THREAD_set_local(&err_thread_local, NULL); return NULL; } if (!ossl_init_thread_start(NULL, NULL, err_delete_thread_state) || !CRYPTO_THREAD_set_local(&err_thread_local, state)) { ERR_STATE_free(state); CRYPTO_THREAD_set_local(&err_thread_local, NULL); return NULL; } OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL); } set_sys_error(saveerrno); return state; } crypto/err/err.c:642: error: NULL_DEREFERENCE pointer `null` is dereferenced by call to `ossl_init_thread_start()` at line 642, column 14. Showing all 28 steps of the trace crypto/err/err.c:618:1: start of procedure ERR_get_state() 616. } 617. 618. > ERR_STATE *ERR_get_state(void) 619. { 620. ERR_STATE *state; crypto/err/err.c:621:5: 619. { 620. ERR_STATE *state; 621. > int saveerrno = get_last_sys_error(); 622. 623. if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL)) crypto/err/err.c:623:10: Taking false branch 621. int saveerrno = get_last_sys_error(); 622. 623. if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL)) ^ 624. return NULL; 625. crypto/err/err.c:626:10: 624. return NULL; 625. 626. > if (!RUN_ONCE(&err_init, err_do_init)) 627. return NULL; 628. crypto/threads_pthread.c:111:1: start of procedure CRYPTO_THREAD_run_once() 109. } 110. 111. > int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void)) 112. { 113. if (pthread_once(once, init) != 0) crypto/threads_pthread.c:113:9: Taking false branch 111. int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void)) 112. { 113. if (pthread_once(once, init) != 0) ^ 114. return 0; 115. crypto/threads_pthread.c:116:5: 114. return 0; 115. 116. > return 1; 117. } 118. crypto/threads_pthread.c:117:1: return from a call to CRYPTO_THREAD_run_once 115. 116. return 1; 117. > } 118. 119. int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *)) crypto/err/err.c:626:10: Condition is true 624. return NULL; 625. 626. if (!RUN_ONCE(&err_init, err_do_init)) ^ 627. return NULL; 628. crypto/err/err.c:626:10: Taking false branch 624. return NULL; 625. 626. if (!RUN_ONCE(&err_init, err_do_init)) ^ 627. return NULL; 628. crypto/err/err.c:629:5: 627. return NULL; 628. 629. > state = CRYPTO_THREAD_get_local(&err_thread_local); 630. if (state == (ERR_STATE*)-1) 631. return NULL; crypto/threads_pthread.c:127:1: start of procedure CRYPTO_THREAD_get_local() 125. } 126. 127. > void *CRYPTO_THREAD_get_local(CRYPTO_THREAD_LOCAL *key) 128. { 129. return pthread_getspecific(*key); crypto/threads_pthread.c:129:5: Skipping pthread_getspecific(): method has no implementation 127. void *CRYPTO_THREAD_get_local(CRYPTO_THREAD_LOCAL *key) 128. { 129. return pthread_getspecific(*key); ^ 130. } 131. crypto/threads_pthread.c:130:1: return from a call to CRYPTO_THREAD_get_local 128. { 129. return pthread_getspecific(*key); 130. > } 131. 132. int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val) crypto/err/err.c:630:9: Taking false branch 628. 629. state = CRYPTO_THREAD_get_local(&err_thread_local); 630. if (state == (ERR_STATE*)-1) ^ 631. return NULL; 632. crypto/err/err.c:633:9: Taking true branch 631. return NULL; 632. 633. if (state == NULL) { ^ 634. if (!CRYPTO_THREAD_set_local(&err_thread_local, (ERR_STATE*)-1)) 635. return NULL; crypto/err/err.c:634:14: 632. 633. if (state == NULL) { 634. > if (!CRYPTO_THREAD_set_local(&err_thread_local, (ERR_STATE*)-1)) 635. return NULL; 636. crypto/threads_pthread.c:132:1: start of procedure CRYPTO_THREAD_set_local() 130. } 131. 132. > int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val) 133. { 134. if (pthread_setspecific(*key, val) != 0) crypto/threads_pthread.c:134:9: Taking false branch 132. int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val) 133. { 134. if (pthread_setspecific(*key, val) != 0) ^ 135. return 0; 136. crypto/threads_pthread.c:137:5: 135. return 0; 136. 137. > return 1; 138. } 139. crypto/threads_pthread.c:138:1: return from a call to CRYPTO_THREAD_set_local 136. 137. return 1; 138. > } 139. 140. int CRYPTO_THREAD_cleanup_local(CRYPTO_THREAD_LOCAL *key) crypto/err/err.c:634:14: Taking false branch 632. 633. if (state == NULL) { 634. if (!CRYPTO_THREAD_set_local(&err_thread_local, (ERR_STATE*)-1)) ^ 635. return NULL; 636. crypto/err/err.c:637:13: 635. return NULL; 636. 637. > if ((state = OPENSSL_zalloc(sizeof(*state))) == NULL) { 638. CRYPTO_THREAD_set_local(&err_thread_local, NULL); 639. return NULL; providers/fips/fipsprov.c:463:1: start of procedure CRYPTO_zalloc() 461. } 462. 463. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 464. { 465. return c_CRYPTO_zalloc(num, file, line); providers/fips/fipsprov.c:465:5: Skipping __function_pointer__(): unresolved function pointer 463. void *CRYPTO_zalloc(size_t num, const char *file, int line) 464. { 465. return c_CRYPTO_zalloc(num, file, line); ^ 466. } 467. providers/fips/fipsprov.c:466:1: return from a call to CRYPTO_zalloc 464. { 465. return c_CRYPTO_zalloc(num, file, line); 466. > } 467. 468. void CRYPTO_free(void *ptr, const char *file, int line) crypto/err/err.c:637:13: Taking false branch 635. return NULL; 636. 637. if ((state = OPENSSL_zalloc(sizeof(*state))) == NULL) { ^ 638. CRYPTO_THREAD_set_local(&err_thread_local, NULL); 639. return NULL; crypto/err/err.c:642:14: 640. } 641. 642. > if (!ossl_init_thread_start(NULL, NULL, err_delete_thread_state) 643. || !CRYPTO_THREAD_set_local(&err_thread_local, state)) { 644. ERR_STATE_free(state);
https://github.com/openssl/openssl/blob/c3612970465d0a13f2fc5b47bc28ca18516a699d/crypto/err/err.c/#L642
d2a_code_trace_data_45150
BIGNUM *SRP_Calc_x(const BIGNUM *s, const char *user, const char *pass) { unsigned char dig[SHA_DIGEST_LENGTH]; EVP_MD_CTX *ctxt; unsigned char *cs = NULL; BIGNUM *res = NULL; if ((s == NULL) || (user == NULL) || (pass == NULL)) return NULL; ctxt = EVP_MD_CTX_new(); if (ctxt == NULL) return NULL; if ((cs = OPENSSL_malloc(BN_num_bytes(s))) == NULL) goto err; if (!EVP_DigestInit_ex(ctxt, EVP_sha1(), NULL) || !EVP_DigestUpdate(ctxt, user, strlen(user)) || !EVP_DigestUpdate(ctxt, ":", 1) || !EVP_DigestUpdate(ctxt, pass, strlen(pass)) || !EVP_DigestFinal_ex(ctxt, dig, NULL) || !EVP_DigestInit_ex(ctxt, EVP_sha1(), NULL)) goto err; BN_bn2bin(s, cs); if (!EVP_DigestUpdate(ctxt, cs, BN_num_bytes(s))) goto err; if (!EVP_DigestUpdate(ctxt, dig, sizeof(dig)) || !EVP_DigestFinal_ex(ctxt, dig, NULL)) goto err; res = BN_bin2bn(dig, sizeof(dig), NULL); err: OPENSSL_free(cs); EVP_MD_CTX_free(ctxt); return res; } crypto/srp/srp_lib.c:202: error: MEMORY_LEAK memory dynamically allocated by call to `EVP_MD_CTX_new()` at line 177, column 12 is not reachable after line 202, column 5. Showing all 67 steps of the trace crypto/srp/srp_lib.c:167:1: start of procedure SRP_Calc_x() 165. } 166. 167. > BIGNUM *SRP_Calc_x(const BIGNUM *s, const char *user, const char *pass) 168. { 169. unsigned char dig[SHA_DIGEST_LENGTH]; crypto/srp/srp_lib.c:171:5: 169. unsigned char dig[SHA_DIGEST_LENGTH]; 170. EVP_MD_CTX *ctxt; 171. > unsigned char *cs = NULL; 172. BIGNUM *res = NULL; 173. crypto/srp/srp_lib.c:172:5: 170. EVP_MD_CTX *ctxt; 171. unsigned char *cs = NULL; 172. > BIGNUM *res = NULL; 173. 174. if ((s == NULL) || (user == NULL) || (pass == NULL)) crypto/srp/srp_lib.c:174:10: Taking false branch 172. BIGNUM *res = NULL; 173. 174. if ((s == NULL) || (user == NULL) || (pass == NULL)) ^ 175. return NULL; 176. crypto/srp/srp_lib.c:174:25: Taking false branch 172. BIGNUM *res = NULL; 173. 174. if ((s == NULL) || (user == NULL) || (pass == NULL)) ^ 175. return NULL; 176. crypto/srp/srp_lib.c:174:43: Taking false branch 172. BIGNUM *res = NULL; 173. 174. if ((s == NULL) || (user == NULL) || (pass == NULL)) ^ 175. return NULL; 176. crypto/srp/srp_lib.c:177:5: 175. return NULL; 176. 177. > ctxt = EVP_MD_CTX_new(); 178. if (ctxt == NULL) 179. return NULL; 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:98:1: start of procedure CRYPTO_zalloc() 96. } 97. 98. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 99. { 100. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:100:5: 98. void *CRYPTO_zalloc(size_t num, const char *file, int line) 99. { 100. > void *ret = CRYPTO_malloc(num, file, line); 101. 102. if (ret != NULL) crypto/mem.c:71:1: start of procedure CRYPTO_malloc() 69. } 70. 71. > void *CRYPTO_malloc(size_t num, const char *file, int line) 72. { 73. void *ret = NULL; crypto/mem.c:73:5: 71. void *CRYPTO_malloc(size_t num, const char *file, int line) 72. { 73. > void *ret = NULL; 74. 75. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) crypto/mem.c:75:9: Taking false branch 73. void *ret = NULL; 74. 75. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) ^ 76. return malloc_impl(num, file, line); 77. crypto/mem.c:78:9: Taking false branch 76. return malloc_impl(num, file, line); 77. 78. if (num <= 0) ^ 79. return NULL; 80. crypto/mem.c:81:5: 79. return NULL; 80. 81. > allow_customize = 0; 82. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 83. if (call_malloc_debug) { crypto/mem.c:91:5: 89. } 90. #else 91. > osslargused(file); osslargused(line); 92. ret = malloc(num); 93. #endif crypto/mem.c:91:24: 89. } 90. #else 91. > osslargused(file); osslargused(line); 92. ret = malloc(num); 93. #endif crypto/mem.c:92:5: 90. #else 91. osslargused(file); osslargused(line); 92. > ret = malloc(num); 93. #endif 94. crypto/mem.c:95:5: 93. #endif 94. 95. > return ret; 96. } 97. crypto/mem.c:96:1: return from a call to CRYPTO_malloc 94. 95. return ret; 96. > } 97. 98. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:102:9: Taking true branch 100. void *ret = CRYPTO_malloc(num, file, line); 101. 102. if (ret != NULL) ^ 103. memset(ret, 0, num); 104. return ret; crypto/mem.c:103:9: 101. 102. if (ret != NULL) 103. > memset(ret, 0, num); 104. return ret; 105. } crypto/mem.c:104:5: 102. if (ret != NULL) 103. memset(ret, 0, num); 104. > return ret; 105. } 106. crypto/mem.c:105:1: return from a call to CRYPTO_zalloc 103. memset(ret, 0, num); 104. return ret; 105. > } 106. 107. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/evp/digest.c:47:1: return from a call to EVP_MD_CTX_new 45. { 46. return OPENSSL_zalloc(sizeof(EVP_MD_CTX)); 47. > } 48. 49. void EVP_MD_CTX_free(EVP_MD_CTX *ctx) crypto/srp/srp_lib.c:178:9: Taking false branch 176. 177. ctxt = EVP_MD_CTX_new(); 178. if (ctxt == NULL) ^ 179. return NULL; 180. if ((cs = OPENSSL_malloc(BN_num_bytes(s))) == NULL) crypto/srp/srp_lib.c:180:9: 178. if (ctxt == NULL) 179. return NULL; 180. > if ((cs = OPENSSL_malloc(BN_num_bytes(s))) == NULL) 181. goto err; 182. crypto/bn/bn_lib.c:161:1: start of procedure BN_num_bits() 159. } 160. 161. > int BN_num_bits(const BIGNUM *a) 162. { 163. int i = a->top - 1; crypto/bn/bn_lib.c:163:5: 161. int BN_num_bits(const BIGNUM *a) 162. { 163. > int i = a->top - 1; 164. bn_check_top(a); 165. crypto/bn/bn_lib.c:166:9: 164. bn_check_top(a); 165. 166. > if (BN_is_zero(a)) 167. return 0; 168. return ((i * BN_BITS2) + BN_num_bits_word(a->d[i])); crypto/bn/bn_lib.c:920:1: start of procedure BN_is_zero() 918. } 919. 920. > int BN_is_zero(const BIGNUM *a) 921. { 922. return a->top == 0; crypto/bn/bn_lib.c:922:12: Condition is false 920. int BN_is_zero(const BIGNUM *a) 921. { 922. return a->top == 0; ^ 923. } 924. crypto/bn/bn_lib.c:922:5: 920. int BN_is_zero(const BIGNUM *a) 921. { 922. > return a->top == 0; 923. } 924. crypto/bn/bn_lib.c:923:1: return from a call to BN_is_zero 921. { 922. return a->top == 0; 923. > } 924. 925. int BN_is_one(const BIGNUM *a) crypto/bn/bn_lib.c:166:9: Taking false branch 164. bn_check_top(a); 165. 166. if (BN_is_zero(a)) ^ 167. return 0; 168. return ((i * BN_BITS2) + BN_num_bits_word(a->d[i])); crypto/bn/bn_lib.c:168:5: Skipping BN_num_bits_word(): empty list of specs 166. if (BN_is_zero(a)) 167. return 0; 168. return ((i * BN_BITS2) + BN_num_bits_word(a->d[i])); ^ 169. } 170. crypto/bn/bn_lib.c:169:1: return from a call to BN_num_bits 167. return 0; 168. return ((i * BN_BITS2) + BN_num_bits_word(a->d[i])); 169. > } 170. 171. static void bn_free_d(BIGNUM *a) crypto/mem.c:71:1: start of procedure CRYPTO_malloc() 69. } 70. 71. > void *CRYPTO_malloc(size_t num, const char *file, int line) 72. { 73. void *ret = NULL; crypto/mem.c:73:5: 71. void *CRYPTO_malloc(size_t num, const char *file, int line) 72. { 73. > void *ret = NULL; 74. 75. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) crypto/mem.c:75:9: Taking true branch 73. void *ret = NULL; 74. 75. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) ^ 76. return malloc_impl(num, file, line); 77. crypto/mem.c:75:32: Taking true branch 73. void *ret = NULL; 74. 75. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) ^ 76. return malloc_impl(num, file, line); 77. crypto/mem.c:76:9: Skipping __function_pointer__(): unresolved function pointer 74. 75. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) 76. return malloc_impl(num, file, line); ^ 77. 78. if (num <= 0) crypto/mem.c:96:1: return from a call to CRYPTO_malloc 94. 95. return ret; 96. > } 97. 98. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/srp/srp_lib.c:180:9: Taking false branch 178. if (ctxt == NULL) 179. return NULL; 180. if ((cs = OPENSSL_malloc(BN_num_bytes(s))) == NULL) ^ 181. goto err; 182. crypto/srp/srp_lib.c:183:10: 181. goto err; 182. 183. > if (!EVP_DigestInit_ex(ctxt, EVP_sha1(), NULL) 184. || !EVP_DigestUpdate(ctxt, user, strlen(user)) 185. || !EVP_DigestUpdate(ctxt, ":", 1) crypto/evp/m_sha1.c:103:1: start of procedure EVP_sha1() 101. }; 102. 103. > const EVP_MD *EVP_sha1(void) 104. { 105. return (&sha1_md); crypto/evp/m_sha1.c:105:5: 103. const EVP_MD *EVP_sha1(void) 104. { 105. > return (&sha1_md); 106. } 107. crypto/evp/m_sha1.c:106:1: return from a call to EVP_sha1 104. { 105. return (&sha1_md); 106. > } 107. 108. static int init224(EVP_MD_CTX *ctx) crypto/srp/srp_lib.c:183:10: Taking true branch 181. goto err; 182. 183. if (!EVP_DigestInit_ex(ctxt, EVP_sha1(), NULL) ^ 184. || !EVP_DigestUpdate(ctxt, user, strlen(user)) 185. || !EVP_DigestUpdate(ctxt, ":", 1) crypto/srp/srp_lib.c:200:2: 198. res = BN_bin2bn(dig, sizeof(dig), NULL); 199. 200. > err: 201. OPENSSL_free(cs); 202. EVP_MD_CTX_free(ctxt); crypto/srp/srp_lib.c:201:5: 199. 200. err: 201. > OPENSSL_free(cs); 202. EVP_MD_CTX_free(ctxt); 203. return res; crypto/mem.c:163:1: start of procedure CRYPTO_free() 161. } 162. 163. > void CRYPTO_free(void *str, const char *file, int line) 164. { 165. if (free_impl != NULL && free_impl != &CRYPTO_free) { crypto/mem.c:165:9: Taking false branch 163. void CRYPTO_free(void *str, const char *file, int line) 164. { 165. if (free_impl != NULL && free_impl != &CRYPTO_free) { ^ 166. free_impl(str, file, line); 167. return; crypto/mem.c:179:5: 177. } 178. #else 179. > free(str); 180. #endif 181. } crypto/mem.c:181:1: return from a call to CRYPTO_free 179. free(str); 180. #endif 181. > } 182. 183. void CRYPTO_clear_free(void *str, size_t num, const char *file, int line) crypto/srp/srp_lib.c:202:5: 200. err: 201. OPENSSL_free(cs); 202. > EVP_MD_CTX_free(ctxt); 203. return res; 204. } 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:163:1: start of procedure CRYPTO_free() 161. } 162. 163. > void CRYPTO_free(void *str, const char *file, int line) 164. { 165. if (free_impl != NULL && free_impl != &CRYPTO_free) { crypto/mem.c:165:9: Taking true branch 163. void CRYPTO_free(void *str, const char *file, int line) 164. { 165. if (free_impl != NULL && free_impl != &CRYPTO_free) { ^ 166. free_impl(str, file, line); 167. return; crypto/mem.c:165:30: Taking true branch 163. void CRYPTO_free(void *str, const char *file, int line) 164. { 165. if (free_impl != NULL && free_impl != &CRYPTO_free) { ^ 166. free_impl(str, file, line); 167. return; crypto/mem.c:166:9: Skipping __function_pointer__(): unresolved function pointer 164. { 165. if (free_impl != NULL && free_impl != &CRYPTO_free) { 166. free_impl(str, file, line); ^ 167. return; 168. } crypto/mem.c:167:9: 165. if (free_impl != NULL && free_impl != &CRYPTO_free) { 166. free_impl(str, file, line); 167. > return; 168. } 169. crypto/mem.c:181:1: return from a call to CRYPTO_free 179. free(str); 180. #endif 181. > } 182. 183. void CRYPTO_clear_free(void *str, size_t num, const char *file, int line) crypto/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/c6231e9c7baec688792e043d12508e608545fffb/crypto/srp/srp_lib.c/#L202
d2a_code_trace_data_45151
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:1061: error: Uninitialized Value The value read from ymax was never initialized. libavcodec/motion_est_template.c:1061:9: 1059. CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift)-1, (P_MEDIAN[1]>>shift) ) 1060. CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift)+1, (P_MEDIAN[1]>>shift) ) 1061. CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16, ^ 1062. (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16) 1063. CHECK_MV(P_LEFT[0] >>shift, P_LEFT[1] >>shift)
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1061
d2a_code_trace_data_45152
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/tiffmedian.c:887: error: Buffer Overrun L3 Offset: [7, +oo] (⇐ [0, +oo] + 7) Size: [0, +oo] by call to `TIFFWriteScanline`. tools/tiffmedian.c:797:1: Parameter `out->tif_rawdata` 795. cshift >>= COLOR_SHIFT; 796. 797. static void ^ 798. quant_fsdither(TIFF* in, TIFF* out) 799. { tools/tiffmedian.c:887:7: Call 885. } 886. } 887. if (TIFFWriteScanline(out, outline, i-1, 0) < 0) ^ 888. break; 889. } libtiff/tif_write.c:48:1: Parameter `*tif->tif_rawdata` 46. static int TIFFAppendToStrip(TIFF* tif, uint32 strip, uint8* data, tmsize_t cc); 47. 48. int ^ 49. TIFFWriteScanline(TIFF* tif, void* buf, uint32 row, uint16 sample) 50. { libtiff/tif_write.c:107:8: Call 105. * Changing strips -- flush any data present. 106. */ 107. if (!TIFFFlushData(tif)) ^ 108. return (-1); 109. tif->tif_curstrip = strip; libtiff/tif_flush.c:98:1: Parameter `*tif->tif_rawdata` 96. * problems for other people. 97. */ 98. int ^ 99. TIFFFlushData(TIFF* tif) 100. { libtiff/tif_flush.c:108:10: Call 106. return (0); 107. } 108. return (TIFFFlushData1(tif)); ^ 109. } 110. libtiff/tif_write.c:709:1: Parameter `*tif->tif_rawdata` 707. * for infinite recursion. 708. */ 709. int ^ 710. TIFFFlushData1(TIFF* tif) 711. { libtiff/tif_write.c:715:4: Call 713. if (!isFillOrder(tif, tif->tif_dir.td_fillorder) && 714. (tif->tif_flags & TIFF_NOBITREV) == 0) 715. TIFFReverseBits((uint8*)tif->tif_rawdata, ^ 716. tif->tif_rawcc); 717. if (!TIFFAppendToStrip(tif, libtiff/tif_swab.c:285:1: <Length trace> 283. } 284. 285. void ^ 286. TIFFReverseBits(uint8* cp, tmsize_t n) 287. { libtiff/tif_swab.c:285:1: Parameter `*cp` 283. } 284. 285. void ^ 286. TIFFReverseBits(uint8* cp, tmsize_t n) 287. { libtiff/tif_swab.c:296:3: Array access: Offset: [7, +oo] (⇐ [0, +oo] + 7) Size: [0, +oo] by call to `TIFFWriteScanline` 294. cp[5] = TIFFBitRevTable[cp[5]]; 295. cp[6] = TIFFBitRevTable[cp[6]]; 296. cp[7] = TIFFBitRevTable[cp[7]]; ^ 297. cp += 8; 298. }
https://gitlab.com/libtiff/libtiff/blob/771a4ea0a98c7a218c9f3add9a05e08d29625758/libtiff/tif_swab.c/#L296
d2a_code_trace_data_45153
int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) { assert(pkt->subs != NULL && len != 0); if (pkt->subs == NULL || len == 0) return 0; if (pkt->maxsize - pkt->written < len) return 0; if (pkt->buf->length - pkt->written < len) { size_t newlen; size_t reflen; reflen = (len > pkt->buf->length) ? len : pkt->buf->length; if (reflen > SIZE_MAX / 2) { newlen = SIZE_MAX; } else { newlen = reflen * 2; if (newlen < DEFAULT_BUF_SIZE) newlen = DEFAULT_BUF_SIZE; } if (BUF_MEM_grow(pkt->buf, newlen) == 0) return 0; } *allocbytes = (unsigned char *)pkt->buf->data + pkt->curr; return 1; } ssl/t1_lib.c:1063: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [0, `s->s3->previous_client_finished_len` + `pkt->written` + 21]):unsigned64 by call to `WPACKET_sub_memcpy__`. Showing all 22 steps of the trace ssl/t1_lib.c:1016:1: Parameter `pkt->written` 1014. } 1015. 1016. > int ssl_add_clienthello_tlsext(SSL *s, WPACKET *pkt, int *al) 1017. { 1018. #ifndef OPENSSL_NO_EC ssl/t1_lib.c:1057:14: Call 1055. if (s->tlsext_hostname != NULL) { 1056. /* Add TLS extension servername to the Client Hello message */ 1057. if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_server_name) ^ 1058. /* Sub-packet for server_name extension */ 1059. || !WPACKET_start_sub_packet_u16(pkt) ssl/packet.c:261:1: Parameter `pkt->written` 259. } 260. 261. > int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size) 262. { 263. unsigned char *data; ssl/t1_lib.c:1059:21: Call 1057. if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_server_name) 1058. /* Sub-packet for server_name extension */ 1059. || !WPACKET_start_sub_packet_u16(pkt) ^ 1060. /* Sub-packet for servername list (always 1 hostname)*/ 1061. || !WPACKET_start_sub_packet_u16(pkt) ssl/packet.c:224:1: Parameter `pkt->written` 222. } 223. 224. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes) 225. { 226. WPACKET_SUB *sub; ssl/t1_lib.c:1061:21: Call 1059. || !WPACKET_start_sub_packet_u16(pkt) 1060. /* Sub-packet for servername list (always 1 hostname)*/ 1061. || !WPACKET_start_sub_packet_u16(pkt) ^ 1062. || !WPACKET_put_bytes_u8(pkt, TLSEXT_NAMETYPE_host_name) 1063. || !WPACKET_sub_memcpy_u16(pkt, s->tlsext_hostname, ssl/packet.c:224:1: Parameter `pkt->written` 222. } 223. 224. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes) 225. { 226. WPACKET_SUB *sub; ssl/t1_lib.c:1062:21: Call 1060. /* Sub-packet for servername list (always 1 hostname)*/ 1061. || !WPACKET_start_sub_packet_u16(pkt) 1062. || !WPACKET_put_bytes_u8(pkt, TLSEXT_NAMETYPE_host_name) ^ 1063. || !WPACKET_sub_memcpy_u16(pkt, s->tlsext_hostname, 1064. strlen(s->tlsext_hostname)) ssl/packet.c:261:1: Parameter `pkt->written` 259. } 260. 261. > int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size) 262. { 263. unsigned char *data; ssl/t1_lib.c:1063:21: Call 1061. || !WPACKET_start_sub_packet_u16(pkt) 1062. || !WPACKET_put_bytes_u8(pkt, TLSEXT_NAMETYPE_host_name) 1063. || !WPACKET_sub_memcpy_u16(pkt, s->tlsext_hostname, ^ 1064. strlen(s->tlsext_hostname)) 1065. || !WPACKET_close(pkt) 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] - [0, s->s3->previous_client_finished_len + pkt->written + 21]):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