id
stringlengths
25
25
content
stringlengths
649
72.1k
max_stars_repo_path
stringlengths
91
133
d2a_code_trace_data_44154
static int SSKDF_hash_kdm(const EVP_MD *kdf_md, const unsigned char *z, size_t z_len, const unsigned char *info, size_t info_len, unsigned char *derived_key, size_t derived_key_len) { int ret = 0, hlen; size_t counter, out_len, len = derived_key_len; unsigned char c[4]; unsigned char mac[EVP_MAX_MD_SIZE]; unsigned char *out = derived_key; EVP_MD_CTX *ctx = NULL, *ctx_init = NULL; if (z_len > SSKDF_MAX_INLEN || info_len > SSKDF_MAX_INLEN || derived_key_len > SSKDF_MAX_INLEN || derived_key_len == 0) return 0; hlen = EVP_MD_size(kdf_md); if (hlen <= 0) return 0; out_len = (size_t)hlen; ctx = EVP_MD_CTX_create(); ctx_init = EVP_MD_CTX_create(); if (ctx == NULL || ctx_init == NULL) goto end; if (!EVP_DigestInit(ctx_init, kdf_md)) goto end; for (counter = 1;; counter++) { c[0] = (unsigned char)((counter >> 24) & 0xff); c[1] = (unsigned char)((counter >> 16) & 0xff); c[2] = (unsigned char)((counter >> 8) & 0xff); c[3] = (unsigned char)(counter & 0xff); if (!(EVP_MD_CTX_copy_ex(ctx, ctx_init) && EVP_DigestUpdate(ctx, c, sizeof(c)) && EVP_DigestUpdate(ctx, z, z_len) && EVP_DigestUpdate(ctx, info, info_len))) goto end; if (len >= out_len) { if (!EVP_DigestFinal_ex(ctx, out, NULL)) goto end; out += out_len; len -= out_len; if (len == 0) break; } else { if (!EVP_DigestFinal_ex(ctx, mac, NULL)) goto end; memcpy(out, mac, len); break; } } ret = 1; end: EVP_MD_CTX_destroy(ctx); EVP_MD_CTX_destroy(ctx_init); OPENSSL_cleanse(mac, sizeof(mac)); return ret; } crypto/kdf/sskdf.c:127: error: MEMORY_LEAK memory dynamically allocated by call to `EVP_MD_CTX_new()` at line 92, column 11 is not reachable after line 127, column 5. Showing all 66 steps of the trace crypto/kdf/sskdf.c:70:1: start of procedure SSKDF_hash_kdm() 68. * Section 4. One-Step Key Derivation using H(x) = hash(x) 69. */ 70. > static int SSKDF_hash_kdm(const EVP_MD *kdf_md, 71. const unsigned char *z, size_t z_len, 72. const unsigned char *info, size_t info_len, crypto/kdf/sskdf.c:75:5: 73. unsigned char *derived_key, size_t derived_key_len) 74. { 75. > int ret = 0, hlen; 76. size_t counter, out_len, len = derived_key_len; 77. unsigned char c[4]; crypto/kdf/sskdf.c:76:5: 74. { 75. int ret = 0, hlen; 76. > size_t counter, out_len, len = derived_key_len; 77. unsigned char c[4]; 78. unsigned char mac[EVP_MAX_MD_SIZE]; crypto/kdf/sskdf.c:79:5: 77. unsigned char c[4]; 78. unsigned char mac[EVP_MAX_MD_SIZE]; 79. > unsigned char *out = derived_key; 80. EVP_MD_CTX *ctx = NULL, *ctx_init = NULL; 81. crypto/kdf/sskdf.c:80:5: 78. unsigned char mac[EVP_MAX_MD_SIZE]; 79. unsigned char *out = derived_key; 80. > EVP_MD_CTX *ctx = NULL, *ctx_init = NULL; 81. 82. if (z_len > SSKDF_MAX_INLEN || info_len > SSKDF_MAX_INLEN crypto/kdf/sskdf.c:82:9: Taking false branch 80. EVP_MD_CTX *ctx = NULL, *ctx_init = NULL; 81. 82. if (z_len > SSKDF_MAX_INLEN || info_len > SSKDF_MAX_INLEN ^ 83. || derived_key_len > SSKDF_MAX_INLEN 84. || derived_key_len == 0) crypto/kdf/sskdf.c:82:36: Taking false branch 80. EVP_MD_CTX *ctx = NULL, *ctx_init = NULL; 81. 82. if (z_len > SSKDF_MAX_INLEN || info_len > SSKDF_MAX_INLEN ^ 83. || derived_key_len > SSKDF_MAX_INLEN 84. || derived_key_len == 0) crypto/kdf/sskdf.c:83:16: Taking false branch 81. 82. if (z_len > SSKDF_MAX_INLEN || info_len > SSKDF_MAX_INLEN 83. || derived_key_len > SSKDF_MAX_INLEN ^ 84. || derived_key_len == 0) 85. return 0; crypto/kdf/sskdf.c:84:16: Taking false branch 82. if (z_len > SSKDF_MAX_INLEN || info_len > SSKDF_MAX_INLEN 83. || derived_key_len > SSKDF_MAX_INLEN 84. || derived_key_len == 0) ^ 85. return 0; 86. crypto/kdf/sskdf.c:87:5: 85. return 0; 86. 87. > hlen = EVP_MD_size(kdf_md); 88. if (hlen <= 0) 89. return 0; crypto/evp/evp_lib.c:313:1: start of procedure EVP_MD_size() 311. } 312. 313. > int EVP_MD_size(const EVP_MD *md) 314. { 315. if (!md) { crypto/evp/evp_lib.c:315:10: Taking false branch 313. int EVP_MD_size(const EVP_MD *md) 314. { 315. if (!md) { ^ 316. EVPerr(EVP_F_EVP_MD_SIZE, EVP_R_MESSAGE_DIGEST_IS_NULL); 317. return -1; crypto/evp/evp_lib.c:319:5: 317. return -1; 318. } 319. > return md->md_size; 320. } 321. crypto/evp/evp_lib.c:320:1: return from a call to EVP_MD_size 318. } 319. return md->md_size; 320. > } 321. 322. unsigned long EVP_MD_flags(const EVP_MD *md) crypto/kdf/sskdf.c:88:9: Taking false branch 86. 87. hlen = EVP_MD_size(kdf_md); 88. if (hlen <= 0) ^ 89. return 0; 90. out_len = (size_t)hlen; crypto/kdf/sskdf.c:90:5: 88. if (hlen <= 0) 89. return 0; 90. > out_len = (size_t)hlen; 91. 92. ctx = EVP_MD_CTX_create(); crypto/kdf/sskdf.c:92:5: 90. out_len = (size_t)hlen; 91. 92. > ctx = EVP_MD_CTX_create(); 93. ctx_init = EVP_MD_CTX_create(); 94. if (ctx == NULL || ctx_init == NULL) crypto/evp/digest.c:49:1: start of procedure EVP_MD_CTX_new() 47. } 48. 49. > EVP_MD_CTX *EVP_MD_CTX_new(void) 50. { 51. return OPENSSL_zalloc(sizeof(EVP_MD_CTX)); crypto/evp/digest.c:51:5: 49. EVP_MD_CTX *EVP_MD_CTX_new(void) 50. { 51. > return OPENSSL_zalloc(sizeof(EVP_MD_CTX)); 52. } 53. crypto/mem.c:228:1: start of procedure CRYPTO_zalloc() 226. } 227. 228. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:230:5: 228. void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. > void *ret = CRYPTO_malloc(num, file, line); 231. 232. FAILTEST(); crypto/mem.c:192:1: start of procedure CRYPTO_malloc() 190. #endif 191. 192. > void *CRYPTO_malloc(size_t num, const char *file, int line) 193. { 194. void *ret = NULL; crypto/mem.c:194:5: 192. void *CRYPTO_malloc(size_t num, const char *file, int line) 193. { 194. > void *ret = NULL; 195. 196. INCREMENT(malloc_count); crypto/mem.c:197:9: Taking false branch 195. 196. INCREMENT(malloc_count); 197. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) ^ 198. return malloc_impl(num, file, line); 199. crypto/mem.c:200:9: Taking false branch 198. return malloc_impl(num, file, line); 199. 200. if (num == 0) ^ 201. return NULL; 202. crypto/mem.c:204:9: Taking true branch 202. 203. FAILTEST(); 204. if (allow_customize) { ^ 205. /* 206. * Disallow customization after the first allocation. We only set this crypto/mem.c:210:9: 208. * allocation. 209. */ 210. > allow_customize = 0; 211. } 212. #ifndef OPENSSL_NO_CRYPTO_MDEBUG crypto/mem.c:221:5: 219. } 220. #else 221. > (void)(file); (void)(line); 222. ret = malloc(num); 223. #endif crypto/mem.c:221:19: 219. } 220. #else 221. > (void)(file); (void)(line); 222. ret = malloc(num); 223. #endif crypto/mem.c:222:5: 220. #else 221. (void)(file); (void)(line); 222. > ret = malloc(num); 223. #endif 224. crypto/mem.c:225:5: 223. #endif 224. 225. > return ret; 226. } 227. crypto/mem.c:226:1: return from a call to CRYPTO_malloc 224. 225. return ret; 226. > } 227. 228. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:233:9: Taking true branch 231. 232. FAILTEST(); 233. if (ret != NULL) ^ 234. memset(ret, 0, num); 235. return ret; crypto/mem.c:234:9: 232. FAILTEST(); 233. if (ret != NULL) 234. > memset(ret, 0, num); 235. return ret; 236. } crypto/mem.c:235:5: 233. if (ret != NULL) 234. memset(ret, 0, num); 235. > return ret; 236. } 237. crypto/mem.c:236:1: return from a call to CRYPTO_zalloc 234. memset(ret, 0, num); 235. return ret; 236. > } 237. 238. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/evp/digest.c:52:1: return from a call to EVP_MD_CTX_new 50. { 51. return OPENSSL_zalloc(sizeof(EVP_MD_CTX)); 52. > } 53. 54. void EVP_MD_CTX_free(EVP_MD_CTX *ctx) crypto/kdf/sskdf.c:93:5: 91. 92. ctx = EVP_MD_CTX_create(); 93. > ctx_init = EVP_MD_CTX_create(); 94. if (ctx == NULL || ctx_init == NULL) 95. goto end; crypto/evp/digest.c:49:1: start of procedure EVP_MD_CTX_new() 47. } 48. 49. > EVP_MD_CTX *EVP_MD_CTX_new(void) 50. { 51. return OPENSSL_zalloc(sizeof(EVP_MD_CTX)); crypto/evp/digest.c:51:5: 49. EVP_MD_CTX *EVP_MD_CTX_new(void) 50. { 51. > return OPENSSL_zalloc(sizeof(EVP_MD_CTX)); 52. } 53. 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 true branch 195. 196. INCREMENT(malloc_count); 197. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) ^ 198. return malloc_impl(num, file, line); 199. crypto/mem.c:197:32: Taking true branch 195. 196. INCREMENT(malloc_count); 197. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) ^ 198. return malloc_impl(num, file, line); 199. crypto/mem.c:198:9: Skipping __function_pointer__(): unresolved function pointer 196. INCREMENT(malloc_count); 197. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) 198. return malloc_impl(num, file, line); ^ 199. 200. if (num == 0) 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/evp/digest.c:52:1: return from a call to EVP_MD_CTX_new 50. { 51. return OPENSSL_zalloc(sizeof(EVP_MD_CTX)); 52. > } 53. 54. void EVP_MD_CTX_free(EVP_MD_CTX *ctx) crypto/kdf/sskdf.c:94:9: Taking false branch 92. ctx = EVP_MD_CTX_create(); 93. ctx_init = EVP_MD_CTX_create(); 94. if (ctx == NULL || ctx_init == NULL) ^ 95. goto end; 96. crypto/kdf/sskdf.c:94:24: Taking true branch 92. ctx = EVP_MD_CTX_create(); 93. ctx_init = EVP_MD_CTX_create(); 94. if (ctx == NULL || ctx_init == NULL) ^ 95. goto end; 96. crypto/kdf/sskdf.c:126:1: 124. } 125. ret = 1; 126. > end: 127. EVP_MD_CTX_destroy(ctx); 128. EVP_MD_CTX_destroy(ctx_init); crypto/kdf/sskdf.c:127:5: 125. ret = 1; 126. end: 127. > EVP_MD_CTX_destroy(ctx); 128. EVP_MD_CTX_destroy(ctx_init); 129. OPENSSL_cleanse(mac, sizeof(mac)); crypto/evp/digest.c:54:1: start of procedure EVP_MD_CTX_free() 52. } 53. 54. > void EVP_MD_CTX_free(EVP_MD_CTX *ctx) 55. { 56. EVP_MD_CTX_reset(ctx); crypto/evp/digest.c:56:5: Skipping EVP_MD_CTX_reset(): empty list of specs 54. void EVP_MD_CTX_free(EVP_MD_CTX *ctx) 55. { 56. EVP_MD_CTX_reset(ctx); ^ 57. OPENSSL_free(ctx); 58. } crypto/evp/digest.c:57:5: 55. { 56. EVP_MD_CTX_reset(ctx); 57. > OPENSSL_free(ctx); 58. } 59. crypto/mem.c:295:1: start of procedure CRYPTO_free() 293. } 294. 295. > void CRYPTO_free(void *str, const char *file, int line) 296. { 297. INCREMENT(free_count); crypto/mem.c:298:9: Taking true branch 296. { 297. INCREMENT(free_count); 298. if (free_impl != NULL && free_impl != &CRYPTO_free) { ^ 299. free_impl(str, file, line); 300. return; crypto/mem.c:298:30: Taking true branch 296. { 297. INCREMENT(free_count); 298. if (free_impl != NULL && free_impl != &CRYPTO_free) { ^ 299. free_impl(str, file, line); 300. return; crypto/mem.c:299:9: Skipping __function_pointer__(): unresolved function pointer 297. INCREMENT(free_count); 298. if (free_impl != NULL && free_impl != &CRYPTO_free) { 299. free_impl(str, file, line); ^ 300. return; 301. } crypto/mem.c:300:9: 298. if (free_impl != NULL && free_impl != &CRYPTO_free) { 299. free_impl(str, file, line); 300. > return; 301. } 302. crypto/mem.c:314:1: return from a call to CRYPTO_free 312. free(str); 313. #endif 314. > } 315. 316. void CRYPTO_clear_free(void *str, size_t num, const char *file, int line) crypto/evp/digest.c:58:1: return from a call to EVP_MD_CTX_free 56. EVP_MD_CTX_reset(ctx); 57. OPENSSL_free(ctx); 58. > } 59. 60. int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type)
https://github.com/openssl/openssl/blob/905c9a72a708701597891527b422c7f374125c52/crypto/kdf/sskdf.c/#L127
d2a_code_trace_data_44155
static int opt_streamid(const char *opt, const char *arg) { int idx; char *p; char idx_str[16]; av_strlcpy(idx_str, arg, sizeof(idx_str)); p = strchr(idx_str, ':'); if (!p) { fprintf(stderr, "Invalid value '%s' for option '%s', required syntax is 'index:value'\n", arg, opt); exit_program(1); } *p++ = '\0'; idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, INT_MAX); 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; } avconv.c:3348: error: Null Dereference pointer `p` last assigned on line 3348 could be null and is dereferenced at line 3348, column 5. avconv.c:3334:1: start of procedure opt_streamid() 3332. 3333. /* arg format is "output-stream-index:streamid-value". */ 3334. static int opt_streamid(const char *opt, const char *arg) ^ 3335. { 3336. int idx; avconv.c:3340:5: 3338. char idx_str[16]; 3339. 3340. av_strlcpy(idx_str, arg, sizeof(idx_str)); ^ 3341. p = strchr(idx_str, ':'); 3342. if (!p) { libavutil/avstring.c:64:1: start of procedure av_strlcpy() 62. } 63. 64. size_t av_strlcpy(char *dst, const char *src, size_t size) ^ 65. { 66. size_t len = 0; libavutil/avstring.c:66:5: 64. size_t av_strlcpy(char *dst, const char *src, size_t size) 65. { 66. size_t len = 0; ^ 67. while (++len < size && *src) 68. *dst++ = *src++; libavutil/avstring.c:67:12: Loop condition is true. Entering loop body 65. { 66. size_t len = 0; 67. while (++len < size && *src) ^ 68. *dst++ = *src++; 69. if (len <= size) libavutil/avstring.c:67:28: Loop condition is false. Leaving loop 65. { 66. size_t len = 0; 67. while (++len < size && *src) ^ 68. *dst++ = *src++; 69. if (len <= size) libavutil/avstring.c:69:9: Taking true branch 67. while (++len < size && *src) 68. *dst++ = *src++; 69. if (len <= size) ^ 70. *dst = 0; 71. return len + strlen(src) - 1; libavutil/avstring.c:70:9: 68. *dst++ = *src++; 69. if (len <= size) 70. *dst = 0; ^ 71. return len + strlen(src) - 1; 72. } libavutil/avstring.c:71:5: 69. if (len <= size) 70. *dst = 0; 71. return len + strlen(src) - 1; ^ 72. } 73. libavutil/avstring.c:72:1: return from a call to av_strlcpy 70. *dst = 0; 71. return len + strlen(src) - 1; 72. } ^ 73. 74. size_t av_strlcat(char *dst, const char *src, size_t size) avconv.c:3341:5: 3339. 3340. av_strlcpy(idx_str, arg, sizeof(idx_str)); 3341. p = strchr(idx_str, ':'); ^ 3342. if (!p) { 3343. fprintf(stderr, avconv.c:3342:10: Taking true branch 3340. av_strlcpy(idx_str, arg, sizeof(idx_str)); 3341. p = strchr(idx_str, ':'); 3342. if (!p) { ^ 3343. fprintf(stderr, 3344. "Invalid value '%s' for option '%s', required syntax is 'index:value'\n", avconv.c:3343:9: 3341. p = strchr(idx_str, ':'); 3342. if (!p) { 3343. fprintf(stderr, ^ 3344. "Invalid value '%s' for option '%s', required syntax is 'index:value'\n", 3345. arg, opt); avconv.c:3346:9: Skipping exit_program(): empty list of specs 3344. "Invalid value '%s' for option '%s', required syntax is 'index:value'\n", 3345. arg, opt); 3346. exit_program(1); ^ 3347. } 3348. *p++ = '\0'; avconv.c:3348:5: 3346. exit_program(1); 3347. } 3348. *p++ = '\0'; ^ 3349. idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, INT_MAX); 3350. streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1);
https://github.com/libav/libav/blob/eb97dbb05a990266b04830ea8e179e0428656b98/avconv.c/#L3348
d2a_code_trace_data_44156
static inline uint64_t get_val(BitstreamContext *bc, unsigned n) { #ifdef BITSTREAM_READER_LE uint64_t ret = bc->bits & ((UINT64_C(1) << n) - 1); bc->bits >>= n; #else uint64_t ret = bc->bits >> (64 - n); bc->bits <<= n; #endif bc->bits_left -= n; return ret; } libavcodec/takdec.c:324: error: Integer Overflow L2 ([0, +oo] - 1):unsigned32 by call to `bitstream_read_bit`. libavcodec/takdec.c:311:26: Call 309. 310. coding_mode[0] = 311. mode = bitstream_read(bc, 6); ^ 312. 313. for (i = 1; i < wlength; i++) { libavcodec/bitstream.h:183:1: Parameter `bc->bits_left` 181. 182. /* Return n bits from the buffer. n has to be in the 0-32 range. */ 183. static inline uint32_t bitstream_read(BitstreamContext *bc, unsigned n) ^ 184. { 185. if (!n) libavcodec/takdec.c:314:21: Call 312. 313. for (i = 1; i < wlength; i++) { 314. int c = get_unary(bc, 1, 6); ^ 315. 316. switch (c) { libavcodec/unary.h:33:1: Parameter `bc->bits_left` 31. * @return Unary length/index 32. */ 33. static inline int get_unary(BitstreamContext *bc, int stop, int len) ^ 34. { 35. int i; libavcodec/takdec.c:324:28: Call 322. case 3: { 323. /* mode += sign ? (1 - c) : (c - 1) */ 324. int sign = bitstream_read_bit(bc); ^ 325. mode += (-sign ^ (c - 1)) + sign; 326. break; libavcodec/bitstream.h:145:1: Parameter `bc->bits_left` 143. 144. /* Return one bit from the buffer. */ 145. static inline unsigned bitstream_read_bit(BitstreamContext *bc) ^ 146. { 147. if (!bc->bits_left) libavcodec/bitstream.h:150:12: Call 148. refill_64(bc); 149. 150. return get_val(bc, 1); ^ 151. } 152. libavcodec/bitstream.h:130:1: <LHS trace> 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:130:1: Parameter `bc->bits_left` 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:130:1: <RHS trace> 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:130:1: Parameter `n` 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:139:5: Binary operation: ([0, +oo] - 1):unsigned32 by call to `bitstream_read_bit` 137. bc->bits <<= n; 138. #endif 139. bc->bits_left -= n; ^ 140. 141. return ret;
https://github.com/libav/libav/blob/562ef82d6a7f96f6b9da1219a5aaf7d9d7056f1b/libavcodec/bitstream.h/#L139
d2a_code_trace_data_44157
int RAND_pseudo_bytes(unsigned char *buf, int num) { const RAND_METHOD *meth = RAND_get_rand_method(); if (meth->pseudorand != NULL) return meth->pseudorand(buf, num); return -1; } crypto/rand/rand_lib.c:842: error: NULL_DEREFERENCE pointer `meth` last assigned on line 840 could be null and is dereferenced at line 842, column 9. Showing all 14 steps of the trace crypto/rand/rand_lib.c:838:1: start of procedure RAND_pseudo_bytes() 836. 837. #if OPENSSL_API_COMPAT < 0x10100000L 838. > int RAND_pseudo_bytes(unsigned char *buf, int num) 839. { 840. const RAND_METHOD *meth = RAND_get_rand_method(); crypto/rand/rand_lib.c:840:5: 838. int RAND_pseudo_bytes(unsigned char *buf, int num) 839. { 840. > const RAND_METHOD *meth = RAND_get_rand_method(); 841. 842. if (meth->pseudorand != NULL) crypto/rand/rand_lib.c:733:1: start of procedure RAND_get_rand_method() 731. } 732. 733. > const RAND_METHOD *RAND_get_rand_method(void) 734. { 735. const RAND_METHOD *tmp_meth = NULL; crypto/rand/rand_lib.c:735:5: 733. const RAND_METHOD *RAND_get_rand_method(void) 734. { 735. > const RAND_METHOD *tmp_meth = NULL; 736. 737. if (!RUN_ONCE(&rand_init, do_rand_init)) crypto/rand/rand_lib.c:737:10: 735. const RAND_METHOD *tmp_meth = NULL; 736. 737. > if (!RUN_ONCE(&rand_init, do_rand_init)) 738. return NULL; 739. 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:737:10: Condition is false 735. const RAND_METHOD *tmp_meth = NULL; 736. 737. if (!RUN_ONCE(&rand_init, do_rand_init)) ^ 738. return NULL; 739. crypto/rand/rand_lib.c:737:10: Taking true branch 735. const RAND_METHOD *tmp_meth = NULL; 736. 737. if (!RUN_ONCE(&rand_init, do_rand_init)) ^ 738. return NULL; 739. crypto/rand/rand_lib.c:738:9: 736. 737. if (!RUN_ONCE(&rand_init, do_rand_init)) 738. > return NULL; 739. 740. CRYPTO_THREAD_write_lock(rand_meth_lock); crypto/rand/rand_lib.c:761:1: return from a call to RAND_get_rand_method 759. CRYPTO_THREAD_unlock(rand_meth_lock); 760. return tmp_meth; 761. > } 762. 763. #ifndef OPENSSL_NO_ENGINE crypto/rand/rand_lib.c:842:9: 840. const RAND_METHOD *meth = RAND_get_rand_method(); 841. 842. > if (meth->pseudorand != NULL) 843. return meth->pseudorand(buf, num); 844. return -1;
https://github.com/openssl/openssl/blob/1901516a4ba909fff12e0e7815aa2d499f4d6d67/crypto/rand/rand_lib.c/#L842
d2a_code_trace_data_44158
static void pred_block(SnowContext *s, uint8_t *dst, uint8_t *tmp, int stride, int sx, int sy, int b_w, int b_h, BlockNode *block, int plane_index, int w, int h){ if(block->type & BLOCK_INTRA){ int x, y; const int color = block->color[plane_index]; const int color4= color*0x01010101; if(b_w==32){ for(y=0; y < b_h; y++){ *(uint32_t*)&dst[0 + y*stride]= color4; *(uint32_t*)&dst[4 + y*stride]= color4; *(uint32_t*)&dst[8 + y*stride]= color4; *(uint32_t*)&dst[12+ y*stride]= color4; *(uint32_t*)&dst[16+ y*stride]= color4; *(uint32_t*)&dst[20+ y*stride]= color4; *(uint32_t*)&dst[24+ y*stride]= color4; *(uint32_t*)&dst[28+ y*stride]= color4; } }else if(b_w==16){ for(y=0; y < b_h; y++){ *(uint32_t*)&dst[0 + y*stride]= color4; *(uint32_t*)&dst[4 + y*stride]= color4; *(uint32_t*)&dst[8 + y*stride]= color4; *(uint32_t*)&dst[12+ y*stride]= color4; } }else if(b_w==8){ for(y=0; y < b_h; y++){ *(uint32_t*)&dst[0 + y*stride]= color4; *(uint32_t*)&dst[4 + y*stride]= color4; } }else if(b_w==4){ for(y=0; y < b_h; y++){ *(uint32_t*)&dst[0 + y*stride]= color4; } }else{ for(y=0; y < b_h; y++){ for(x=0; x < b_w; x++){ dst[x + y*stride]= color; } } } }else{ uint8_t *src= s->last_picture[block->ref].data[plane_index]; const int scale= plane_index ? s->mv_scale : 2*s->mv_scale; int mx= block->mx*scale; int my= block->my*scale; const int dx= mx&15; const int dy= my&15; const int tab_index= 3 - (b_w>>2) + (b_w>>4); sx += (mx>>4) - (HTAPS_MAX/2-1); sy += (my>>4) - (HTAPS_MAX/2-1); src += sx + sy*stride; if( (unsigned)sx >= w - b_w - (HTAPS_MAX-2) || (unsigned)sy >= h - b_h - (HTAPS_MAX-2)){ ff_emulated_edge_mc(tmp + MB_SIZE, src, stride, b_w+HTAPS_MAX-1, b_h+HTAPS_MAX-1, sx, sy, w, h); src= tmp + MB_SIZE; } assert(b_w>1 && b_h>1); assert((tab_index>=0 && tab_index<4) || b_w==32); if((dx&3) || (dy&3) || !(b_w == b_h || 2*b_w == b_h || b_w == 2*b_h) || (b_w&(b_w-1)) || !s->plane[plane_index].fast_mc ) mc_block(&s->plane[plane_index], dst, src, tmp, stride, b_w, b_h, dx, dy); else if(b_w==32){ int y; for(y=0; y<b_h; y+=16){ s->dsp.put_h264_qpel_pixels_tab[0][dy+(dx>>2)](dst + y*stride, src + 3 + (y+3)*stride,stride); s->dsp.put_h264_qpel_pixels_tab[0][dy+(dx>>2)](dst + 16 + y*stride, src + 19 + (y+3)*stride,stride); } }else if(b_w==b_h) s->dsp.put_h264_qpel_pixels_tab[tab_index ][dy+(dx>>2)](dst,src + 3 + 3*stride,stride); else if(b_w==2*b_h){ s->dsp.put_h264_qpel_pixels_tab[tab_index+1][dy+(dx>>2)](dst ,src + 3 + 3*stride,stride); s->dsp.put_h264_qpel_pixels_tab[tab_index+1][dy+(dx>>2)](dst+b_h,src + 3 + b_h + 3*stride,stride); }else{ assert(2*b_w==b_h); s->dsp.put_h264_qpel_pixels_tab[tab_index ][dy+(dx>>2)](dst ,src + 3 + 3*stride ,stride); s->dsp.put_h264_qpel_pixels_tab[tab_index ][dy+(dx>>2)](dst+b_w*stride,src + 3 + 3*stride+b_w*stride,stride); } } } libavcodec/snow.c:2372: error: Buffer Overrun L2 Offset: [0, 18] Size: 16. libavcodec/snow.c:2302:1: <Offset trace> 2300. mca( 8, 8,8) 2301. 2302. static void pred_block(SnowContext *s, uint8_t *dst, uint8_t *tmp, int stride, int sx, int sy, int b_w, int b_h, BlockNode *block, int plane_index, int w, int h){ ^ 2303. if(block->type & BLOCK_INTRA){ 2304. int x, y; libavcodec/snow.c:2302:1: Parameter `s->mv_scale` 2300. mca( 8, 8,8) 2301. 2302. static void pred_block(SnowContext *s, uint8_t *dst, uint8_t *tmp, int stride, int sx, int sy, int b_w, int b_h, BlockNode *block, int plane_index, int w, int h){ ^ 2303. if(block->type & BLOCK_INTRA){ 2304. int x, y; libavcodec/snow.c:2343:26: Assignment 2341. }else{ 2342. uint8_t *src= s->last_picture[block->ref].data[plane_index]; 2343. const int scale= plane_index ? s->mv_scale : 2*s->mv_scale; ^ 2344. int mx= block->mx*scale; 2345. int my= block->my*scale; libavcodec/snow.c:2343:9: Assignment 2341. }else{ 2342. uint8_t *src= s->last_picture[block->ref].data[plane_index]; 2343. const int scale= plane_index ? s->mv_scale : 2*s->mv_scale; ^ 2344. int mx= block->mx*scale; 2345. int my= block->my*scale; libavcodec/snow.c:2344:9: Assignment 2342. uint8_t *src= s->last_picture[block->ref].data[plane_index]; 2343. const int scale= plane_index ? s->mv_scale : 2*s->mv_scale; 2344. int mx= block->mx*scale; ^ 2345. int my= block->my*scale; 2346. const int dx= mx&15; libavcodec/snow.c:2346:9: Assignment 2344. int mx= block->mx*scale; 2345. int my= block->my*scale; 2346. const int dx= mx&15; ^ 2347. const int dy= my&15; 2348. const int tab_index= 3 - (b_w>>2) + (b_w>>4); libavcodec/snow.c:2302:1: <Length trace> 2300. mca( 8, 8,8) 2301. 2302. static void pred_block(SnowContext *s, uint8_t *dst, uint8_t *tmp, int stride, int sx, int sy, int b_w, int b_h, BlockNode *block, int plane_index, int w, int h){ ^ 2303. if(block->type & BLOCK_INTRA){ 2304. int x, y; libavcodec/snow.c:2302:1: Parameter `s->dsp.put_h264_qpel_pixels_tab[*][*]` 2300. mca( 8, 8,8) 2301. 2302. static void pred_block(SnowContext *s, uint8_t *dst, uint8_t *tmp, int stride, int sx, int sy, int b_w, int b_h, BlockNode *block, int plane_index, int w, int h){ ^ 2303. if(block->type & BLOCK_INTRA){ 2304. int x, y; libavcodec/snow.c:2372:13: Array access: Offset: [0, 18] Size: 16 2370. s->dsp.put_h264_qpel_pixels_tab[tab_index ][dy+(dx>>2)](dst,src + 3 + 3*stride,stride); 2371. else if(b_w==2*b_h){ 2372. s->dsp.put_h264_qpel_pixels_tab[tab_index+1][dy+(dx>>2)](dst ,src + 3 + 3*stride,stride); ^ 2373. s->dsp.put_h264_qpel_pixels_tab[tab_index+1][dy+(dx>>2)](dst+b_h,src + 3 + b_h + 3*stride,stride); 2374. }else{
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/snow.c/#L2372
d2a_code_trace_data_44159
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/extensions_srvr.c:802: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [`pkt->written`, `pkt->written` + 6]):unsigned64 by call to `WPACKET_sub_memcpy__`. Showing all 16 steps of the trace ssl/statem/extensions_srvr.c:786:1: Parameter `pkt->written` 784. 785. #ifndef OPENSSL_NO_NEXTPROTONEG 786. > int tls_construct_stoc_next_proto_neg(SSL *s, WPACKET *pkt, X509 *x, 787. size_t chainidx, int *al) 788. { ssl/statem/extensions_srvr.c:801:14: Call 799. s->ctx->ext.npn_advertised_cb_arg); 800. if (ret == SSL_TLSEXT_ERR_OK) { 801. if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_next_proto_neg) ^ 802. || !WPACKET_sub_memcpy_u16(pkt, npa, npalen)) { 803. SSLerr(SSL_F_TLS_CONSTRUCT_STOC_NEXT_PROTO_NEG, ssl/packet.c:289:1: Parameter `pkt->written` 287. } 288. 289. > int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size) 290. { 291. unsigned char *data; ssl/statem/extensions_srvr.c:802:21: Call 800. if (ret == SSL_TLSEXT_ERR_OK) { 801. if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_next_proto_neg) 802. || !WPACKET_sub_memcpy_u16(pkt, npa, npalen)) { ^ 803. SSLerr(SSL_F_TLS_CONSTRUCT_STOC_NEXT_PROTO_NEG, 804. ERR_R_INTERNAL_ERROR); 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->buf->length` 250. } 251. 252. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes) 253. { 254. WPACKET_SUB *sub; ssl/packet.c:349:17: Call 347. { 348. if (!WPACKET_start_sub_packet_len__(pkt, lenbytes) 349. || !WPACKET_memcpy(pkt, src, len) ^ 350. || !WPACKET_close(pkt)) 351. return 0; ssl/packet.c:330:1: Parameter `pkt->written` 328. } 329. 330. > int WPACKET_memcpy(WPACKET *pkt, const void *src, size_t len) 331. { 332. unsigned char *dest; ssl/packet.c:337:10: Call 335. return 1; 336. 337. if (!WPACKET_allocate_bytes(pkt, len, &dest)) ^ 338. return 0; 339. 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 + 6]):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_44160
static void pred8x8l_vertical_right_c(uint8_t *src, int has_topleft, int has_topright, int stride) { PREDICT_8x8_LOAD_TOP; PREDICT_8x8_LOAD_LEFT; PREDICT_8x8_LOAD_TOPLEFT; SRC(0,6)= (l5 + 2*l4 + l3 + 2) >> 2; SRC(0,7)= (l6 + 2*l5 + l4 + 2) >> 2; SRC(0,4)=SRC(1,6)= (l3 + 2*l2 + l1 + 2) >> 2; SRC(0,5)=SRC(1,7)= (l4 + 2*l3 + l2 + 2) >> 2; SRC(0,2)=SRC(1,4)=SRC(2,6)= (l1 + 2*l0 + lt + 2) >> 2; SRC(0,3)=SRC(1,5)=SRC(2,7)= (l2 + 2*l1 + l0 + 2) >> 2; SRC(0,1)=SRC(1,3)=SRC(2,5)=SRC(3,7)= (l0 + 2*lt + t0 + 2) >> 2; SRC(0,0)=SRC(1,2)=SRC(2,4)=SRC(3,6)= (lt + t0 + 1) >> 1; SRC(1,1)=SRC(2,3)=SRC(3,5)=SRC(4,7)= (lt + 2*t0 + t1 + 2) >> 2; SRC(1,0)=SRC(2,2)=SRC(3,4)=SRC(4,6)= (t0 + t1 + 1) >> 1; SRC(2,1)=SRC(3,3)=SRC(4,5)=SRC(5,7)= (t0 + 2*t1 + t2 + 2) >> 2; SRC(2,0)=SRC(3,2)=SRC(4,4)=SRC(5,6)= (t1 + t2 + 1) >> 1; SRC(3,1)=SRC(4,3)=SRC(5,5)=SRC(6,7)= (t1 + 2*t2 + t3 + 2) >> 2; SRC(3,0)=SRC(4,2)=SRC(5,4)=SRC(6,6)= (t2 + t3 + 1) >> 1; SRC(4,1)=SRC(5,3)=SRC(6,5)=SRC(7,7)= (t2 + 2*t3 + t4 + 2) >> 2; SRC(4,0)=SRC(5,2)=SRC(6,4)=SRC(7,6)= (t3 + t4 + 1) >> 1; SRC(5,1)=SRC(6,3)=SRC(7,5)= (t3 + 2*t4 + t5 + 2) >> 2; SRC(5,0)=SRC(6,2)=SRC(7,4)= (t4 + t5 + 1) >> 1; SRC(6,1)=SRC(7,3)= (t4 + 2*t5 + t6 + 2) >> 2; SRC(6,0)=SRC(7,2)= (t5 + t6 + 1) >> 1; SRC(7,1)= (t5 + 2*t6 + t7 + 2) >> 2; SRC(7,0)= (t6 + t7 + 1) >> 1; } libavcodec/h264pred.c:899: error: Uninitialized Value The value read from t7 was never initialized. libavcodec/h264pred.c:899:5: 897. SRC(6,1)=SRC(7,3)= (t4 + 2*t5 + t6 + 2) >> 2; 898. SRC(6,0)=SRC(7,2)= (t5 + t6 + 1) >> 1; 899. SRC(7,1)= (t5 + 2*t6 + t7 + 2) >> 2; ^ 900. SRC(7,0)= (t6 + t7 + 1) >> 1; 901. }
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/h264pred.c/#L899
d2a_code_trace_data_44161
static void frame_end(MpegEncContext *s) { int i; if (s->unrestricted_mv && s->current_picture.reference && !s->intra_only) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->avctx->pix_fmt); int hshift = desc->log2_chroma_w; int vshift = desc->log2_chroma_h; s->dsp.draw_edges(s->current_picture.f->data[0], s->linesize, s->h_edge_pos, s->v_edge_pos, EDGE_WIDTH, EDGE_WIDTH, EDGE_TOP | EDGE_BOTTOM); s->dsp.draw_edges(s->current_picture.f->data[1], s->uvlinesize, s->h_edge_pos >> hshift, s->v_edge_pos >> vshift, EDGE_WIDTH >> hshift, EDGE_WIDTH >> vshift, EDGE_TOP | EDGE_BOTTOM); s->dsp.draw_edges(s->current_picture.f->data[2], s->uvlinesize, s->h_edge_pos >> hshift, s->v_edge_pos >> vshift, EDGE_WIDTH >> hshift, EDGE_WIDTH >> vshift, EDGE_TOP | EDGE_BOTTOM); } emms_c(); s->last_pict_type = s->pict_type; s->last_lambda_for [s->pict_type] = s->current_picture_ptr->f->quality; if (s->pict_type!= AV_PICTURE_TYPE_B) s->last_non_b_pict_type = s->pict_type; if (s->encoding) { for (i = 0; i < MAX_PICTURE_COUNT; i++) { if (!s->picture[i].reference) ff_mpeg_unref_picture(s, &s->picture[i]); } } s->avctx->coded_frame = s->current_picture_ptr->f; } libavcodec/mpegvideo_enc.c:1356: error: Null Dereference pointer `desc` last assigned on line 1355 could be null and is dereferenced at line 1356, column 22. libavcodec/mpegvideo_enc.c:1348:1: start of procedure frame_end() 1346. } 1347. 1348. static void frame_end(MpegEncContext *s) ^ 1349. { 1350. int i; libavcodec/mpegvideo_enc.c:1352:9: Taking true branch 1350. int i; 1351. 1352. if (s->unrestricted_mv && ^ 1353. s->current_picture.reference && 1354. !s->intra_only) { libavcodec/mpegvideo_enc.c:1353:9: Taking true branch 1351. 1352. if (s->unrestricted_mv && 1353. s->current_picture.reference && ^ 1354. !s->intra_only) { 1355. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->avctx->pix_fmt); libavcodec/mpegvideo_enc.c:1354:10: Taking true branch 1352. if (s->unrestricted_mv && 1353. s->current_picture.reference && 1354. !s->intra_only) { ^ 1355. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->avctx->pix_fmt); 1356. int hshift = desc->log2_chroma_w; libavcodec/mpegvideo_enc.c:1355:9: 1353. s->current_picture.reference && 1354. !s->intra_only) { 1355. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->avctx->pix_fmt); ^ 1356. int hshift = desc->log2_chroma_w; 1357. int vshift = desc->log2_chroma_h; libavutil/pixdesc.c:1570:1: start of procedure av_pix_fmt_desc_get() 1568. } 1569. 1570. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt) ^ 1571. { 1572. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) libavutil/pixdesc.c:1572:9: Taking false branch 1570. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt) 1571. { 1572. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) ^ 1573. return NULL; 1574. return &av_pix_fmt_descriptors[pix_fmt]; libavutil/pixdesc.c:1572:24: Taking true branch 1570. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt) 1571. { 1572. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) ^ 1573. return NULL; 1574. return &av_pix_fmt_descriptors[pix_fmt]; libavutil/pixdesc.c:1573:9: 1571. { 1572. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) 1573. return NULL; ^ 1574. return &av_pix_fmt_descriptors[pix_fmt]; 1575. } libavutil/pixdesc.c:1575:1: return from a call to av_pix_fmt_desc_get 1573. return NULL; 1574. return &av_pix_fmt_descriptors[pix_fmt]; 1575. } ^ 1576. 1577. const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev) libavcodec/mpegvideo_enc.c:1356:9: 1354. !s->intra_only) { 1355. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->avctx->pix_fmt); 1356. int hshift = desc->log2_chroma_w; ^ 1357. int vshift = desc->log2_chroma_h; 1358. s->dsp.draw_edges(s->current_picture.f->data[0], s->linesize,
https://github.com/libav/libav/blob/71c32ed5335add04cbe44896f4b3d748b9b1153c/libavcodec/mpegvideo_enc.c/#L1356
d2a_code_trace_data_44162
BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) { bn_check_top(b); if (a == b) return a; if (bn_wexpand(a, b->top) == NULL) return NULL; if (b->top > 0) memcpy(a->d, b->d, sizeof(b->d[0]) * b->top); a->neg = b->neg; a->top = b->top; a->flags |= b->flags & BN_FLG_FIXED_TOP; bn_check_top(a); return a; } crypto/ec/ec_curve.c:3273: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, 67108856] by call to `EC_GROUP_get_order`. Showing all 14 steps of the trace crypto/ec/ec_curve.c:3213:1: Parameter `group->order->top` 3211. * if not found. If there was an error it returns -1. 3212. */ 3213. > int ec_curve_nid_from_params(const EC_GROUP *group) 3214. { 3215. int ret = -1, nid, len, field_type, param_len; crypto/ec/ec_curve.c:3248:17: Call 3246. * EC group order, whichever is larger. 3247. */ 3248. param_len = BN_num_bytes(group->order); ^ 3249. len = BN_num_bytes(group->field); 3250. if (len > param_len) crypto/bn/bn_lib.c:140:9: Call 138. bn_check_top(a); 139. 140. if (BN_is_zero(a)) ^ 141. return 0; 142. return ((i * BN_BITS2) + BN_num_bits_word(a->d[i])); crypto/bn/bn_lib.c:866:1: Parameter `a->top` 864. } 865. 866. > int BN_is_zero(const BIGNUM *a) 867. { 868. return a->top == 0; crypto/ec/ec_curve.c:3273:12: Call 3271. && EC_POINT_get_affine_coordinates(group, generator, bn[3], bn[4], ctx) 3272. /* Get order */ 3273. && EC_GROUP_get_order(group, bn[5], ctx))) ^ 3274. goto end; 3275. crypto/ec/ec_lib.c:322:1: Parameter `group->order->top` 320. } 321. 322. > int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx) 323. { 324. if (group->order == NULL) crypto/ec/ec_lib.c:326:10: Call 324. if (group->order == NULL) 325. return 0; 326. if (!BN_copy(order, group->order)) ^ 327. return 0; 328. 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, 67108856] by call to `EC_GROUP_get_order` 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/3bbec1afed1c65b6f7f645b27808b070e6e7a509/crypto/bn/bn_lib.c/#L291
d2a_code_trace_data_44163
static int test_exdata(void) { MYOBJ *t1, *t2, *t3; MYOBJ_EX_DATA *ex_data; const char *cp; char *p; gbl_result = 1; p = OPENSSL_strdup("hello world"); saved_argl = 21; saved_argp = OPENSSL_malloc(1); saved_idx = CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_APP, saved_argl, saved_argp, exnew, exdup, exfree); saved_idx2 = CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_APP, saved_argl, saved_argp, exnew2, exdup2, exfree2); t1 = MYOBJ_new(); t2 = MYOBJ_new(); if (!TEST_int_eq(t1->st, 1) || !TEST_int_eq(t2->st, 1)) return 0; if (!TEST_ptr(CRYPTO_get_ex_data(&t1->ex_data, saved_idx2))) return 0; if (!TEST_ptr(CRYPTO_get_ex_data(&t2->ex_data, saved_idx2))) return 0; MYOBJ_sethello(t1, p); cp = MYOBJ_gethello(t1); if (!TEST_ptr_eq(cp, p)) return 0; MYOBJ_sethello2(t1, p); cp = MYOBJ_gethello2(t1); if (!TEST_ptr_eq(cp, p)) return 0; cp = MYOBJ_gethello(t2); if (!TEST_ptr_null(cp)) return 0; cp = MYOBJ_gethello2(t2); if (!TEST_ptr_null(cp)) return 0; t3 = MYOBJ_dup(t1); if (!TEST_int_eq(t3->st, 1)) return 0; ex_data = CRYPTO_get_ex_data(&t3->ex_data, saved_idx2); if (!TEST_ptr(ex_data)) return 0; if (!TEST_int_eq(ex_data->dup, 1)) return 0; cp = MYOBJ_gethello(t3); if (!TEST_ptr_eq(cp, p)) return 0; cp = MYOBJ_gethello2(t3); if (!TEST_ptr_eq(cp, p)) return 0; MYOBJ_free(t1); MYOBJ_free(t2); MYOBJ_free(t3); OPENSSL_free(saved_argp); OPENSSL_free(p); if (gbl_result) return 1; else return 0; } test/exdatatest.c:206: error: MEMORY_LEAK memory dynamically allocated by call to `CRYPTO_strdup()` at line 195, column 9 is not reachable after line 206, column 10. Showing all 47 steps of the trace test/exdatatest.c:186:1: start of procedure test_exdata() 184. } 185. 186. > static int test_exdata(void) 187. { 188. MYOBJ *t1, *t2, *t3; test/exdatatest.c:193:5: 191. char *p; 192. 193. > gbl_result = 1; 194. 195. p = OPENSSL_strdup("hello world"); test/exdatatest.c:195:5: 193. gbl_result = 1; 194. 195. > p = OPENSSL_strdup("hello world"); 196. saved_argl = 21; 197. saved_argp = OPENSSL_malloc(1); 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:158:1: start of procedure CRYPTO_malloc() 156. #endif 157. 158. > void *CRYPTO_malloc(size_t num, const char *file, int line) 159. { 160. void *ret = NULL; crypto/mem.c:160:5: 158. void *CRYPTO_malloc(size_t num, const char *file, int line) 159. { 160. > void *ret = NULL; 161. 162. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) crypto/mem.c:162:9: Taking false branch 160. void *ret = NULL; 161. 162. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) ^ 163. return malloc_impl(num, file, line); 164. crypto/mem.c:165:9: Taking false branch 163. return malloc_impl(num, file, line); 164. 165. if (num == 0) ^ 166. return NULL; 167. crypto/mem.c:169:5: 167. 168. FAILTEST(); 169. > allow_customize = 0; 170. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 171. if (call_malloc_debug) { crypto/mem.c:179:5: 177. } 178. #else 179. > osslargused(file); osslargused(line); 180. ret = malloc(num); 181. #endif crypto/mem.c:179:24: 177. } 178. #else 179. > osslargused(file); osslargused(line); 180. ret = malloc(num); 181. #endif crypto/mem.c:180:5: 178. #else 179. osslargused(file); osslargused(line); 180. > ret = malloc(num); 181. #endif 182. crypto/mem.c:183:5: 181. #endif 182. 183. > return ret; 184. } 185. crypto/mem.c:184:1: return from a call to CRYPTO_malloc 182. 183. return ret; 184. > } 185. 186. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/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) test/exdatatest.c:196:5: 194. 195. p = OPENSSL_strdup("hello world"); 196. > saved_argl = 21; 197. saved_argp = OPENSSL_malloc(1); 198. saved_idx = CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_APP, test/exdatatest.c:197:5: 195. p = OPENSSL_strdup("hello world"); 196. saved_argl = 21; 197. > saved_argp = OPENSSL_malloc(1); 198. saved_idx = CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_APP, 199. saved_argl, saved_argp, crypto/mem.c:158:1: start of procedure CRYPTO_malloc() 156. #endif 157. 158. > void *CRYPTO_malloc(size_t num, const char *file, int line) 159. { 160. void *ret = NULL; crypto/mem.c:160:5: 158. void *CRYPTO_malloc(size_t num, const char *file, int line) 159. { 160. > void *ret = NULL; 161. 162. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) crypto/mem.c:162:9: Taking false branch 160. void *ret = NULL; 161. 162. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) ^ 163. return malloc_impl(num, file, line); 164. crypto/mem.c:165:9: Taking false branch 163. return malloc_impl(num, file, line); 164. 165. if (num == 0) ^ 166. return NULL; 167. crypto/mem.c:169:5: 167. 168. FAILTEST(); 169. > allow_customize = 0; 170. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 171. if (call_malloc_debug) { crypto/mem.c:179:5: 177. } 178. #else 179. > osslargused(file); osslargused(line); 180. ret = malloc(num); 181. #endif crypto/mem.c:179:24: 177. } 178. #else 179. > osslargused(file); osslargused(line); 180. ret = malloc(num); 181. #endif crypto/mem.c:180:5: 178. #else 179. osslargused(file); osslargused(line); 180. > ret = malloc(num); 181. #endif 182. crypto/mem.c:183:5: 181. #endif 182. 183. > return ret; 184. } 185. crypto/mem.c:184:1: return from a call to CRYPTO_malloc 182. 183. return ret; 184. > } 185. 186. void *CRYPTO_zalloc(size_t num, const char *file, int line) test/exdatatest.c:198:5: Skipping CRYPTO_get_ex_new_index(): empty list of specs 196. saved_argl = 21; 197. saved_argp = OPENSSL_malloc(1); 198. saved_idx = CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_APP, ^ 199. saved_argl, saved_argp, 200. exnew, exdup, exfree); test/exdatatest.c:201:5: Skipping CRYPTO_get_ex_new_index(): empty list of specs 199. saved_argl, saved_argp, 200. exnew, exdup, exfree); 201. saved_idx2 = CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_APP, ^ 202. saved_argl, saved_argp, 203. exnew2, exdup2, exfree2); test/exdatatest.c:204:5: Skipping MYOBJ_new(): empty list of specs 202. saved_argl, saved_argp, 203. exnew2, exdup2, exfree2); 204. t1 = MYOBJ_new(); ^ 205. t2 = MYOBJ_new(); 206. if (!TEST_int_eq(t1->st, 1) || !TEST_int_eq(t2->st, 1)) test/exdatatest.c:205:5: Skipping MYOBJ_new(): empty list of specs 203. exnew2, exdup2, exfree2); 204. t1 = MYOBJ_new(); 205. t2 = MYOBJ_new(); ^ 206. if (!TEST_int_eq(t1->st, 1) || !TEST_int_eq(t2->st, 1)) 207. return 0; test/exdatatest.c:206:10: 204. t1 = MYOBJ_new(); 205. t2 = MYOBJ_new(); 206. > if (!TEST_int_eq(t1->st, 1) || !TEST_int_eq(t2->st, 1)) 207. return 0; 208. if (!TEST_ptr(CRYPTO_get_ex_data(&t1->ex_data, saved_idx2))) test/testutil/tests.c:588:1: start of procedure test_int_eq() 586. DEFINE_COMPARISON(type, name, ge, >=, fmt) 587. 588. > DEFINE_COMPARISONS(int, int, "%d") 589. DEFINE_COMPARISONS(unsigned int, uint, "%u") 590. DEFINE_COMPARISONS(char, char, "%c") test/testutil/tests.c:588:1: Taking false branch 586. DEFINE_COMPARISON(type, name, ge, >=, fmt) 587. 588. > DEFINE_COMPARISONS(int, int, "%d") 589. DEFINE_COMPARISONS(unsigned int, uint, "%u") 590. DEFINE_COMPARISONS(char, char, "%c") test/testutil/tests.c:492:1: start of procedure test_fail_message() 490. } 491. 492. > static void test_fail_message(const char *prefix, const char *file, 493. int line, const char *type, 494. const char *left, const char *right, test/testutil/tests.c:499:5: 497. va_list ap; 498. 499. > va_start(ap, fmt); 500. test_fail_message_va(prefix, file, line, type, left, right, op, fmt, ap); 501. va_end(ap); test/testutil/tests.c:500:5: Skipping test_fail_message_va(): empty list of specs 498. 499. va_start(ap, fmt); 500. test_fail_message_va(prefix, file, line, type, left, right, op, fmt, ap); ^ 501. va_end(ap); 502. } test/testutil/tests.c:501:5: 499. va_start(ap, fmt); 500. test_fail_message_va(prefix, file, line, type, left, right, op, fmt, ap); 501. > va_end(ap); 502. } 503. test/testutil/tests.c:502:1: return from a call to test_fail_message 500. test_fail_message_va(prefix, file, line, type, left, right, op, fmt, ap); 501. va_end(ap); 502. > } 503. 504. void test_info_c90(const char *desc, ...) test/testutil/tests.c:588:1: return from a call to test_int_eq 586. DEFINE_COMPARISON(type, name, ge, >=, fmt) 587. 588. > DEFINE_COMPARISONS(int, int, "%d") 589. DEFINE_COMPARISONS(unsigned int, uint, "%u") 590. DEFINE_COMPARISONS(char, char, "%c") test/exdatatest.c:206:10: Taking true branch 204. t1 = MYOBJ_new(); 205. t2 = MYOBJ_new(); 206. if (!TEST_int_eq(t1->st, 1) || !TEST_int_eq(t2->st, 1)) ^ 207. return 0; 208. if (!TEST_ptr(CRYPTO_get_ex_data(&t1->ex_data, saved_idx2)))
https://github.com/openssl/openssl/blob/1ded2dd3ee9389b412e2ef0cf8e0b40a4ed3179b/test/exdatatest.c/#L206
d2a_code_trace_data_44164
int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack, const char *dir) { DIR *d; struct dirent *dstruct; int ret = 0; CRYPTO_w_lock(CRYPTO_LOCK_READDIR); d = opendir(dir); if(!d) { SYSerr(SYS_F_OPENDIR, get_last_sys_error()); ERR_add_error_data(3, "opendir('", dir, "')"); SSLerr(SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK, ERR_R_SYS_LIB); goto err; } while((dstruct=readdir(d))) { char buf[1024]; int r; if(strlen(dir)+strlen(dstruct->d_name)+2 > sizeof buf) { SSLerr(SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK,SSL_R_PATH_TOO_LONG); goto err; } r = BIO_snprintf(buf,sizeof buf,"%s/%s",dir,dstruct->d_name); if (r <= 0 || r >= sizeof buf) goto err; if(!SSL_add_file_cert_subjects_to_stack(stack,buf)) goto err; } ret = 1; err: CRYPTO_w_unlock(CRYPTO_LOCK_READDIR); return ret; } ssl/ssl_cert.c:768: error: RESOURCE_LEAK resource acquired by call to `opendir()` at line 745, column 6 is not released after line 768, column 7. Showing all 15 steps of the trace ssl/ssl_cert.c:737:1: start of procedure SSL_add_dir_cert_subjects_to_stack() 735. #ifndef OPENSSL_SYS_MACINTOSH_CLASSIC /* XXXXX: Better scheme needed! */ 736. 737. > int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack, 738. const char *dir) 739. { ssl/ssl_cert.c:742:2: 740. DIR *d; 741. struct dirent *dstruct; 742. > int ret = 0; 743. 744. CRYPTO_w_lock(CRYPTO_LOCK_READDIR); ssl/ssl_cert.c:744:2: 742. int ret = 0; 743. 744. > CRYPTO_w_lock(CRYPTO_LOCK_READDIR); 745. d = opendir(dir); 746. crypto/cryptlib.c:379:1: start of procedure CRYPTO_lock() 377. } 378. 379. > void CRYPTO_lock(int mode, int type, const char *file, int line) 380. { 381. #ifdef LOCK_DEBUG crypto/cryptlib.c:404:6: Taking false branch 402. } 403. #endif 404. if (type < 0) ^ 405. { 406. struct CRYPTO_dynlock_value *pointer crypto/cryptlib.c:417:7: Taking true branch 415. } 416. else 417. if (locking_callback != NULL) ^ 418. locking_callback(mode,type,file,line); 419. } crypto/cryptlib.c:418:4: Skipping __function_pointer__(): unresolved function pointer 416. else 417. if (locking_callback != NULL) 418. locking_callback(mode,type,file,line); ^ 419. } 420. crypto/cryptlib.c:404:2: 402. } 403. #endif 404. > if (type < 0) 405. { 406. struct CRYPTO_dynlock_value *pointer crypto/cryptlib.c:419:2: return from a call to CRYPTO_lock 417. if (locking_callback != NULL) 418. locking_callback(mode,type,file,line); 419. } ^ 420. 421. int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file, ssl/ssl_cert.c:745:2: 743. 744. CRYPTO_w_lock(CRYPTO_LOCK_READDIR); 745. > d = opendir(dir); 746. 747. /* Note that a side effect is that the CAs will be sorted by name */ ssl/ssl_cert.c:748:6: Taking false branch 746. 747. /* Note that a side effect is that the CAs will be sorted by name */ 748. if(!d) ^ 749. { 750. SYSerr(SYS_F_OPENDIR, get_last_sys_error()); ssl/ssl_cert.c:756:9: Loop condition is true. Entering loop body 754. } 755. 756. while((dstruct=readdir(d))) ^ 757. { 758. char buf[1024]; ssl/ssl_cert.c:761:6: Taking false branch 759. int r; 760. 761. if(strlen(dir)+strlen(dstruct->d_name)+2 > sizeof buf) ^ 762. { 763. SSLerr(SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK,SSL_R_PATH_TOO_LONG); ssl/ssl_cert.c:767:3: Skipping BIO_snprintf(): empty list of specs 765. } 766. 767. r = BIO_snprintf(buf,sizeof buf,"%s/%s",dir,dstruct->d_name); ^ 768. if (r <= 0 || r >= sizeof buf) 769. goto err; ssl/ssl_cert.c:768:7: Taking true branch 766. 767. r = BIO_snprintf(buf,sizeof buf,"%s/%s",dir,dstruct->d_name); 768. if (r <= 0 || r >= sizeof buf) ^ 769. goto err; 770. if(!SSL_add_file_cert_subjects_to_stack(stack,buf))
https://github.com/openssl/openssl/blob/4bf4bc784f12bcdc3a3e772f85f6d33f5eccdab3/ssl/ssl_cert.c/#L768
d2a_code_trace_data_44165
int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int align) { int line_size; int sample_size = av_get_bytes_per_sample(sample_fmt); int planar = av_sample_fmt_is_planar(sample_fmt); if (!sample_size || nb_samples <= 0 || nb_channels <= 0) return AVERROR(EINVAL); if (!align) { if (nb_samples > INT_MAX - 31) return AVERROR(EINVAL); align = 1; nb_samples = FFALIGN(nb_samples, 32); } if (nb_channels > INT_MAX / align || (int64_t)nb_channels * nb_samples > (INT_MAX - (align * nb_channels)) / sample_size) return AVERROR(EINVAL); line_size = planar ? FFALIGN(nb_samples * sample_size, align) : FFALIGN(nb_samples * sample_size * nb_channels, align); if (linesize) *linesize = line_size; return planar ? line_size * nb_channels : line_size; } libavcodec/flashsv.c:473: error: Integer Overflow L2 ([1, 2147483616] + 32):signed32 by call to `av_frame_ref`. libavcodec/flashsv.c:452:21: Call 450. /* skip unchanged blocks, which have size 0 */ 451. if (size) { 452. if (flashsv_decode_block(avctx, avpkt, &gb, size, ^ 453. cur_blk_width, cur_blk_height, 454. x_pos, y_pos, libavcodec/flashsv.c:185:15: Unknown value from: inflateReset 183. uint8_t *line = s->tmpblock; 184. int k; 185. int ret = inflateReset(&s->zstream); ^ 186. if (ret != Z_OK) { 187. av_log(avctx, AV_LOG_ERROR, "Inflate reset error: %d\n", ret); libavcodec/flashsv.c:473:16: Call 471. } 472. 473. if ((ret = av_frame_ref(data, s->frame)) < 0) ^ 474. return ret; 475. libavutil/frame.c:174:1: Parameter `src->nb_samples` 172. } 173. 174. int av_frame_ref(AVFrame *dst, const AVFrame *src) ^ 175. { 176. int i, ret = 0; libavutil/frame.c:182:5: Assignment 180. dst->height = src->height; 181. dst->channel_layout = src->channel_layout; 182. dst->nb_samples = src->nb_samples; ^ 183. 184. ret = av_frame_copy_props(dst, src); libavutil/frame.c:190:15: Call 188. /* duplicate the frame data if it's not refcounted */ 189. if (!src->buf[0]) { 190. ret = av_frame_get_buffer(dst, 32); ^ 191. if (ret < 0) 192. return ret; libavutil/frame.c:161:1: Parameter `frame->nb_samples` 159. } 160. 161. int av_frame_get_buffer(AVFrame *frame, int align) ^ 162. { 163. if (frame->format < 0) libavutil/frame.c:169:16: Call 167. return get_video_buffer(frame, align); 168. else if (frame->nb_samples > 0 && frame->channel_layout) 169. return get_audio_buffer(frame, align); ^ 170. 171. return AVERROR(EINVAL); libavutil/frame.c:112:1: Parameter `frame->nb_samples` 110. } 111. 112. static int get_audio_buffer(AVFrame *frame, int align) ^ 113. { 114. int channels = av_get_channel_layout_nb_channels(frame->channel_layout); libavutil/frame.c:120:15: Call 118. 119. if (!frame->linesize[0]) { 120. ret = av_samples_get_buffer_size(&frame->linesize[0], channels, ^ 121. frame->nb_samples, frame->format, 122. align); libavutil/samplefmt.c:108:1: <LHS trace> 106. } 107. 108. int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples, ^ 109. enum AVSampleFormat sample_fmt, int align) 110. { libavutil/samplefmt.c:108:1: Parameter `nb_samples` 106. } 107. 108. int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples, ^ 109. enum AVSampleFormat sample_fmt, int align) 110. { libavutil/samplefmt.c:124:9: Binary operation: ([1, 2147483616] + 32):signed32 by call to `av_frame_ref` 122. return AVERROR(EINVAL); 123. align = 1; 124. nb_samples = FFALIGN(nb_samples, 32); ^ 125. } 126.
https://github.com/libav/libav/blob/0e830094ad0dc251613a0aa3234d9c5c397e02e6/libavutil/samplefmt.c/#L124
d2a_code_trace_data_44166
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/srp/srp_lib.c:107: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_mul`. Showing all 23 steps of the trace crypto/srp/srp_lib.c:105:10: Call 103. /* B = g**b + k*v */ 104. 105. if (!BN_mod_exp(gb, g, b, N, bn_ctx) ^ 106. || (k = srp_Calc_k(N, g)) == NULL 107. || !BN_mod_mul(kv, v, k, N, bn_ctx) crypto/bn/bn_exp.c:89:1: Parameter `ctx->stack.depth` 87. } 88. 89. > int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, 90. BN_CTX *ctx) 91. { crypto/bn/bn_exp.c:141:19: Call 139. && (BN_get_flags(m, BN_FLG_CONSTTIME) == 0)) { 140. BN_ULONG A = a->d[0]; 141. ret = BN_mod_exp_mont_word(r, A, p, m, ctx, NULL); ^ 142. } else 143. # endif crypto/bn/bn_exp.c:1129:1: Parameter `ctx->stack.depth` 1127. } 1128. 1129. > int BN_mod_exp_mont_word(BIGNUM *rr, BN_ULONG a, const BIGNUM *p, 1130. const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont) 1131. { crypto/srp/srp_lib.c:107:13: Call 105. if (!BN_mod_exp(gb, g, b, N, bn_ctx) 106. || (k = srp_Calc_k(N, g)) == NULL 107. || !BN_mod_mul(kv, v, k, N, bn_ctx) ^ 108. || !BN_mod_add(B, gb, kv, N, bn_ctx)) { 109. BN_free(B); crypto/bn/bn_mod.c:193:1: Parameter `ctx->stack.depth` 191. 192. /* slow but works */ 193. > int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, 194. BN_CTX *ctx) 195. { crypto/bn/bn_mod.c:203:5: Call 201. bn_check_top(m); 202. 203. BN_CTX_start(ctx); ^ 204. if ((t = BN_CTX_get(ctx)) == NULL) 205. goto err; crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_mod.c:204:14: Call 202. 203. BN_CTX_start(ctx); 204. if ((t = BN_CTX_get(ctx)) == NULL) ^ 205. goto err; 206. if (a == b) { crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_mod.c:207:14: Call 205. goto err; 206. if (a == b) { 207. if (!BN_sqr(t, a, ctx)) ^ 208. goto err; 209. } else { crypto/bn/bn_sqr.c:17:1: Parameter `ctx->stack.depth` 15. * I've just gone over this and it is now %20 faster on x86 - eay - 27 Jun 96 16. */ 17. > int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) 18. { 19. int ret = bn_sqr_fixed_top(r, a, ctx); crypto/bn/bn_sqr.c:19:15: Call 17. int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) 18. { 19. int ret = bn_sqr_fixed_top(r, a, ctx); ^ 20. 21. bn_correct_top(r); crypto/bn/bn_sqr.c:42:5: Call 40. } 41. 42. BN_CTX_start(ctx); ^ 43. rr = (a != r) ? r : BN_CTX_get(ctx); 44. tmp = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:171:1: Parameter `*ctx->stack.indexes` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_sqr.c:104:5: Call 102. bn_check_top(rr); 103. bn_check_top(tmp); 104. BN_CTX_end(ctx); ^ 105. return ret; 106. } crypto/bn/bn_ctx.c:185:1: Parameter `*ctx->stack.indexes` 183. } 184. 185. > void BN_CTX_end(BN_CTX *ctx) 186. { 187. CTXDBG("ENTER BN_CTX_end()", ctx); crypto/bn/bn_ctx.c:191:27: Call 189. ctx->err_stack--; 190. else { 191. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 192. /* Does this stack frame have anything to release? */ 193. if (fp < ctx->used) crypto/bn/bn_ctx.c:266:1: <Offset trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `st->depth` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: <Length trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `*st->indexes` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:268:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_mul` 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_44167
void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset, MPA_INT *window, int *dither_state, OUT_INT *samples, int incr, int32_t sb_samples[SBLIMIT]) { int32_t tmp[32]; register MPA_INT *synth_buf; register const MPA_INT *w, *w2, *p; int j, offset, v; OUT_INT *samples2; #if FRAC_BITS <= 15 int sum, sum2; #else int64_t sum, sum2; #endif dct32(tmp, sb_samples); offset = *synth_buf_offset; synth_buf = synth_buf_ptr + offset; for(j=0;j<32;j++) { v = tmp[j]; #if FRAC_BITS <= 15 v = av_clip_int16(v); #endif synth_buf[j] = v; } memcpy(synth_buf + 512, synth_buf, 32 * sizeof(MPA_INT)); samples2 = samples + 31 * incr; w = window; w2 = window + 31; sum = *dither_state; p = synth_buf + 16; SUM8(sum, +=, w, p); p = synth_buf + 48; SUM8(sum, -=, w + 32, p); *samples = round_sample(&sum); samples += incr; w++; for(j=1;j<16;j++) { sum2 = 0; p = synth_buf + 16 + j; SUM8P2(sum, +=, sum2, -=, w, w2, p); p = synth_buf + 48 - j; SUM8P2(sum, -=, sum2, -=, w + 32, w2 + 32, p); *samples = round_sample(&sum); samples += incr; sum += sum2; *samples2 = round_sample(&sum); samples2 -= incr; w++; w2--; } p = synth_buf + 32; SUM8(sum, -=, w + 32, p); *samples = round_sample(&sum); *dither_state= sum; offset = (offset - 32) & 511; *synth_buf_offset = offset; } libavcodec/mpc.c:60: error: Buffer Overrun L2 Offset: [81+min(0, `c->synth_buf_offset[*]`), 96+max(511, `c->synth_buf_offset[*]`)] (⇐ [17+min(0, `c->synth_buf_offset[*]`), 32+max(511, `c->synth_buf_offset[*]`)] + 64) Size: 2 by call to `ff_mpa_synth_filter`. libavcodec/mpc.c:51:1: Parameter `c->synth_buf[*]` 49. * Process decoded Musepack data and produce PCM 50. */ 51. static void mpc_synth(MPCContext *c, int16_t *out) ^ 52. { 53. int dither_state = 0; libavcodec/mpc.c:60:13: Call 58. samples_ptr = samples + ch; 59. for(i = 0; i < SAMPLES_PER_BAND; i++) { 60. ff_mpa_synth_filter(c->synth_buf[ch], &(c->synth_buf_offset[ch]), ^ 61. mpa_window, &dither_state, 62. samples_ptr, 2, libavcodec/mpegaudiodec.c:906:9: <Length trace> 904. /* we calculate two samples at the same time to avoid one memory 905. access per two sample */ 906. for(j=1;j<16;j++) { ^ 907. sum2 = 0; 908. p = synth_buf + 16 + j; libavcodec/mpegaudiodec.c:906:9: Assignment 904. /* we calculate two samples at the same time to avoid one memory 905. access per two sample */ 906. for(j=1;j<16;j++) { ^ 907. sum2 = 0; 908. p = synth_buf + 16 + j; libavcodec/mpegaudiodec.c:908:9: Assignment 906. for(j=1;j<16;j++) { 907. sum2 = 0; 908. p = synth_buf + 16 + j; ^ 909. SUM8P2(sum, +=, sum2, -=, w, w2, p); 910. p = synth_buf + 48 - j; libavcodec/mpegaudiodec.c:909:9: Array access: Offset: [81+min(0, c->synth_buf_offset[*]), 96+max(511, c->synth_buf_offset[*])] (⇐ [17+min(0, c->synth_buf_offset[*]), 32+max(511, c->synth_buf_offset[*])] + 64) Size: 2 by call to `ff_mpa_synth_filter` 907. sum2 = 0; 908. p = synth_buf + 16 + j; 909. SUM8P2(sum, +=, sum2, -=, w, w2, p); ^ 910. p = synth_buf + 48 - j; 911. SUM8P2(sum, -=, sum2, -=, w + 32, w2 + 32, p);
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/mpegaudiodec.c/#L909
d2a_code_trace_data_44168
int dct_quantize_trellis_c(MpegEncContext *s, DCTELEM *block, int n, int qscale, int *overflow){ const int *qmat; const uint8_t *scantable= s->intra_scantable.scantable; const uint8_t *perm_scantable= s->intra_scantable.permutated; int max=0; unsigned int threshold1, threshold2; int bias=0; int run_tab[65]; int level_tab[65]; int score_tab[65]; int survivor[65]; int survivor_count; int last_run=0; int last_level=0; int last_score= 0; int last_i; int coeff[2][64]; int coeff_count[64]; int qmul, qadd, start_i, last_non_zero, i, dc; const int esc_length= s->ac_esc_length; uint8_t * length; uint8_t * last_length; const int lambda= s->lambda2 >> (FF_LAMBDA_SHIFT - 6); s->dsp.fdct (block); if(s->dct_error_sum) s->denoise_dct(s, block); qmul= qscale*16; qadd= ((qscale-1)|1)*8; if (s->mb_intra) { int q; if (!s->h263_aic) { if (n < 4) q = s->y_dc_scale; else q = s->c_dc_scale; q = q << 3; } else{ q = 1 << 3; qadd=0; } block[0] = (block[0] + (q >> 1)) / q; start_i = 1; last_non_zero = 0; qmat = s->q_intra_matrix[qscale]; if(s->mpeg_quant || s->out_format == FMT_MPEG1) bias= 1<<(QMAT_SHIFT-1); length = s->intra_ac_vlc_length; last_length= s->intra_ac_vlc_last_length; } else { start_i = 0; last_non_zero = -1; qmat = s->q_inter_matrix[qscale]; length = s->inter_ac_vlc_length; last_length= s->inter_ac_vlc_last_length; } last_i= start_i; threshold1= (1<<QMAT_SHIFT) - bias - 1; threshold2= (threshold1<<1); for(i=63; i>=start_i; i--) { const int j = scantable[i]; int level = block[j] * qmat[j]; if(((unsigned)(level+threshold1))>threshold2){ last_non_zero = i; break; } } for(i=start_i; i<=last_non_zero; i++) { const int j = scantable[i]; int level = block[j] * qmat[j]; if(((unsigned)(level+threshold1))>threshold2){ if(level>0){ level= (bias + level)>>QMAT_SHIFT; coeff[0][i]= level; coeff[1][i]= level-1; }else{ level= (bias - level)>>QMAT_SHIFT; coeff[0][i]= -level; coeff[1][i]= -level+1; } coeff_count[i]= FFMIN(level, 2); assert(coeff_count[i]); max |=level; }else{ coeff[0][i]= (level>>31)|1; coeff_count[i]= 1; } } *overflow= s->max_qcoeff < max; if(last_non_zero < start_i){ memset(block + start_i, 0, (64-start_i)*sizeof(DCTELEM)); return last_non_zero; } score_tab[start_i]= 0; survivor[0]= start_i; survivor_count= 1; for(i=start_i; i<=last_non_zero; i++){ int level_index, j, zero_distoration; int dct_coeff= FFABS(block[ scantable[i] ]); int best_score=256*256*256*120; if ( s->dsp.fdct == fdct_ifast #ifndef FAAN_POSTSCALE || s->dsp.fdct == ff_faandct #endif ) dct_coeff= (dct_coeff*inv_aanscales[ scantable[i] ]) >> 12; zero_distoration= dct_coeff*dct_coeff; for(level_index=0; level_index < coeff_count[i]; level_index++){ int distoration; int level= coeff[level_index][i]; const int alevel= FFABS(level); int unquant_coeff; assert(level); if(s->out_format == FMT_H263){ unquant_coeff= alevel*qmul + qadd; }else{ j= s->dsp.idct_permutation[ scantable[i] ]; if(s->mb_intra){ unquant_coeff = (int)( alevel * qscale * s->intra_matrix[j]) >> 3; unquant_coeff = (unquant_coeff - 1) | 1; }else{ unquant_coeff = ((( alevel << 1) + 1) * qscale * ((int) s->inter_matrix[j])) >> 4; unquant_coeff = (unquant_coeff - 1) | 1; } unquant_coeff<<= 3; } distoration= (unquant_coeff - dct_coeff) * (unquant_coeff - dct_coeff) - zero_distoration; level+=64; if((level&(~127)) == 0){ for(j=survivor_count-1; j>=0; j--){ int run= i - survivor[j]; int score= distoration + length[UNI_AC_ENC_INDEX(run, level)]*lambda; score += score_tab[i-run]; if(score < best_score){ best_score= score; run_tab[i+1]= run; level_tab[i+1]= level-64; } } if(s->out_format == FMT_H263){ for(j=survivor_count-1; j>=0; j--){ int run= i - survivor[j]; int score= distoration + last_length[UNI_AC_ENC_INDEX(run, level)]*lambda; score += score_tab[i-run]; if(score < last_score){ last_score= score; last_run= run; last_level= level-64; last_i= i+1; } } } }else{ distoration += esc_length*lambda; for(j=survivor_count-1; j>=0; j--){ int run= i - survivor[j]; int score= distoration + score_tab[i-run]; if(score < best_score){ best_score= score; run_tab[i+1]= run; level_tab[i+1]= level-64; } } if(s->out_format == FMT_H263){ for(j=survivor_count-1; j>=0; j--){ int run= i - survivor[j]; int score= distoration + score_tab[i-run]; if(score < last_score){ last_score= score; last_run= run; last_level= level-64; last_i= i+1; } } } } } score_tab[i+1]= best_score; if(last_non_zero <= 27){ for(; survivor_count; survivor_count--){ if(score_tab[ survivor[survivor_count-1] ] <= best_score) break; } }else{ for(; survivor_count; survivor_count--){ if(score_tab[ survivor[survivor_count-1] ] <= best_score + lambda) break; } } survivor[ survivor_count++ ]= i+1; } if(s->out_format != FMT_H263){ last_score= 256*256*256*120; for(i= survivor[0]; i<=last_non_zero + 1; i++){ int score= score_tab[i]; if(i) score += lambda*2; if(score < last_score){ last_score= score; last_i= i; last_level= level_tab[i]; last_run= run_tab[i]; } } } s->coded_score[n] = last_score; dc= FFABS(block[0]); last_non_zero= last_i - 1; memset(block + start_i, 0, (64-start_i)*sizeof(DCTELEM)); if(last_non_zero < start_i) return last_non_zero; if(last_non_zero == 0 && start_i == 0){ int best_level= 0; int best_score= dc * dc; for(i=0; i<coeff_count[0]; i++){ int level= coeff[i][0]; int alevel= FFABS(level); int unquant_coeff, score, distortion; if(s->out_format == FMT_H263){ unquant_coeff= (alevel*qmul + qadd)>>3; }else{ unquant_coeff = ((( alevel << 1) + 1) * qscale * ((int) s->inter_matrix[0])) >> 4; unquant_coeff = (unquant_coeff - 1) | 1; } unquant_coeff = (unquant_coeff + 4) >> 3; unquant_coeff<<= 3 + 3; distortion= (unquant_coeff - dc) * (unquant_coeff - dc); level+=64; if((level&(~127)) == 0) score= distortion + last_length[UNI_AC_ENC_INDEX(0, level)]*lambda; else score= distortion + esc_length*lambda; if(score < best_score){ best_score= score; best_level= level - 64; } } block[0]= best_level; s->coded_score[n] = best_score - dc*dc; if(best_level == 0) return -1; else return last_non_zero; } i= last_i; assert(last_level); block[ perm_scantable[last_non_zero] ]= last_level; i -= last_run + 1; for(; i>start_i; i -= run_tab[i] + 1){ block[ perm_scantable[i-1] ]= level_tab[i]; } return last_non_zero; } libavcodec/mpegvideo_enc.c:3198: error: Uninitialized Value The value read from level_tab[_] was never initialized. libavcodec/mpegvideo_enc.c:3198:17: 3196. last_score= score; 3197. last_i= i; 3198. last_level= level_tab[i]; ^ 3199. last_run= run_tab[i]; 3200. }
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/mpegvideo_enc.c/#L3198
d2a_code_trace_data_44169
int TIFFMergeFieldInfo(TIFF* tif, const TIFFFieldInfo info[], uint32 n) { static const char module[] = "TIFFMergeFieldInfo"; static const char reason[] = "for fields array"; TIFFField *tp; size_t nfields; uint32 i; if (tif->tif_nfieldscompat > 0) { tif->tif_fieldscompat = (TIFFFieldArray *) _TIFFCheckRealloc(tif, tif->tif_fieldscompat, tif->tif_nfieldscompat + 1, sizeof(TIFFFieldArray), reason); } else { tif->tif_fieldscompat = (TIFFFieldArray *) _TIFFCheckMalloc(tif, 1, sizeof(TIFFFieldArray), reason); } if (!tif->tif_fieldscompat) { TIFFErrorExt(tif->tif_clientdata, module, "Failed to allocate fields array"); return -1; } nfields = tif->tif_nfieldscompat++; tif->tif_fieldscompat[nfields].type = tfiatOther; tif->tif_fieldscompat[nfields].allocated_size = n; tif->tif_fieldscompat[nfields].count = n; tif->tif_fieldscompat[nfields].fields = (TIFFField *)_TIFFCheckMalloc(tif, n, sizeof(TIFFField), reason); if (!tif->tif_fieldscompat[nfields].fields) { TIFFErrorExt(tif->tif_clientdata, module, "Failed to allocate fields array"); return -1; } tp = tif->tif_fieldscompat[nfields].fields; for (i = 0; i < n; i++) { tp->field_tag = info[i].field_tag; tp->field_readcount = info[i].field_readcount; tp->field_writecount = info[i].field_writecount; tp->field_type = info[i].field_type; tp->reserved = 0; tp->set_field_type = _TIFFSetGetType(info[i].field_type, info[i].field_readcount, info[i].field_passcount); tp->get_field_type = _TIFFSetGetType(info[i].field_type, info[i].field_readcount, info[i].field_passcount); tp->field_bit = info[i].field_bit; tp->field_oktochange = info[i].field_oktochange; tp->field_passcount = info[i].field_passcount; tp->field_name = info[i].field_name; tp->field_subfields = NULL; tp++; } if (!_TIFFMergeFields(tif, tif->tif_fieldscompat[nfields].fields, n)) { TIFFErrorExt(tif->tif_clientdata, module, "Setting up field info failed"); return -1; } return 0; } libtiff/tif_dirinfo.c:837: error: Buffer Overrun S2 Offset: `tif->tif_nfieldscompat` Size: [0, +oo]. libtiff/tif_dirinfo.c:811:1: <Offset trace> 809. } 810. 811. int ^ 812. TIFFMergeFieldInfo(TIFF* tif, const TIFFFieldInfo info[], uint32 n) 813. { libtiff/tif_dirinfo.c:811:1: Parameter `tif->tif_nfieldscompat` 809. } 810. 811. int ^ 812. TIFFMergeFieldInfo(TIFF* tif, const TIFFFieldInfo info[], uint32 n) 813. { libtiff/tif_dirinfo.c:835:2: Assignment 833. return -1; 834. } 835. nfields = tif->tif_nfieldscompat++; ^ 836. 837. tif->tif_fieldscompat[nfields].type = tfiatOther; libtiff/tif_dirinfo.c:811:1: <Length trace> 809. } 810. 811. int ^ 812. TIFFMergeFieldInfo(TIFF* tif, const TIFFFieldInfo info[], uint32 n) 813. { libtiff/tif_dirinfo.c:811:1: Parameter `*tif->tif_fieldscompat` 809. } 810. 811. int ^ 812. TIFFMergeFieldInfo(TIFF* tif, const TIFFFieldInfo info[], uint32 n) 813. { libtiff/tif_dirinfo.c:822:4: Call 820. if (tif->tif_nfieldscompat > 0) { 821. tif->tif_fieldscompat = (TIFFFieldArray *) 822. _TIFFCheckRealloc(tif, tif->tif_fieldscompat, ^ 823. tif->tif_nfieldscompat + 1, 824. sizeof(TIFFFieldArray), reason); libtiff/tif_aux.c:40:2: Assignment 38. tmsize_t nmemb, tmsize_t elem_size, const char* what) 39. { 40. void* cp = NULL; ^ 41. tmsize_t bytes = nmemb * elem_size; 42. libtiff/tif_aux.c:53:2: Assignment 51. "No space %s", what); 52. 53. return cp; ^ 54. } 55. libtiff/tif_dirinfo.c:821:3: Assignment 819. 820. if (tif->tif_nfieldscompat > 0) { 821. tif->tif_fieldscompat = (TIFFFieldArray *) ^ 822. _TIFFCheckRealloc(tif, tif->tif_fieldscompat, 823. tif->tif_nfieldscompat + 1, libtiff/tif_dirinfo.c:837:2: Array access: Offset: tif->tif_nfieldscompat Size: [0, +oo] 835. nfields = tif->tif_nfieldscompat++; 836. 837. tif->tif_fieldscompat[nfields].type = tfiatOther; ^ 838. tif->tif_fieldscompat[nfields].allocated_size = n; 839. tif->tif_fieldscompat[nfields].count = n;
https://gitlab.com/libtiff/libtiff/blob/771a4ea0a98c7a218c9f3add9a05e08d29625758/libtiff/tif_dirinfo.c/#L837
d2a_code_trace_data_44170
void ff_h264_draw_horiz_band(const H264Context *h, H264SliceContext *sl, int y, int height) { AVCodecContext *avctx = h->avctx; const AVFrame *src = &h->cur_pic.f; const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt); int vshift = desc->log2_chroma_h; const int field_pic = h->picture_structure != PICT_FRAME; if (field_pic) { height <<= 1; y <<= 1; } height = FFMIN(height, avctx->height - y); if (field_pic && h->first_field && !(avctx->slice_flags & SLICE_FLAG_ALLOW_FIELD)) return; if (avctx->draw_horiz_band) { int offset[AV_NUM_DATA_POINTERS]; int i; offset[0] = y * src->linesize[0]; offset[1] = offset[2] = (y >> vshift) * src->linesize[1]; for (i = 3; i < AV_NUM_DATA_POINTERS; i++) offset[i] = 0; emms_c(); avctx->draw_horiz_band(avctx, src, offset, y, h->picture_structure, height); } } libavcodec/h264.c:88: error: Null Dereference pointer `desc` last assigned on line 87 could be null and is dereferenced at line 88, column 18. libavcodec/h264.c:82:1: start of procedure ff_h264_draw_horiz_band() 80. } 81. 82. void ff_h264_draw_horiz_band(const H264Context *h, H264SliceContext *sl, ^ 83. int y, int height) 84. { libavcodec/h264.c:85:5: 83. int y, int height) 84. { 85. AVCodecContext *avctx = h->avctx; ^ 86. const AVFrame *src = &h->cur_pic.f; 87. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt); libavcodec/h264.c:86:5: 84. { 85. AVCodecContext *avctx = h->avctx; 86. const AVFrame *src = &h->cur_pic.f; ^ 87. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt); 88. int vshift = desc->log2_chroma_h; libavcodec/h264.c:87:5: 85. AVCodecContext *avctx = h->avctx; 86. const AVFrame *src = &h->cur_pic.f; 87. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt); ^ 88. int vshift = desc->log2_chroma_h; 89. const int field_pic = h->picture_structure != PICT_FRAME; libavutil/pixdesc.c:1676:1: start of procedure av_pix_fmt_desc_get() 1674. } 1675. 1676. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt) ^ 1677. { 1678. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) libavutil/pixdesc.c:1678:9: Taking false branch 1676. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt) 1677. { 1678. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) ^ 1679. return NULL; 1680. return &av_pix_fmt_descriptors[pix_fmt]; libavutil/pixdesc.c:1678:24: Taking true branch 1676. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt) 1677. { 1678. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) ^ 1679. return NULL; 1680. return &av_pix_fmt_descriptors[pix_fmt]; libavutil/pixdesc.c:1679:9: 1677. { 1678. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) 1679. return NULL; ^ 1680. return &av_pix_fmt_descriptors[pix_fmt]; 1681. } libavutil/pixdesc.c:1681:1: return from a call to av_pix_fmt_desc_get 1679. return NULL; 1680. return &av_pix_fmt_descriptors[pix_fmt]; 1681. } ^ 1682. 1683. const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev) libavcodec/h264.c:88:5: 86. const AVFrame *src = &h->cur_pic.f; 87. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt); 88. int vshift = desc->log2_chroma_h; ^ 89. const int field_pic = h->picture_structure != PICT_FRAME; 90. if (field_pic) {
https://github.com/libav/libav/blob/a939e5b2527d0c4628815b1d3d8e29ee921227e8/libavcodec/h264.c/#L88
d2a_code_trace_data_44171
static void sha512_block (SHA512_CTX *ctx, const void *in, size_t num) { const SHA_LONG64 *W=in; SHA_LONG64 a,b,c,d,e,f,g,h,s0,s1,T1; SHA_LONG64 X[16]; int i; #ifdef GO_FOR_SSE2 GO_FOR_SSE2(ctx,in,num); #endif while (num--) { a = ctx->h[0]; b = ctx->h[1]; c = ctx->h[2]; d = ctx->h[3]; e = ctx->h[4]; f = ctx->h[5]; g = ctx->h[6]; h = ctx->h[7]; #ifdef B_ENDIAN T1 = X[0] = W[0]; ROUND_00_15(0,a,b,c,d,e,f,g,h); T1 = X[1] = W[1]; ROUND_00_15(1,h,a,b,c,d,e,f,g); T1 = X[2] = W[2]; ROUND_00_15(2,g,h,a,b,c,d,e,f); T1 = X[3] = W[3]; ROUND_00_15(3,f,g,h,a,b,c,d,e); T1 = X[4] = W[4]; ROUND_00_15(4,e,f,g,h,a,b,c,d); T1 = X[5] = W[5]; ROUND_00_15(5,d,e,f,g,h,a,b,c); T1 = X[6] = W[6]; ROUND_00_15(6,c,d,e,f,g,h,a,b); T1 = X[7] = W[7]; ROUND_00_15(7,b,c,d,e,f,g,h,a); T1 = X[8] = W[8]; ROUND_00_15(8,a,b,c,d,e,f,g,h); T1 = X[9] = W[9]; ROUND_00_15(9,h,a,b,c,d,e,f,g); T1 = X[10] = W[10]; ROUND_00_15(10,g,h,a,b,c,d,e,f); T1 = X[11] = W[11]; ROUND_00_15(11,f,g,h,a,b,c,d,e); T1 = X[12] = W[12]; ROUND_00_15(12,e,f,g,h,a,b,c,d); T1 = X[13] = W[13]; ROUND_00_15(13,d,e,f,g,h,a,b,c); T1 = X[14] = W[14]; ROUND_00_15(14,c,d,e,f,g,h,a,b); T1 = X[15] = W[15]; ROUND_00_15(15,b,c,d,e,f,g,h,a); #else T1 = X[0] = PULL64(W[0]); ROUND_00_15(0,a,b,c,d,e,f,g,h); T1 = X[1] = PULL64(W[1]); ROUND_00_15(1,h,a,b,c,d,e,f,g); T1 = X[2] = PULL64(W[2]); ROUND_00_15(2,g,h,a,b,c,d,e,f); T1 = X[3] = PULL64(W[3]); ROUND_00_15(3,f,g,h,a,b,c,d,e); T1 = X[4] = PULL64(W[4]); ROUND_00_15(4,e,f,g,h,a,b,c,d); T1 = X[5] = PULL64(W[5]); ROUND_00_15(5,d,e,f,g,h,a,b,c); T1 = X[6] = PULL64(W[6]); ROUND_00_15(6,c,d,e,f,g,h,a,b); T1 = X[7] = PULL64(W[7]); ROUND_00_15(7,b,c,d,e,f,g,h,a); T1 = X[8] = PULL64(W[8]); ROUND_00_15(8,a,b,c,d,e,f,g,h); T1 = X[9] = PULL64(W[9]); ROUND_00_15(9,h,a,b,c,d,e,f,g); T1 = X[10] = PULL64(W[10]); ROUND_00_15(10,g,h,a,b,c,d,e,f); T1 = X[11] = PULL64(W[11]); ROUND_00_15(11,f,g,h,a,b,c,d,e); T1 = X[12] = PULL64(W[12]); ROUND_00_15(12,e,f,g,h,a,b,c,d); T1 = X[13] = PULL64(W[13]); ROUND_00_15(13,d,e,f,g,h,a,b,c); T1 = X[14] = PULL64(W[14]); ROUND_00_15(14,c,d,e,f,g,h,a,b); T1 = X[15] = PULL64(W[15]); ROUND_00_15(15,b,c,d,e,f,g,h,a); #endif for (i=16;i<80;i+=8) { ROUND_16_80(i+0,a,b,c,d,e,f,g,h,X); ROUND_16_80(i+1,h,a,b,c,d,e,f,g,X); ROUND_16_80(i+2,g,h,a,b,c,d,e,f,X); ROUND_16_80(i+3,f,g,h,a,b,c,d,e,X); ROUND_16_80(i+4,e,f,g,h,a,b,c,d,X); ROUND_16_80(i+5,d,e,f,g,h,a,b,c,X); ROUND_16_80(i+6,c,d,e,f,g,h,a,b,X); ROUND_16_80(i+7,b,c,d,e,f,g,h,a,X); } ctx->h[0] += a; ctx->h[1] += b; ctx->h[2] += c; ctx->h[3] += d; ctx->h[4] += e; ctx->h[5] += f; ctx->h[6] += g; ctx->h[7] += h; W+=SHA_LBLOCK; } } crypto/sha/sha512.c:472: error: BUFFER_OVERRUN_L2 Offset: [23, 86] Size: 80. Showing all 5 steps of the trace crypto/sha/sha512.c:463:7: <Offset trace> 461. #endif 462. 463. for (i=16;i<80;i+=8) ^ 464. { 465. ROUND_16_80(i+0,a,b,c,d,e,f,g,h,X); crypto/sha/sha512.c:463:7: Assignment 461. #endif 462. 463. for (i=16;i<80;i+=8) ^ 464. { 465. ROUND_16_80(i+0,a,b,c,d,e,f,g,h,X); crypto/sha/sha512.c:248:1: <Length trace> 246. 247. #ifndef SHA512_ASM 248. > static const SHA_LONG64 K512[80] = { 249. U64(0x428a2f98d728ae22),U64(0x7137449123ef65cd), 250. U64(0xb5c0fbcfec4d3b2f),U64(0xe9b5dba58189dbbc), crypto/sha/sha512.c:248:1: Array declaration 246. 247. #ifndef SHA512_ASM 248. > static const SHA_LONG64 K512[80] = { 249. U64(0x428a2f98d728ae22),U64(0x7137449123ef65cd), 250. U64(0xb5c0fbcfec4d3b2f),U64(0xe9b5dba58189dbbc), crypto/sha/sha512.c:472:3: Array access: Offset: [23, 86] Size: 80 470. ROUND_16_80(i+5,d,e,f,g,h,a,b,c,X); 471. ROUND_16_80(i+6,c,d,e,f,g,h,a,b,X); 472. ROUND_16_80(i+7,b,c,d,e,f,g,h,a,X); ^ 473. } 474.
https://github.com/openssl/openssl/blob/89c53672c231586dbcde7410de4b6ce40e685c74/crypto/sha/sha512.c/#L472
d2a_code_trace_data_44172
static void do_video_stats(AVFormatContext *os, AVOutputStream *ost, int frame_size) { AVCodecContext *enc; int frame_number; double ti1, bitrate, avg_bitrate; if (!vstats_file) { vstats_file = fopen(vstats_filename, "w"); if (!vstats_file) { perror("fopen"); ffmpeg_exit(1); } } enc = ost->st->codec; if (enc->codec_type == AVMEDIA_TYPE_VIDEO) { frame_number = ost->frame_number; fprintf(vstats_file, "frame= %5d q= %2.1f ", frame_number, enc->coded_frame->quality/(float)FF_QP2LAMBDA); if (enc->flags&CODEC_FLAG_PSNR) fprintf(vstats_file, "PSNR= %6.2f ", psnr(enc->coded_frame->error[0]/(enc->width*enc->height*255.0*255.0))); fprintf(vstats_file,"f_size= %6d ", frame_size); ti1 = ost->sync_opts * av_q2d(enc->time_base); if (ti1 < 0.01) ti1 = 0.01; bitrate = (frame_size * 8) / av_q2d(enc->time_base) / 1000.0; avg_bitrate = (double)(video_size * 8) / ti1 / 1000.0; fprintf(vstats_file, "s_size= %8.0fkB time= %0.3f br= %7.1fkbits/s avg_br= %7.1fkbits/s ", (double)video_size / 1024, ti1, bitrate, avg_bitrate); fprintf(vstats_file,"type= %c\n", av_get_pict_type_char(enc->coded_frame->pict_type)); } } ffmpeg.c:1305: error: Null Dereference pointer `vstats_file` last assigned on line 1295 could be null and is dereferenced by call to `fprintf()` at line 1305, column 9. ffmpeg.c:1286:1: start of procedure do_video_stats() 1284. } 1285. 1286. static void do_video_stats(AVFormatContext *os, AVOutputStream *ost, ^ 1287. int frame_size) 1288. { ffmpeg.c:1294:10: Taking true branch 1292. 1293. /* this is executed just the first time do_video_stats is called */ 1294. if (!vstats_file) { ^ 1295. vstats_file = fopen(vstats_filename, "w"); 1296. if (!vstats_file) { ffmpeg.c:1295:9: 1293. /* this is executed just the first time do_video_stats is called */ 1294. if (!vstats_file) { 1295. vstats_file = fopen(vstats_filename, "w"); ^ 1296. if (!vstats_file) { 1297. perror("fopen"); ffmpeg.c:1296:14: Taking true branch 1294. if (!vstats_file) { 1295. vstats_file = fopen(vstats_filename, "w"); 1296. if (!vstats_file) { ^ 1297. perror("fopen"); 1298. ffmpeg_exit(1); ffmpeg.c:1297:13: 1295. vstats_file = fopen(vstats_filename, "w"); 1296. if (!vstats_file) { 1297. perror("fopen"); ^ 1298. ffmpeg_exit(1); 1299. } ffmpeg.c:1298:13: Skipping ffmpeg_exit(): empty list of specs 1296. if (!vstats_file) { 1297. perror("fopen"); 1298. ffmpeg_exit(1); ^ 1299. } 1300. } ffmpeg.c:1302:5: 1300. } 1301. 1302. enc = ost->st->codec; ^ 1303. if (enc->codec_type == AVMEDIA_TYPE_VIDEO) { 1304. frame_number = ost->frame_number; ffmpeg.c:1303:9: Taking true branch 1301. 1302. enc = ost->st->codec; 1303. if (enc->codec_type == AVMEDIA_TYPE_VIDEO) { ^ 1304. frame_number = ost->frame_number; 1305. fprintf(vstats_file, "frame= %5d q= %2.1f ", frame_number, enc->coded_frame->quality/(float)FF_QP2LAMBDA); ffmpeg.c:1304:9: 1302. enc = ost->st->codec; 1303. if (enc->codec_type == AVMEDIA_TYPE_VIDEO) { 1304. frame_number = ost->frame_number; ^ 1305. fprintf(vstats_file, "frame= %5d q= %2.1f ", frame_number, enc->coded_frame->quality/(float)FF_QP2LAMBDA); 1306. if (enc->flags&CODEC_FLAG_PSNR) ffmpeg.c:1305:9: 1303. if (enc->codec_type == AVMEDIA_TYPE_VIDEO) { 1304. frame_number = ost->frame_number; 1305. fprintf(vstats_file, "frame= %5d q= %2.1f ", frame_number, enc->coded_frame->quality/(float)FF_QP2LAMBDA); ^ 1306. if (enc->flags&CODEC_FLAG_PSNR) 1307. fprintf(vstats_file, "PSNR= %6.2f ", psnr(enc->coded_frame->error[0]/(enc->width*enc->height*255.0*255.0)));
https://github.com/libav/libav/blob/f4c79d1e0b2e797012304db57903e4091b0c2d7c/ffmpeg.c/#L1305
d2a_code_trace_data_44173
int ssl3_cbc_copy_mac(unsigned char *out, const SSL3_RECORD *rec, size_t md_size) { #if defined(CBC_MAC_ROTATE_IN_PLACE) unsigned char rotated_mac_buf[64 + EVP_MAX_MD_SIZE]; unsigned char *rotated_mac; #else unsigned char rotated_mac[EVP_MAX_MD_SIZE]; #endif size_t mac_end = rec->length; size_t mac_start = mac_end - md_size; size_t in_mac; size_t scan_start = 0; size_t i, j; size_t rotate_offset; if (!ossl_assert(rec->orig_len >= md_size && md_size <= EVP_MAX_MD_SIZE)) return 0; #if defined(CBC_MAC_ROTATE_IN_PLACE) rotated_mac = rotated_mac_buf + ((0 - (size_t)rotated_mac_buf) & 63); #endif if (rec->orig_len > md_size + 255 + 1) scan_start = rec->orig_len - (md_size + 255 + 1); in_mac = 0; rotate_offset = 0; memset(rotated_mac, 0, md_size); for (i = scan_start, j = 0; i < rec->orig_len; i++) { size_t mac_started = constant_time_eq_s(i, mac_start); size_t mac_ended = constant_time_lt_s(i, mac_end); unsigned char b = rec->data[i]; in_mac |= mac_started; in_mac &= mac_ended; rotate_offset |= j & mac_started; rotated_mac[j++] |= b & in_mac; j &= constant_time_lt_s(j, md_size); } #if defined(CBC_MAC_ROTATE_IN_PLACE) j = 0; for (i = 0; i < md_size; i++) { ((volatile unsigned char *)rotated_mac)[rotate_offset ^ 32]; out[j++] = rotated_mac[rotate_offset++]; rotate_offset &= constant_time_lt_s(rotate_offset, md_size); } #else memset(out, 0, md_size); rotate_offset = md_size - rotate_offset; rotate_offset &= constant_time_lt_s(rotate_offset, md_size); for (i = 0; i < md_size; i++) { for (j = 0; j < md_size; j++) out[j] |= rotated_mac[i] & constant_time_eq_8_s(j, rotate_offset); rotate_offset++; rotate_offset &= constant_time_lt_s(rotate_offset, md_size); } #endif return 1; } ssl/record/ssl3_record.c:1881: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [0, 64]):unsigned64 by call to `dtls1_process_record`. Showing all 11 steps of the trace ssl/record/ssl3_record.c:1769:13: Unknown value from: non-const function 1767. 1768. if (s->msg_callback) 1769. s->msg_callback(0, 0, SSL3_RT_HEADER, p, DTLS1_RT_HEADER_LENGTH, ^ 1770. s, s->msg_callback_arg); 1771. ssl/record/ssl3_record.c:1784:9: Assignment 1782. p += 6; 1783. 1784. n2s(p, rr->length); ^ 1785. 1786. /* Lets check version */ ssl/record/ssl3_record.c:1881:10: Call 1879. } 1880. 1881. if (!dtls1_process_record(s, bitmap)) { ^ 1882. rr->length = 0; 1883. RECORD_LAYER_reset_packet_length(&s->rlayer); /* dump this record */ 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: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 `rec->length` 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:1433:5: Assignment 1431. * mac_end is the index of |rec->data| just after the end of the MAC. 1432. */ 1433. size_t mac_end = rec->length; ^ 1434. size_t mac_start = mac_end - md_size; 1435. size_t in_mac; 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:1434:5: Binary operation: ([0, +oo] - [0, 64]):unsigned64 by call to `dtls1_process_record` 1432. */ 1433. size_t mac_end = rec->length; 1434. size_t mac_start = mac_end - md_size; ^ 1435. size_t in_mac; 1436. /*
https://github.com/openssl/openssl/blob/7f7eb90b8ac55997c5c825bb3ebcfe28611e06f5/ssl/record/ssl3_record.c/#L1434
d2a_code_trace_data_44174
u_char * ngx_vsnprintf(u_char *buf, size_t max, const char *fmt, va_list args) { u_char *p, zero, *last; int d; float f, scale; size_t len, slen; int64_t i64; uint64_t ui64; ngx_msec_t ms; ngx_uint_t width, sign, hex, max_width, frac_width, i; ngx_str_t *v; ngx_variable_value_t *vv; if (max == 0) { return buf; } last = buf + max; while (*fmt && buf < last) { if (*fmt == '%') { i64 = 0; ui64 = 0; zero = (u_char) ((*++fmt == '0') ? '0' : ' '); width = 0; sign = 1; hex = 0; max_width = 0; frac_width = 0; slen = (size_t) -1; while (*fmt >= '0' && *fmt <= '9') { width = width * 10 + *fmt++ - '0'; } for ( ;; ) { switch (*fmt) { case 'u': sign = 0; fmt++; continue; case 'm': max_width = 1; fmt++; continue; case 'X': hex = 2; sign = 0; fmt++; continue; case 'x': hex = 1; sign = 0; fmt++; continue; case '.': fmt++; while (*fmt >= '0' && *fmt <= '9') { frac_width = frac_width * 10 + *fmt++ - '0'; } break; case '*': slen = va_arg(args, size_t); fmt++; continue; default: break; } break; } switch (*fmt) { case 'V': v = va_arg(args, ngx_str_t *); len = v->len; len = (buf + len < last) ? len : (size_t) (last - buf); buf = ngx_cpymem(buf, v->data, len); fmt++; continue; case 'v': vv = va_arg(args, ngx_variable_value_t *); len = vv->len; len = (buf + len < last) ? len : (size_t) (last - buf); buf = ngx_cpymem(buf, vv->data, len); fmt++; continue; case 's': p = va_arg(args, u_char *); if (slen == (size_t) -1) { while (*p && buf < last) { *buf++ = *p++; } } else { len = (buf + slen < last) ? slen : (size_t) (last - buf); buf = ngx_cpymem(buf, p, len); } fmt++; continue; case 'O': i64 = (int64_t) va_arg(args, off_t); sign = 1; break; case 'P': i64 = (int64_t) va_arg(args, ngx_pid_t); sign = 1; break; case 'T': i64 = (int64_t) va_arg(args, time_t); sign = 1; break; case 'M': ms = (ngx_msec_t) va_arg(args, ngx_msec_t); if ((ngx_msec_int_t) ms == -1) { sign = 1; i64 = -1; } else { sign = 0; ui64 = (uint64_t) ms; } break; case 'z': if (sign) { i64 = (int64_t) va_arg(args, ssize_t); } else { ui64 = (uint64_t) va_arg(args, size_t); } break; case 'i': if (sign) { i64 = (int64_t) va_arg(args, ngx_int_t); } else { ui64 = (uint64_t) va_arg(args, ngx_uint_t); } if (max_width) { width = NGX_INT_T_LEN; } break; case 'd': if (sign) { i64 = (int64_t) va_arg(args, int); } else { ui64 = (uint64_t) va_arg(args, u_int); } break; case 'l': if (sign) { i64 = (int64_t) va_arg(args, long); } else { ui64 = (uint64_t) va_arg(args, u_long); } break; case 'D': if (sign) { i64 = (int64_t) va_arg(args, int32_t); } else { ui64 = (uint64_t) va_arg(args, uint32_t); } break; case 'L': if (sign) { i64 = va_arg(args, int64_t); } else { ui64 = va_arg(args, uint64_t); } break; case 'A': if (sign) { i64 = (int64_t) va_arg(args, ngx_atomic_int_t); } else { ui64 = (uint64_t) va_arg(args, ngx_atomic_uint_t); } if (max_width) { width = NGX_ATOMIC_T_LEN; } break; case 'f': f = (float) va_arg(args, double); if (f < 0) { *buf++ = '-'; f = -f; } ui64 = (int64_t) f; buf = ngx_sprintf_num(buf, last, ui64, zero, 0, width); if (frac_width) { if (buf < last) { *buf++ = '.'; } scale = 1.0; for (i = 0; i < frac_width; i++) { scale *= 10.0; } ui64 = (uint64_t) ((f - (int64_t) ui64) * scale); buf = ngx_sprintf_num(buf, last, ui64, '0', 0, frac_width); } fmt++; continue; #if !(NGX_WIN32) case 'r': i64 = (int64_t) va_arg(args, rlim_t); sign = 1; break; #endif case 'p': ui64 = (uintptr_t) va_arg(args, void *); hex = 2; sign = 0; zero = '0'; width = NGX_PTR_SIZE * 2; break; case 'c': d = va_arg(args, int); *buf++ = (u_char) (d & 0xff); fmt++; continue; case 'Z': *buf++ = '\0'; fmt++; continue; case 'N': #if (NGX_WIN32) *buf++ = CR; #endif *buf++ = LF; fmt++; continue; case '%': *buf++ = '%'; fmt++; continue; default: *buf++ = *fmt++; continue; } if (sign) { if (i64 < 0) { *buf++ = '-'; ui64 = (uint64_t) -i64; } else { ui64 = (uint64_t) i64; } } buf = ngx_sprintf_num(buf, last, ui64, zero, hex, width); fmt++; } else { *buf++ = *fmt++; } } return buf; } src/http/ngx_http_core_module.c:1266: error: Buffer Overrun L2 Offset: [0, 4048] Size: 2048 by call to `ngx_log_error_core`. src/http/ngx_http_core_module.c:1265:13: Call 1263. if (r->uri.data[r->uri.len - 1] == '/' && !r->zero_in_uri) { 1264. 1265. if (ngx_http_map_uri_to_path(r, &path, &root, 0) != NULL) { ^ 1266. ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, 1267. "directory index of \"%s\" is forbidden", path.data); src/http/ngx_http_core_module.c:1683:9: Call 1681. 1682. if (alias && !r->valid_location) { 1683. ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, ^ 1684. "\"alias\" could not be used in location \"%V\" " 1685. "where URI was rewritten", &clcf->name); src/core/ngx_log.c:67:1: Parameter `log->file->fd` 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/http/ngx_http_core_module.c:1266:13: Call 1264. 1265. if (ngx_http_map_uri_to_path(r, &path, &root, 0) != NULL) { 1266. ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, ^ 1267. "directory index of \"%s\" is forbidden", path.data); 1268. } 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_44175
static int sbr_mapping(AACContext *ac, SpectralBandReplication *sbr, SBRData *ch_data, int e_a[2]) { int e, i, m; memset(ch_data->s_indexmapped[1], 0, 7*sizeof(ch_data->s_indexmapped[1])); for (e = 0; e < ch_data->bs_num_env; e++) { const unsigned int ilim = sbr->n[ch_data->bs_freq_res[e + 1]]; uint16_t *table = ch_data->bs_freq_res[e + 1] ? sbr->f_tablehigh : sbr->f_tablelow; int k; if (sbr->kx[1] != table[0]) { av_log(ac->avctx, AV_LOG_ERROR, "kx != f_table{high,low}[0]. " "Derived frequency tables were not regenerated.\n"); sbr_turnoff(sbr); return AVERROR_BUG; } for (i = 0; i < ilim; i++) for (m = table[i]; m < table[i + 1]; m++) sbr->e_origmapped[e][m - sbr->kx[1]] = ch_data->env_facs[e+1][i]; k = (ch_data->bs_num_noise > 1) && (ch_data->t_env[e] >= ch_data->t_q[1]); for (i = 0; i < sbr->n_q; i++) for (m = sbr->f_tablenoise[i]; m < sbr->f_tablenoise[i + 1]; m++) sbr->q_mapped[e][m - sbr->kx[1]] = ch_data->noise_facs[k+1][i]; for (i = 0; i < sbr->n[1]; i++) { if (ch_data->bs_add_harmonic_flag) { const unsigned int m_midpoint = (sbr->f_tablehigh[i] + sbr->f_tablehigh[i + 1]) >> 1; ch_data->s_indexmapped[e + 1][m_midpoint - sbr->kx[1]] = ch_data->bs_add_harmonic[i] * (e >= e_a[1] || (ch_data->s_indexmapped[0][m_midpoint - sbr->kx[1]] == 1)); } } for (i = 0; i < ilim; i++) { int additional_sinusoid_present = 0; for (m = table[i]; m < table[i + 1]; m++) { if (ch_data->s_indexmapped[e + 1][m - sbr->kx[1]]) { additional_sinusoid_present = 1; break; } } memset(&sbr->s_mapped[e][table[i] - sbr->kx[1]], additional_sinusoid_present, (table[i + 1] - table[i]) * sizeof(sbr->s_mapped[e][0])); } } memcpy(ch_data->s_indexmapped[0], ch_data->s_indexmapped[ch_data->bs_num_env], sizeof(ch_data->s_indexmapped[0])); return 0; } libavcodec/aacsbr.c:1407: error: Buffer Overrun L1 Offset added: 336 Size: 48. libavcodec/aacsbr.c:1402:1: <Length trace> 1400. * (14496-3 sp04 p217) 1401. */ 1402. static int sbr_mapping(AACContext *ac, SpectralBandReplication *sbr, ^ 1403. SBRData *ch_data, int e_a[2]) 1404. { libavcodec/aacsbr.c:1402:1: Parameter `ch_data->s_indexmapped[*][*]` 1400. * (14496-3 sp04 p217) 1401. */ 1402. static int sbr_mapping(AACContext *ac, SpectralBandReplication *sbr, ^ 1403. SBRData *ch_data, int e_a[2]) 1404. { libavcodec/aacsbr.c:1407:5: Array access: Offset added: 336 Size: 48 1405. int e, i, m; 1406. 1407. memset(ch_data->s_indexmapped[1], 0, 7*sizeof(ch_data->s_indexmapped[1])); ^ 1408. for (e = 0; e < ch_data->bs_num_env; e++) { 1409. const unsigned int ilim = sbr->n[ch_data->bs_freq_res[e + 1]];
https://github.com/libav/libav/blob/cb7190cd2c691fd93e4d3664f3fce6c19ee001dd/libavcodec/aacsbr.c/#L1407
d2a_code_trace_data_44176
BIO *BIO_new_ssl_connect(SSL_CTX *ctx) { #ifndef OPENSSL_NO_SOCK BIO *ret = NULL, *con = NULL, *ssl = NULL; if ((con = BIO_new(BIO_s_connect())) == NULL) return (NULL); if ((ssl = BIO_new_ssl(ctx, 1)) == NULL) goto err; if ((ret = BIO_push(ssl, con)) == NULL) goto err; return (ret); err: BIO_free(con); #endif return (NULL); } ssl/bio_ssl.c:525: error: MEMORY_LEAK memory dynamically allocated by call to `BIO_new()` at line 517, column 16 is not reachable after line 525, column 5. Showing all 81 steps of the trace ssl/bio_ssl.c:512:1: start of procedure BIO_new_ssl_connect() 510. } 511. 512. > BIO *BIO_new_ssl_connect(SSL_CTX *ctx) 513. { 514. #ifndef OPENSSL_NO_SOCK ssl/bio_ssl.c:515:5: 513. { 514. #ifndef OPENSSL_NO_SOCK 515. > BIO *ret = NULL, *con = NULL, *ssl = NULL; 516. 517. if ((con = BIO_new(BIO_s_connect())) == NULL) ssl/bio_ssl.c:517:9: 515. BIO *ret = NULL, *con = NULL, *ssl = NULL; 516. 517. > if ((con = BIO_new(BIO_s_connect())) == NULL) 518. return (NULL); 519. if ((ssl = BIO_new_ssl(ctx, 1)) == NULL) crypto/bio/bss_conn.c:308:1: start of procedure BIO_s_connect() 306. } 307. 308. > BIO_METHOD *BIO_s_connect(void) 309. { 310. return (&methods_connectp); crypto/bio/bss_conn.c:310:5: 308. BIO_METHOD *BIO_s_connect(void) 309. { 310. > return (&methods_connectp); 311. } 312. crypto/bio/bss_conn.c:311:1: return from a call to BIO_s_connect 309. { 310. return (&methods_connectp); 311. > } 312. 313. static int conn_new(BIO *bi) crypto/bio/bio_lib.c:66:1: start of procedure BIO_new() 64. #include <openssl/stack.h> 65. 66. > BIO *BIO_new(BIO_METHOD *method) 67. { 68. BIO *ret = OPENSSL_malloc(sizeof(*ret)); crypto/bio/bio_lib.c:68:5: 66. BIO *BIO_new(BIO_METHOD *method) 67. { 68. > BIO *ret = OPENSSL_malloc(sizeof(*ret)); 69. 70. 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/bio/bio_lib.c:70:9: Taking false branch 68. BIO *ret = OPENSSL_malloc(sizeof(*ret)); 69. 70. if (ret == NULL) { ^ 71. BIOerr(BIO_F_BIO_NEW, ERR_R_MALLOC_FAILURE); 72. return (NULL); crypto/bio/bio_lib.c:74:10: Taking false branch 72. return (NULL); 73. } 74. if (!BIO_set(ret, method)) { ^ 75. OPENSSL_free(ret); 76. ret = NULL; crypto/bio/bio_lib.c:78:5: 76. ret = NULL; 77. } 78. > return (ret); 79. } 80. crypto/bio/bio_lib.c:79:1: return from a call to BIO_new 77. } 78. return (ret); 79. > } 80. 81. int BIO_set(BIO *bio, BIO_METHOD *method) ssl/bio_ssl.c:517:9: Taking false branch 515. BIO *ret = NULL, *con = NULL, *ssl = NULL; 516. 517. if ((con = BIO_new(BIO_s_connect())) == NULL) ^ 518. return (NULL); 519. if ((ssl = BIO_new_ssl(ctx, 1)) == NULL) ssl/bio_ssl.c:519:9: 517. if ((con = BIO_new(BIO_s_connect())) == NULL) 518. return (NULL); 519. > if ((ssl = BIO_new_ssl(ctx, 1)) == NULL) 520. goto err; 521. if ((ret = BIO_push(ssl, con)) == NULL) ssl/bio_ssl.c:530:1: start of procedure BIO_new_ssl() 528. } 529. 530. > BIO *BIO_new_ssl(SSL_CTX *ctx, int client) 531. { 532. BIO *ret; ssl/bio_ssl.c:535:9: 533. SSL *ssl; 534. 535. > if ((ret = BIO_new(BIO_f_ssl())) == NULL) 536. return (NULL); 537. if ((ssl = SSL_new(ctx)) == NULL) { ssl/bio_ssl.c:97:1: start of procedure BIO_f_ssl() 95. }; 96. 97. > BIO_METHOD *BIO_f_ssl(void) 98. { 99. return (&methods_sslp); ssl/bio_ssl.c:99:5: 97. BIO_METHOD *BIO_f_ssl(void) 98. { 99. > return (&methods_sslp); 100. } 101. ssl/bio_ssl.c:100:1: return from a call to BIO_f_ssl 98. { 99. return (&methods_sslp); 100. > } 101. 102. static int ssl_new(BIO *bi) crypto/bio/bio_lib.c:66:1: start of procedure BIO_new() 64. #include <openssl/stack.h> 65. 66. > BIO *BIO_new(BIO_METHOD *method) 67. { 68. BIO *ret = OPENSSL_malloc(sizeof(*ret)); crypto/bio/bio_lib.c:68:5: 66. BIO *BIO_new(BIO_METHOD *method) 67. { 68. > BIO *ret = OPENSSL_malloc(sizeof(*ret)); 69. 70. 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/bio/bio_lib.c:70:9: Taking false branch 68. BIO *ret = OPENSSL_malloc(sizeof(*ret)); 69. 70. if (ret == NULL) { ^ 71. BIOerr(BIO_F_BIO_NEW, ERR_R_MALLOC_FAILURE); 72. return (NULL); crypto/bio/bio_lib.c:74:10: Taking true branch 72. return (NULL); 73. } 74. if (!BIO_set(ret, method)) { ^ 75. OPENSSL_free(ret); 76. ret = NULL; crypto/bio/bio_lib.c:75:9: 73. } 74. if (!BIO_set(ret, method)) { 75. > OPENSSL_free(ret); 76. ret = NULL; 77. } 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/bio/bio_lib.c:76:9: 74. if (!BIO_set(ret, method)) { 75. OPENSSL_free(ret); 76. > ret = NULL; 77. } 78. return (ret); crypto/bio/bio_lib.c:78:5: 76. ret = NULL; 77. } 78. > return (ret); 79. } 80. crypto/bio/bio_lib.c:79:1: return from a call to BIO_new 77. } 78. return (ret); 79. > } 80. 81. int BIO_set(BIO *bio, BIO_METHOD *method) ssl/bio_ssl.c:535:9: Taking true branch 533. SSL *ssl; 534. 535. if ((ret = BIO_new(BIO_f_ssl())) == NULL) ^ 536. return (NULL); 537. if ((ssl = SSL_new(ctx)) == NULL) { ssl/bio_ssl.c:536:9: 534. 535. if ((ret = BIO_new(BIO_f_ssl())) == NULL) 536. > return (NULL); 537. if ((ssl = SSL_new(ctx)) == NULL) { 538. BIO_free(ret); ssl/bio_ssl.c:548:1: return from a call to BIO_new_ssl 546. BIO_set_ssl(ret, ssl, BIO_CLOSE); 547. return (ret); 548. > } 549. 550. int BIO_ssl_copy_session_id(BIO *t, BIO *f) ssl/bio_ssl.c:519:9: Taking true branch 517. if ((con = BIO_new(BIO_s_connect())) == NULL) 518. return (NULL); 519. if ((ssl = BIO_new_ssl(ctx, 1)) == NULL) ^ 520. goto err; 521. if ((ret = BIO_push(ssl, con)) == NULL) ssl/bio_ssl.c:524:2: 522. goto err; 523. return (ret); 524. > err: 525. BIO_free(con); 526. #endif ssl/bio_ssl.c:525:5: 523. return (ret); 524. err: 525. > BIO_free(con); 526. #endif 527. return (NULL); crypto/bio/bio_lib.c:106:1: start of procedure BIO_free() 104. } 105. 106. > int BIO_free(BIO *a) 107. { 108. int i; crypto/bio/bio_lib.c:110:9: Taking false branch 108. int i; 109. 110. if (a == NULL) ^ 111. return (0); 112. crypto/bio/bio_lib.c:113:5: 111. return (0); 112. 113. > i = CRYPTO_add(&a->references, -1, CRYPTO_LOCK_BIO); 114. #ifdef REF_PRINT 115. REF_PRINT("BIO", a); crypto/lock.c:456:1: start of procedure CRYPTO_add_lock() 454. } 455. 456. > int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file, 457. int line) 458. { crypto/lock.c:459:5: 457. int line) 458. { 459. > int ret = 0; 460. 461. if (add_lock_callback != NULL) { crypto/lock.c:461:9: Taking false branch 459. int ret = 0; 460. 461. if (add_lock_callback != NULL) { ^ 462. #ifdef LOCK_DEBUG 463. int before = *pointer; crypto/lock.c:477:9: 475. #endif 476. } else { 477. > CRYPTO_lock(CRYPTO_LOCK | CRYPTO_WRITE, type, file, line); 478. 479. ret = *pointer + amount; crypto/lock.c:414:1: start of procedure CRYPTO_lock() 412. } 413. 414. > void CRYPTO_lock(int mode, int type, const char *file, int line) 415. { 416. #ifdef LOCK_DEBUG crypto/lock.c:441:9: Taking false branch 439. } 440. #endif 441. if (type < 0) { ^ 442. if (dynlock_lock_callback != NULL) { 443. struct CRYPTO_dynlock_value *pointer crypto/lock.c:452:16: Taking false branch 450. CRYPTO_destroy_dynlockid(type); 451. } 452. } else if (locking_callback != NULL) ^ 453. locking_callback(mode, type, file, line); 454. } crypto/lock.c:441:5: 439. } 440. #endif 441. > if (type < 0) { 442. if (dynlock_lock_callback != NULL) { 443. struct CRYPTO_dynlock_value *pointer crypto/lock.c:454:1: return from a call to CRYPTO_lock 452. } else if (locking_callback != NULL) 453. locking_callback(mode, type, file, line); 454. > } 455. 456. int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file, crypto/lock.c:479:9: 477. CRYPTO_lock(CRYPTO_LOCK | CRYPTO_WRITE, type, file, line); 478. 479. > ret = *pointer + amount; 480. #ifdef LOCK_DEBUG 481. { crypto/lock.c:490:9: 488. } 489. #endif 490. > *pointer = ret; 491. CRYPTO_lock(CRYPTO_UNLOCK | CRYPTO_WRITE, type, file, line); 492. } crypto/lock.c:491:9: 489. #endif 490. *pointer = ret; 491. > CRYPTO_lock(CRYPTO_UNLOCK | CRYPTO_WRITE, type, file, line); 492. } 493. return (ret); crypto/lock.c:414:1: start of procedure CRYPTO_lock() 412. } 413. 414. > void CRYPTO_lock(int mode, int type, const char *file, int line) 415. { 416. #ifdef LOCK_DEBUG crypto/lock.c:441:9: Taking false branch 439. } 440. #endif 441. if (type < 0) { ^ 442. if (dynlock_lock_callback != NULL) { 443. struct CRYPTO_dynlock_value *pointer crypto/lock.c:452:16: Taking false branch 450. CRYPTO_destroy_dynlockid(type); 451. } 452. } else if (locking_callback != NULL) ^ 453. locking_callback(mode, type, file, line); 454. } crypto/lock.c:441:5: 439. } 440. #endif 441. > if (type < 0) { 442. if (dynlock_lock_callback != NULL) { 443. struct CRYPTO_dynlock_value *pointer crypto/lock.c:454:1: return from a call to CRYPTO_lock 452. } else if (locking_callback != NULL) 453. locking_callback(mode, type, file, line); 454. > } 455. 456. int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file, crypto/lock.c:493:5: 491. CRYPTO_lock(CRYPTO_UNLOCK | CRYPTO_WRITE, type, file, line); 492. } 493. > return (ret); 494. } 495. crypto/lock.c:494:1: return from a call to CRYPTO_add_lock 492. } 493. return (ret); 494. > } 495. 496. const char *CRYPTO_get_lock_name(int type) crypto/bio/bio_lib.c:117:9: Taking false branch 115. REF_PRINT("BIO", a); 116. #endif 117. if (i > 0) ^ 118. return (1); 119. #ifdef REF_CHECK crypto/bio/bio_lib.c:125:10: Taking true branch 123. } 124. #endif 125. if ((a->callback != NULL) && ^ 126. ((i = (int)a->callback(a, BIO_CB_FREE, NULL, 0, 0L, 1L)) <= 0)) 127. return (i); crypto/bio/bio_lib.c:126:10: Taking true branch 124. #endif 125. if ((a->callback != NULL) && 126. ((i = (int)a->callback(a, BIO_CB_FREE, NULL, 0, 0L, 1L)) <= 0)) ^ 127. return (i); 128. crypto/bio/bio_lib.c:127:9: 125. if ((a->callback != NULL) && 126. ((i = (int)a->callback(a, BIO_CB_FREE, NULL, 0, 0L, 1L)) <= 0)) 127. > return (i); 128. 129. CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, a, &a->ex_data); crypto/bio/bio_lib.c:135:1: return from a call to BIO_free 133. OPENSSL_free(a); 134. return (1); 135. > } 136. 137. void BIO_vfree(BIO *a)
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/ssl/bio_ssl.c/#L525
d2a_code_trace_data_44177
int bn_cmp_words(const BN_ULONG *a, const BN_ULONG *b, int n) { int i; BN_ULONG aa, bb; aa = a[n - 1]; bb = b[n - 1]; if (aa != bb) return ((aa > bb) ? 1 : -1); for (i = n - 2; i >= 0; i--) { aa = a[i]; bb = b[i]; if (aa != bb) return ((aa > bb) ? 1 : -1); } return (0); } test/bntest.c:1078: error: BUFFER_OVERRUN_L3 Offset: [8, +oo] (⇐ [8, +oo] + [0, +oo]) Size: [0, 8388607] by call to `BN_mod_exp_mont_consttime`. Showing all 23 steps of the trace test/bntest.c:1075:5: Call 1073. e = BN_new(); 1074. 1075. BN_one(a); ^ 1076. BN_one(b); 1077. BN_zero(c); 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)) test/bntest.c:1078:9: Call 1076. BN_one(b); 1077. BN_zero(c); 1078. if (BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL)) { ^ 1079. fprintf(stderr, "BN_mod_exp_mont_consttime with zero modulus " 1080. "succeeded\n"); crypto/bn/bn_exp.c:601:1: Parameter `*a->d` 599. * http://www.daemonology.net/hyperthreading-considered-harmful/) 600. */ 601. > int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, 602. const BIGNUM *m, BN_CTX *ctx, 603. BN_MONT_CTX *in_mont) crypto/bn/bn_exp.c:758:17: Call 756. if (!BN_to_montgomery(&am, &am, mont, ctx)) 757. goto err; 758. } else if (!BN_to_montgomery(&am, a, mont, ctx)) ^ 759. goto err; 760. crypto/bn/bn_lib.c:945:1: Parameter `*a->d` 943. } 944. 945. > int BN_to_montgomery(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont, 946. BN_CTX *ctx) 947. { crypto/bn/bn_lib.c:948:12: Call 946. BN_CTX *ctx) 947. { 948. return BN_mod_mul_montgomery(r, a, &(mont->RR), mont, ctx); ^ 949. } 950. crypto/bn/bn_mont.c:26:1: Parameter `*a->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:828:1: Parameter `*a->d` 826. #endif /* BN_RECURSION */ 827. 828. > int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) 829. { 830. int ret = 0; crypto/bn/bn_mul.c:909:17: Call 907. if (bn_wexpand(rr, k * 4) == NULL) 908. goto err; 909. bn_mul_part_recursive(rr->d, a->d, b->d, ^ 910. j, al - j, bl - j, t->d); 911. } else { /* al <= j || bl <= j */ crypto/bn/bn_mul.c:480:1: Parameter `n` 478. */ 479. /* tnX may not be negative but less than n */ 480. > void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n, 481. int tna, int tnb, BN_ULONG *t) 482. { crypto/bn/bn_mul.c:493:10: Call 491. 492. /* r=(a[0]-a[1])*(b[1]-b[0]) */ 493. c1 = bn_cmp_part_words(a, &(a[n]), tna, n - tna); ^ 494. c2 = bn_cmp_part_words(&(b[n]), b, tnb, tnb - n); 495. neg = 0; crypto/bn/bn_lib.c:803:1: Parameter `cl` 801. */ 802. 803. > int bn_cmp_part_words(const BN_ULONG *a, const BN_ULONG *b, int cl, int dl) 804. { 805. int n, i; crypto/bn/bn_lib.c:820:12: Call 818. } 819. } 820. return bn_cmp_words(a, b, cl); ^ 821. } 822. crypto/bn/bn_lib.c:776:1: <Offset trace> 774. } 775. 776. > int bn_cmp_words(const BN_ULONG *a, const BN_ULONG *b, int n) 777. { 778. int i; crypto/bn/bn_lib.c:776:1: Parameter `n` 774. } 775. 776. > int bn_cmp_words(const BN_ULONG *a, const BN_ULONG *b, int n) 777. { 778. int i; crypto/bn/bn_lib.c:785:10: Assignment 783. if (aa != bb) 784. return ((aa > bb) ? 1 : -1); 785. for (i = n - 2; i >= 0; i--) { ^ 786. aa = a[i]; 787. bb = b[i]; crypto/bn/bn_lib.c:776:1: <Length trace> 774. } 775. 776. > int bn_cmp_words(const BN_ULONG *a, const BN_ULONG *b, int n) 777. { 778. int i; crypto/bn/bn_lib.c:776:1: Parameter `*b` 774. } 775. 776. > int bn_cmp_words(const BN_ULONG *a, const BN_ULONG *b, int n) 777. { 778. int i; crypto/bn/bn_lib.c:787:14: Array access: Offset: [8, +oo] (⇐ [8, +oo] + [0, +oo]) Size: [0, 8388607] by call to `BN_mod_exp_mont_consttime` 785. for (i = n - 2; i >= 0; i--) { 786. aa = a[i]; 787. bb = b[i]; ^ 788. if (aa != bb) 789. return ((aa > bb) ? 1 : -1);
https://github.com/openssl/openssl/blob/b3618f44a7b8504bfb0a64e8a33e6b8e56d4d516/crypto/bn/bn_lib.c/#L787
d2a_code_trace_data_44178
void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) { int i, j, max; const BN_ULONG *ap; BN_ULONG *rp; max = n * 2; ap = a; rp = r; rp[0] = rp[max - 1] = 0; rp++; j = n; if (--j > 0) { ap++; rp[j] = bn_mul_words(rp, ap, j, ap[-1]); rp += 2; } for (i = n - 2; i > 0; i--) { j--; ap++; rp[j] = bn_mul_add_words(rp, ap, j, ap[-1]); rp += 2; } bn_add_words(r, r, r, max); bn_sqr_words(tmp, a, n); bn_add_words(r, r, tmp, max); } ssl/tls_srp.c:294: error: BUFFER_OVERRUN_L3 Offset: [2, 15] (⇐ 1 + [1, 14]) Size: [0, 8388607] by call to `SRP_Calc_server_key`. Showing all 24 steps of the trace ssl/tls_srp.c:284:1: Parameter `s->srp_ctx.A->top` 282. } 283. 284. > int srp_generate_server_master_secret(SSL *s) 285. { 286. BIGNUM *K = NULL, *u = NULL; ssl/tls_srp.c:290:10: Call 288. unsigned char *tmp = NULL; 289. 290. if (!SRP_Verify_A_mod_N(s->srp_ctx.A, s->srp_ctx.N)) ^ 291. goto err; 292. if ((u = SRP_Calc_u(s->srp_ctx.A, s->srp_ctx.B, s->srp_ctx.N)) == NULL) crypto/srp/srp_lib.c:274:1: Parameter `A->top` 272. } 273. 274. > int SRP_Verify_A_mod_N(const BIGNUM *A, const BIGNUM *N) 275. { 276. /* Checks if A % N == 0 */ crypto/srp/srp_lib.c:277:12: Call 275. { 276. /* Checks if A % N == 0 */ 277. return SRP_Verify_B_mod_N(A, N); ^ 278. } 279. crypto/srp/srp_lib.c:253:1: Parameter `B->top` 251. } 252. 253. > int SRP_Verify_B_mod_N(const BIGNUM *B, const BIGNUM *N) 254. { 255. BIGNUM *r; ssl/tls_srp.c:292:14: Call 290. if (!SRP_Verify_A_mod_N(s->srp_ctx.A, s->srp_ctx.N)) 291. goto err; 292. if ((u = SRP_Calc_u(s->srp_ctx.A, s->srp_ctx.B, s->srp_ctx.N)) == NULL) ^ 293. goto err; 294. if ((K = SRP_Calc_server_key(s->srp_ctx.A, s->srp_ctx.v, u, s->srp_ctx.b, crypto/srp/srp_lib.c:55:1: Parameter `A->top` 53. } 54. 55. > BIGNUM *SRP_Calc_u(const BIGNUM *A, const BIGNUM *B, const BIGNUM *N) 56. { 57. /* k = SHA1(PAD(A) || PAD(B) ) -- tls-srp draft 8 */ ssl/tls_srp.c:294:14: Call 292. if ((u = SRP_Calc_u(s->srp_ctx.A, s->srp_ctx.B, s->srp_ctx.N)) == NULL) 293. goto err; 294. if ((K = SRP_Calc_server_key(s->srp_ctx.A, s->srp_ctx.v, u, s->srp_ctx.b, ^ 295. s->srp_ctx.N)) == NULL) 296. goto err; crypto/srp/srp_lib.c:98:1: Parameter `A->top` 96. } 97. 98. > BIGNUM *SRP_Calc_server_key(const BIGNUM *A, const BIGNUM *v, const BIGNUM *u, 99. const BIGNUM *b, const BIGNUM *N) 100. { crypto/srp/srp_lib.c:114:10: Call 112. if (!BN_mod_exp(tmp, v, u, N, bn_ctx)) 113. goto err; 114. if (!BN_mod_mul(tmp, A, tmp, N, bn_ctx)) ^ 115. goto err; 116. crypto/bn/bn_mod.c:73:1: Parameter `a->top` 71. 72. /* slow but works */ 73. > int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, 74. BN_CTX *ctx) 75. { crypto/bn/bn_mod.c:87:14: Call 85. goto err; 86. if (a == b) { 87. if (!BN_sqr(t, a, ctx)) ^ 88. goto err; 89. } else { crypto/bn/bn_sqr.c:17:1: Parameter `a->top` 15. * I've just gone over this and it is now %20 faster on x86 - eay - 27 Jun 96 16. */ 17. > int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) 18. { 19. int max, al; crypto/bn/bn_sqr.c:25:5: Assignment 23. bn_check_top(a); 24. 25. al = a->top; ^ 26. if (al <= 0) { 27. r->top = 0; crypto/bn/bn_sqr.c:60:13: Call 58. if (al < BN_SQR_RECURSIVE_SIZE_NORMAL) { 59. BN_ULONG t[BN_SQR_RECURSIVE_SIZE_NORMAL * 2]; 60. bn_sqr_normal(rr->d, a->d, al, t); ^ 61. } else { 62. int j, k; crypto/bn/bn_sqr.c:104:1: <Offset trace> 102. 103. /* tmp must have 2*n words */ 104. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 105. { 106. int i, j, max; crypto/bn/bn_sqr.c:104:1: Parameter `n` 102. 103. /* tmp must have 2*n words */ 104. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 105. { 106. int i, j, max; crypto/bn/bn_sqr.c:115:5: Assignment 113. rp[0] = rp[max - 1] = 0; 114. rp++; 115. j = n; ^ 116. 117. if (--j > 0) { crypto/bn/bn_sqr.c:117:9: Assignment 115. j = n; 116. 117. if (--j > 0) { ^ 118. ap++; 119. rp[j] = bn_mul_words(rp, ap, j, ap[-1]); crypto/bn/bn_sqr.c:104:1: <Length trace> 102. 103. /* tmp must have 2*n words */ 104. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 105. { 106. int i, j, max; crypto/bn/bn_sqr.c:104:1: Parameter `*r` 102. 103. /* tmp must have 2*n words */ 104. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 105. { 106. int i, j, max; crypto/bn/bn_sqr.c:112:5: Assignment 110. max = n * 2; 111. ap = a; 112. rp = r; ^ 113. rp[0] = rp[max - 1] = 0; 114. rp++; crypto/bn/bn_sqr.c:114:5: Assignment 112. rp = r; 113. rp[0] = rp[max - 1] = 0; 114. rp++; ^ 115. j = n; 116. crypto/bn/bn_sqr.c:119:9: Array access: Offset: [2, 15] (⇐ 1 + [1, 14]) Size: [0, 8388607] by call to `SRP_Calc_server_key` 117. if (--j > 0) { 118. ap++; 119. rp[j] = bn_mul_words(rp, ap, j, ap[-1]); ^ 120. rp += 2; 121. }
https://github.com/openssl/openssl/blob/4973a60cb92dc121fc09246bff3815afc0f8ab9a/crypto/bn/bn_sqr.c/#L119
d2a_code_trace_data_44179
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)) { SSLfatal(s, SSL_AD_INTERNAL_ERROR, 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 { SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_SSL3_WRITE_PENDING, SSL_R_BIO_NOT_SET); i = -1; } if (i > 0 && tmpwrit == SSL3_BUFFER_get_left(&wb[currbuf])) { SSL3_BUFFER_set_left(&wb[currbuf], 0); SSL3_BUFFER_add_offset(&wb[currbuf], tmpwrit); if (currbuf + 1 < s->rlayer.numwpipes) continue; s->rwstate = SSL_NOTHING; *written = s->rlayer.wpend_ret; return 1; } else if (i <= 0) { if (SSL_IS_DTLS(s)) { SSL3_BUFFER_set_left(&wb[currbuf], 0); } return i; } SSL3_BUFFER_add_offset(&wb[currbuf], tmpwrit); SSL3_BUFFER_sub_left(&wb[currbuf], tmpwrit); } } ssl/record/rec_layer_d1.c:411: 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:340:1: Parameter `s->rlayer.numwpipes` 338. * none of our business 339. */ 340. > int dtls1_read_bytes(SSL *s, int type, int *recvd_type, unsigned char *buf, 341. size_t len, int peek, size_t *readbytes) 342. { ssl/record/rec_layer_d1.c:411:9: Call 409. 410. /* Check for timeout */ 411. if (dtls1_handle_timeout(s) > 0) { ^ 412. goto start; 413. } else if (ossl_statem_in_error(s)) { ssl/d1_lib.c:389:1: Parameter `s->rlayer.numwpipes` 387. } 388. 389. > int dtls1_handle_timeout(SSL *s) 390. { 391. /* if no timer is expired, don't do anything */ ssl/d1_lib.c:413:12: Call 411. dtls1_start_timer(s); 412. /* Calls SSLfatal() if required */ 413. return dtls1_retransmit_buffered_messages(s); ^ 414. } 415. ssl/statem/statem_dtls.c:979:1: Parameter `s->rlayer.numwpipes` 977. } 978. 979. > int dtls1_retransmit_buffered_messages(SSL *s) 980. { 981. pqueue *sent = s->d1->sent_messages; ssl/statem/statem_dtls.c:991:13: Call 989. for (item = pqueue_next(&iter); item != NULL; item = pqueue_next(&iter)) { 990. frag = (hm_fragment *)item->data; 991. if (dtls1_retransmit_message(s, (unsigned short) ^ 992. dtls1_get_queue_priority 993. (frag->msg_header.seq, ssl/statem/statem_dtls.c:1068:1: Parameter `s->rlayer.numwpipes` 1066. } 1067. 1068. > int dtls1_retransmit_message(SSL *s, unsigned short seq, int *found) 1069. { 1070. int ret; ssl/statem/statem_dtls.c:1126:11: Call 1124. saved_retransmit_state.epoch); 1125. 1126. ret = dtls1_do_write(s, frag->msg_header.is_ccs ? ^ 1127. SSL3_RT_CHANGE_CIPHER_SPEC : SSL3_RT_HANDSHAKE); 1128. 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:240:15: Call 238. } 239. 240. ret = dtls1_write_bytes(s, type, &s->init_buf->data[s->init_off], len, ^ 241. &written); 242. if (ret < 0) { ssl/record/rec_layer_d1.c:750:1: Parameter `s->rlayer.numwpipes` 748. * not all data has been sent or non-blocking IO. 749. */ 750. > int dtls1_write_bytes(SSL *s, int type, const void *buf, size_t len, 751. size_t *written) 752. { ssl/record/rec_layer_d1.c:761:9: Call 759. } 760. s->rwstate = SSL_NOTHING; 761. i = do_dtls1_write(s, type, buf, len, 0, written); ^ 762. return i; 763. } ssl/record/rec_layer_d1.c:765:1: Parameter `s->rlayer.numwpipes` 763. } 764. 765. > int do_dtls1_write(SSL *s, int type, const unsigned char *buf, 766. size_t len, int create_empty_fragment, size_t *written) 767. { ssl/record/rec_layer_d1.c:974:12: Call 972. 973. /* we now just need to write the buffer. Calls SSLfatal() as required. */ 974. return ssl3_write_pending(s, type, buf, len, written); ^ 975. } 976. ssl/record/rec_layer_s3.c:1108:1: <LHS trace> 1106. * Return values are as per SSL_write() 1107. */ 1108. > int ssl3_write_pending(SSL *s, int type, const unsigned char *buf, size_t len, 1109. size_t *written) 1110. { ssl/record/rec_layer_s3.c:1108:1: Parameter `s->rlayer.numwpipes` 1106. * Return values are as per SSL_write() 1107. */ 1108. > int ssl3_write_pending(SSL *s, int type, const unsigned char *buf, size_t len, 1109. size_t *written) 1110. { ssl/record/rec_layer_s3.c:1128:16: Binary operation: ([0, max(1, s->rlayer.numwpipes)] - 1):unsigned64 by call to `dtls1_handle_timeout` 1126. /* Loop until we find a buffer we haven't written out yet */ 1127. if (SSL3_BUFFER_get_left(&wb[currbuf]) == 0 1128. && currbuf < s->rlayer.numwpipes - 1) { ^ 1129. currbuf++; 1130. continue;
https://github.com/openssl/openssl/blob/a8ea8018fa187e22fb4989450b550589e20f62c2/ssl/record/rec_layer_s3.c/#L1128
d2a_code_trace_data_44180
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/rsa/rsa_chk.c:66: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mul`. Showing all 19 steps of the trace crypto/rsa/rsa_chk.c:54:9: Call 52. 53. /* p prime? */ 54. if (BN_is_prime_ex(key->p, BN_prime_checks, NULL, cb) != 1) { ^ 55. ret = 0; 56. RSAerr(RSA_F_RSA_CHECK_KEY_EX, RSA_R_P_NOT_PRIME); crypto/bn/bn_prime.c:194:1: Parameter `ctx_passed->stack.depth` 192. } 193. 194. > int BN_is_prime_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed, 195. BN_GENCB *cb) 196. { 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:200:1: Parameter `ctx_passed->stack.depth` 198. } 199. 200. > int BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed, 201. int do_trial_division, BN_GENCB *cb) 202. { crypto/rsa/rsa_chk.c:60:9: Call 58. 59. /* q prime? */ 60. if (BN_is_prime_ex(key->q, BN_prime_checks, NULL, cb) != 1) { ^ 61. ret = 0; 62. RSAerr(RSA_F_RSA_CHECK_KEY_EX, RSA_R_Q_NOT_PRIME); crypto/bn/bn_prime.c:194:1: Parameter `ctx_passed->stack.depth` 192. } 193. 194. > int BN_is_prime_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed, 195. BN_GENCB *cb) 196. { 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:200:1: Parameter `ctx_passed->stack.depth` 198. } 199. 200. > int BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed, 201. int do_trial_division, BN_GENCB *cb) 202. { crypto/rsa/rsa_chk.c:66:10: Call 64. 65. /* n = p*q? */ 66. if (!BN_mul(i, key->p, key->q, ctx)) { ^ 67. ret = -1; 68. goto err; crypto/bn/bn_mul.c:855:5: Call 853. top = al + bl; 854. 855. BN_CTX_start(ctx); ^ 856. if ((r == a) || (r == b)) { 857. if ((rr = BN_CTX_get(ctx)) == NULL) crypto/bn/bn_ctx.c:181:1: Parameter `*ctx->stack.indexes` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_mul.c:979:5: Call 977. err: 978. bn_check_top(r); 979. BN_CTX_end(ctx); ^ 980. return (ret); 981. } crypto/bn/bn_ctx.c:195:1: Parameter `*ctx->stack.indexes` 193. } 194. 195. > void BN_CTX_end(BN_CTX *ctx) 196. { 197. CTXDBG_ENTRY("BN_CTX_end", ctx); crypto/bn/bn_ctx.c:201:27: Call 199. ctx->err_stack--; 200. else { 201. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 202. /* Does this stack frame have anything to release? */ 203. if (fp < ctx->used) crypto/bn/bn_ctx.c:271:1: <Offset trace> 269. } 270. 271. > static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:271:1: Parameter `st->depth` 269. } 270. 271. > static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:271:1: <Length trace> 269. } 270. 271. > static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:271:1: Parameter `*st->indexes` 269. } 270. 271. > static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:273:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mul` 271. static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; ^ 274. } 275.
https://github.com/openssl/openssl/blob/2f3930bc0edbfdc7718f709b856fa53f0ec57cde/crypto/bn/bn_ctx.c/#L273
d2a_code_trace_data_44181
static void doapr_outch(char **sbuffer, char **buffer, size_t *currlen, size_t *maxlen, int c) { assert(*sbuffer != NULL || buffer != NULL); if (buffer) { while (*currlen >= *maxlen) { if (*buffer == NULL) { if (*maxlen == 0) *maxlen = 1024; *buffer = OPENSSL_malloc(*maxlen); if(!*buffer) { return; } if (*currlen > 0) { assert(*sbuffer != NULL); memcpy(*buffer, *sbuffer, *currlen); } *sbuffer = NULL; } else { *maxlen += 1024; *buffer = OPENSSL_realloc(*buffer, *maxlen); if(!*buffer) { return; } } } assert(*sbuffer != NULL || *buffer != NULL); } if (*currlen < *maxlen) { if (*sbuffer) (*sbuffer)[(*currlen)++] = (char)c; else (*buffer)[(*currlen)++] = (char)c; } return; } crypto/bio/bio_cb.c:90: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] (⇐ [-1, 2147483647] + [0, +oo]) Size: 256 by call to `BIO_snprintf`. Showing all 14 steps of the trace crypto/bio/bio_cb.c:66:1: Array declaration 64. #include <openssl/err.h> 65. 66. > long BIO_debug_callback(BIO *bio, int cmd, const char *argp, 67. int argi, long argl, long ret) 68. { crypto/bio/bio_cb.c:81:5: Assignment 79. len = BIO_snprintf(buf,sizeof buf,"BIO[%p]: ",(void *)bio); 80. 81. p = buf + len; ^ 82. p_maxlen = sizeof(buf) - len; 83. crypto/bio/bio_cb.c:90:13: Call 88. case BIO_CB_READ: 89. if (bio->method->type & BIO_TYPE_DESCRIPTOR) 90. BIO_snprintf(p, p_maxlen, "read(%d,%lu) - %s fd=%d\n", ^ 91. bio->num, (unsigned long)argi, 92. bio->method->name, bio->num); crypto/bio/b_print.c:794:1: Parameter `*buf` 792. * function should be renamed, but to what?) 793. */ 794. > int BIO_snprintf(char *buf, size_t n, const char *format, ...) 795. { 796. va_list args; crypto/bio/b_print.c:801:11: Call 799. va_start(args, format); 800. 801. ret = BIO_vsnprintf(buf, n, format, args); ^ 802. 803. va_end(args); crypto/bio/b_print.c:807:1: Parameter `*buf` 805. } 806. 807. > int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args) 808. { 809. size_t retlen; crypto/bio/b_print.c:812:5: Call 810. int truncated; 811. 812. _dopr(&buf, NULL, &n, &retlen, &truncated, format, args); ^ 813. 814. if (truncated) crypto/bio/b_print.c:168:1: Parameter `*maxlen` 166. #define OSSL_MAX(p,q) ((p >= q) ? p : q) 167. 168. > static void 169. _dopr(char **sbuffer, 170. char **buffer, crypto/bio/b_print.c:199:17: Call 197. state = DP_S_FLAGS; 198. else 199. doapr_outch(sbuffer, buffer, &currlen, maxlen, ch); ^ 200. ch = *format++; 201. break; crypto/bio/b_print.c:703:1: <Offset trace> 701. } 702. 703. > static void 704. doapr_outch(char **sbuffer, 705. char **buffer, size_t *currlen, size_t *maxlen, int c) crypto/bio/b_print.c:703:1: Parameter `*maxlen` 701. } 702. 703. > static void 704. doapr_outch(char **sbuffer, 705. char **buffer, size_t *currlen, size_t *maxlen, int c) crypto/bio/b_print.c:703:1: <Length trace> 701. } 702. 703. > static void 704. doapr_outch(char **sbuffer, 705. char **buffer, size_t *currlen, size_t *maxlen, int c) crypto/bio/b_print.c:703:1: Parameter `**sbuffer` 701. } 702. 703. > static void 704. doapr_outch(char **sbuffer, 705. char **buffer, size_t *currlen, size_t *maxlen, int c) crypto/bio/b_print.c:740:13: Array access: Offset: [-1, +oo] (⇐ [-1, 2147483647] + [0, +oo]) Size: 256 by call to `BIO_snprintf` 738. if (*currlen < *maxlen) { 739. if (*sbuffer) 740. (*sbuffer)[(*currlen)++] = (char)c; ^ 741. else 742. (*buffer)[(*currlen)++] = (char)c;
https://github.com/openssl/openssl/blob/ac5a110621ca48f0bebd5b4d76d081de403da29e/crypto/bio/b_print.c/#L740
d2a_code_trace_data_44182
int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, size_t num, const EC_POINT *points[], const BIGNUM *scalars[], BN_CTX *ctx) { BN_CTX *new_ctx = NULL; const EC_POINT *generator = NULL; EC_POINT *tmp = NULL; size_t totalnum; size_t blocksize = 0, numblocks = 0; size_t pre_points_per_block = 0; size_t i, j; int k; int r_is_inverted = 0; int r_is_at_infinity = 1; size_t *wsize = NULL; signed char **wNAF = NULL; size_t *wNAF_len = NULL; size_t max_len = 0; size_t num_val; EC_POINT **val = NULL; EC_POINT **v; EC_POINT ***val_sub = NULL; const EC_PRE_COMP *pre_comp = NULL; int num_scalar = 0; int ret = 0; if (!ec_point_is_compat(r, group)) { ECerr(EC_F_EC_WNAF_MUL, EC_R_INCOMPATIBLE_OBJECTS); return 0; } if ((scalar == NULL) && (num == 0)) { return EC_POINT_set_to_infinity(group, r); } if (!BN_is_zero(group->order) && !BN_is_zero(group->cofactor)) { if ((scalar != NULL) && (num == 0)) { return ec_scalar_mul_ladder(group, r, scalar, NULL, ctx); } if ((scalar == NULL) && (num == 1)) { return ec_scalar_mul_ladder(group, r, scalars[0], points[0], ctx); } } for (i = 0; i < num; i++) { if (!ec_point_is_compat(points[i], group)) { ECerr(EC_F_EC_WNAF_MUL, EC_R_INCOMPATIBLE_OBJECTS); return 0; } } if (ctx == NULL) { ctx = new_ctx = BN_CTX_new(); if (ctx == NULL) goto err; } if (scalar != NULL) { generator = EC_GROUP_get0_generator(group); if (generator == NULL) { ECerr(EC_F_EC_WNAF_MUL, EC_R_UNDEFINED_GENERATOR); goto err; } pre_comp = group->pre_comp.ec; if (pre_comp && pre_comp->numblocks && (EC_POINT_cmp(group, generator, pre_comp->points[0], ctx) == 0)) { blocksize = pre_comp->blocksize; numblocks = (BN_num_bits(scalar) / blocksize) + 1; if (numblocks > pre_comp->numblocks) numblocks = pre_comp->numblocks; pre_points_per_block = (size_t)1 << (pre_comp->w - 1); if (pre_comp->num != (pre_comp->numblocks * pre_points_per_block)) { ECerr(EC_F_EC_WNAF_MUL, ERR_R_INTERNAL_ERROR); goto err; } } else { pre_comp = NULL; numblocks = 1; num_scalar = 1; } } totalnum = num + numblocks; wsize = OPENSSL_malloc(totalnum * sizeof(wsize[0])); wNAF_len = OPENSSL_malloc(totalnum * sizeof(wNAF_len[0])); wNAF = OPENSSL_malloc((totalnum + 1) * sizeof(wNAF[0])); val_sub = OPENSSL_malloc(totalnum * sizeof(val_sub[0])); if (wNAF != NULL) wNAF[0] = NULL; if (wsize == NULL || wNAF_len == NULL || wNAF == NULL || val_sub == NULL) { ECerr(EC_F_EC_WNAF_MUL, ERR_R_MALLOC_FAILURE); goto err; } num_val = 0; for (i = 0; i < num + num_scalar; i++) { size_t bits; bits = i < num ? BN_num_bits(scalars[i]) : BN_num_bits(scalar); wsize[i] = EC_window_bits_for_scalar_size(bits); num_val += (size_t)1 << (wsize[i] - 1); wNAF[i + 1] = NULL; wNAF[i] = bn_compute_wNAF((i < num ? scalars[i] : scalar), wsize[i], &wNAF_len[i]); if (wNAF[i] == NULL) goto err; if (wNAF_len[i] > max_len) max_len = wNAF_len[i]; } if (numblocks) { if (pre_comp == NULL) { if (num_scalar != 1) { ECerr(EC_F_EC_WNAF_MUL, ERR_R_INTERNAL_ERROR); goto err; } } else { signed char *tmp_wNAF = NULL; size_t tmp_len = 0; if (num_scalar != 0) { ECerr(EC_F_EC_WNAF_MUL, ERR_R_INTERNAL_ERROR); goto err; } wsize[num] = pre_comp->w; tmp_wNAF = bn_compute_wNAF(scalar, wsize[num], &tmp_len); if (!tmp_wNAF) goto err; if (tmp_len <= max_len) { numblocks = 1; totalnum = num + 1; wNAF[num] = tmp_wNAF; wNAF[num + 1] = NULL; wNAF_len[num] = tmp_len; val_sub[num] = pre_comp->points; } else { signed char *pp; EC_POINT **tmp_points; if (tmp_len < numblocks * blocksize) { numblocks = (tmp_len + blocksize - 1) / blocksize; if (numblocks > pre_comp->numblocks) { ECerr(EC_F_EC_WNAF_MUL, ERR_R_INTERNAL_ERROR); OPENSSL_free(tmp_wNAF); goto err; } totalnum = num + numblocks; } pp = tmp_wNAF; tmp_points = pre_comp->points; for (i = num; i < totalnum; i++) { if (i < totalnum - 1) { wNAF_len[i] = blocksize; if (tmp_len < blocksize) { ECerr(EC_F_EC_WNAF_MUL, ERR_R_INTERNAL_ERROR); OPENSSL_free(tmp_wNAF); goto err; } tmp_len -= blocksize; } else wNAF_len[i] = tmp_len; wNAF[i + 1] = NULL; wNAF[i] = OPENSSL_malloc(wNAF_len[i]); if (wNAF[i] == NULL) { ECerr(EC_F_EC_WNAF_MUL, ERR_R_MALLOC_FAILURE); OPENSSL_free(tmp_wNAF); goto err; } memcpy(wNAF[i], pp, wNAF_len[i]); if (wNAF_len[i] > max_len) max_len = wNAF_len[i]; if (*tmp_points == NULL) { ECerr(EC_F_EC_WNAF_MUL, ERR_R_INTERNAL_ERROR); OPENSSL_free(tmp_wNAF); goto err; } val_sub[i] = tmp_points; tmp_points += pre_points_per_block; pp += blocksize; } OPENSSL_free(tmp_wNAF); } } } val = OPENSSL_malloc((num_val + 1) * sizeof(val[0])); if (val == NULL) { ECerr(EC_F_EC_WNAF_MUL, ERR_R_MALLOC_FAILURE); goto err; } val[num_val] = NULL; v = val; for (i = 0; i < num + num_scalar; i++) { val_sub[i] = v; for (j = 0; j < ((size_t)1 << (wsize[i] - 1)); j++) { *v = EC_POINT_new(group); if (*v == NULL) goto err; v++; } } if (!(v == val + num_val)) { ECerr(EC_F_EC_WNAF_MUL, ERR_R_INTERNAL_ERROR); goto err; } if ((tmp = EC_POINT_new(group)) == NULL) goto err; for (i = 0; i < num + num_scalar; i++) { if (i < num) { if (!EC_POINT_copy(val_sub[i][0], points[i])) goto err; } else { if (!EC_POINT_copy(val_sub[i][0], generator)) goto err; } if (wsize[i] > 1) { if (!EC_POINT_dbl(group, tmp, val_sub[i][0], ctx)) goto err; for (j = 1; j < ((size_t)1 << (wsize[i] - 1)); j++) { if (!EC_POINT_add (group, val_sub[i][j], val_sub[i][j - 1], tmp, ctx)) goto err; } } } if (!EC_POINTs_make_affine(group, num_val, val, ctx)) goto err; r_is_at_infinity = 1; for (k = max_len - 1; k >= 0; k--) { if (!r_is_at_infinity) { if (!EC_POINT_dbl(group, r, r, ctx)) goto err; } for (i = 0; i < totalnum; i++) { if (wNAF_len[i] > (size_t)k) { int digit = wNAF[i][k]; int is_neg; if (digit) { is_neg = digit < 0; if (is_neg) digit = -digit; if (is_neg != r_is_inverted) { if (!r_is_at_infinity) { if (!EC_POINT_invert(group, r, ctx)) goto err; } r_is_inverted = !r_is_inverted; } if (r_is_at_infinity) { if (!EC_POINT_copy(r, val_sub[i][digit >> 1])) goto err; r_is_at_infinity = 0; } else { if (!EC_POINT_add (group, r, r, val_sub[i][digit >> 1], ctx)) goto err; } } } } } if (r_is_at_infinity) { if (!EC_POINT_set_to_infinity(group, r)) goto err; } else { if (r_is_inverted) if (!EC_POINT_invert(group, r, ctx)) goto err; } ret = 1; err: BN_CTX_free(new_ctx); EC_POINT_free(tmp); OPENSSL_free(wsize); OPENSSL_free(wNAF_len); if (wNAF != NULL) { signed char **w; for (w = wNAF; *w != NULL; w++) OPENSSL_free(*w); OPENSSL_free(wNAF); } if (val != NULL) { for (v = val; *v != NULL; v++) EC_POINT_clear_free(*v); OPENSSL_free(val); } OPENSSL_free(val_sub); return ret; } test/ectest.c:53: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [0, 8]):unsigned64 by call to `EC_POINT_mul`. Showing all 14 steps of the trace test/ectest.c:52:13: Call 50. || !TEST_true(EC_POINT_mul(group, Q, order, NULL, NULL, ctx)) 51. || !TEST_true(EC_POINT_is_at_infinity(group, Q)) 52. || !TEST_true(EC_GROUP_precompute_mult(group, ctx)) ^ 53. || !TEST_true(EC_POINT_mul(group, Q, order, NULL, NULL, ctx)) 54. || !TEST_true(EC_POINT_is_at_infinity(group, Q)) crypto/ec/ec_lib.c:949:16: Call 947. if (group->meth->mul == 0) 948. /* use default */ 949. return ec_wNAF_precompute_mult(group, ctx); ^ 950. 951. if (group->meth->precompute_mult != 0) crypto/ec/ec_mult.c:874:5: Assignment 872. * efficiency. 873. */ 874. blocksize = 8; ^ 875. w = 4; 876. if (EC_window_bits_for_scalar_size(bits) > w) { crypto/ec/ec_mult.c:955:5: Assignment 953. 954. pre_comp->group = group; 955. pre_comp->blocksize = blocksize; ^ 956. pre_comp->numblocks = numblocks; 957. pre_comp->w = w; test/ectest.c:53:13: Call 51. || !TEST_true(EC_POINT_is_at_infinity(group, Q)) 52. || !TEST_true(EC_GROUP_precompute_mult(group, ctx)) 53. || !TEST_true(EC_POINT_mul(group, Q, order, NULL, NULL, ctx)) ^ 54. || !TEST_true(EC_POINT_is_at_infinity(group, Q)) 55. || !TEST_true(EC_POINT_copy(P, G)) crypto/ec/ec_lib.c:929:1: Parameter `group->pre_comp.ec->blocksize` 927. } 928. 929. > int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *g_scalar, 930. const EC_POINT *point, const BIGNUM *p_scalar, BN_CTX *ctx) 931. { crypto/ec/ec_lib.c:940:12: Call 938. scalars[0] = p_scalar; 939. 940. return EC_POINTs_mul(group, r, g_scalar, ^ 941. (point != NULL 942. && p_scalar != NULL), points, scalars, ctx); crypto/ec/ec_lib.c:918:1: Parameter `group->pre_comp.ec->blocksize` 916. */ 917. 918. > int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, 919. size_t num, const EC_POINT *points[], 920. const BIGNUM *scalars[], BN_CTX *ctx) crypto/ec/ec_lib.c:924:16: Call 922. if (group->meth->mul == 0) 923. /* use default */ 924. return ec_wNAF_mul(group, r, scalar, num, points, scalars, ctx); ^ 925. 926. return group->meth->mul(group, r, scalar, num, points, scalars, ctx); crypto/ec/ec_mult.c:401:1: <LHS trace> 399. * in the addition if scalar != NULL 400. */ 401. > int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, 402. size_t num, const EC_POINT *points[], const BIGNUM *scalars[], 403. BN_CTX *ctx) crypto/ec/ec_mult.c:401:1: Parameter `group->pre_comp.ec->numblocks` 399. * in the addition if scalar != NULL 400. */ 401. > int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, 402. size_t num, const EC_POINT *points[], const BIGNUM *scalars[], 403. BN_CTX *ctx) crypto/ec/ec_mult.c:401:1: <RHS trace> 399. * in the addition if scalar != NULL 400. */ 401. > int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, 402. size_t num, const EC_POINT *points[], const BIGNUM *scalars[], 403. BN_CTX *ctx) crypto/ec/ec_mult.c:401:1: Parameter `group->pre_comp.ec->numblocks` 399. * in the addition if scalar != NULL 400. */ 401. > int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, 402. size_t num, const EC_POINT *points[], const BIGNUM *scalars[], 403. BN_CTX *ctx) crypto/ec/ec_mult.c:638:25: Binary operation: ([0, +oo] - [0, 8]):unsigned64 by call to `EC_POINT_mul` 636. goto err; 637. } 638. tmp_len -= blocksize; ^ 639. } else 640. /*
https://github.com/openssl/openssl/blob/66b0bca887eb4ad1f5758e56c45905fb3fc36667/crypto/ec/ec_mult.c/#L638
d2a_code_trace_data_44183
static int tls_construct_cke_rsa(SSL *s, WPACKET *pkt, int *al) { #ifndef OPENSSL_NO_RSA unsigned char *encdata = NULL; EVP_PKEY *pkey = NULL; EVP_PKEY_CTX *pctx = NULL; size_t enclen; unsigned char *pms = NULL; size_t pmslen = 0; if (s->session->peer == NULL) { SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR); return 0; } pkey = X509_get0_pubkey(s->session->peer); if (EVP_PKEY_get0_RSA(pkey) == NULL) { SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR); return 0; } pmslen = SSL_MAX_MASTER_KEY_LENGTH; pms = OPENSSL_malloc(pmslen); if (pms == NULL) { SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_MALLOC_FAILURE); *al = SSL_AD_INTERNAL_ERROR; return 0; } pms[0] = s->client_version >> 8; pms[1] = s->client_version & 0xff; if (RAND_bytes(pms + 2, pmslen - 2) <= 0) { goto err; } if (s->version > SSL3_VERSION && !WPACKET_start_sub_packet_u16(pkt)) { SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR); goto err; } pctx = EVP_PKEY_CTX_new(pkey, NULL); if (pctx == NULL || EVP_PKEY_encrypt_init(pctx) <= 0 || EVP_PKEY_encrypt(pctx, NULL, &enclen, pms, pmslen) <= 0) { SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_EVP_LIB); goto err; } if (!WPACKET_allocate_bytes(pkt, enclen, &encdata) || EVP_PKEY_encrypt(pctx, encdata, &enclen, pms, pmslen) <= 0) { SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, SSL_R_BAD_RSA_ENCRYPT); goto err; } EVP_PKEY_CTX_free(pctx); pctx = NULL; # ifdef PKCS1_CHECK if (s->options & SSL_OP_PKCS1_CHECK_1) (*p)[1]++; if (s->options & SSL_OP_PKCS1_CHECK_2) tmp_buf[0] = 0x70; # endif if (s->version > SSL3_VERSION && !WPACKET_close(pkt)) { SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR); goto err; } s->s3->tmp.pms = pms; s->s3->tmp.pmslen = pmslen; return 1; err: OPENSSL_clear_free(pms, pmslen); EVP_PKEY_CTX_free(pctx); return 0; #else SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR); *al = SSL_AD_INTERNAL_ERROR; return 0; #endif } ssl/statem/statem_clnt.c:2232: error: MEMORY_LEAK memory dynamically allocated by call to `CRYPTO_malloc()` at line 2183, column 11 is not reachable after line 2232, column 5. Showing all 66 steps of the trace ssl/statem/statem_clnt.c:2158:1: start of procedure tls_construct_cke_rsa() 2156. } 2157. 2158. > static int tls_construct_cke_rsa(SSL *s, WPACKET *pkt, int *al) 2159. { 2160. #ifndef OPENSSL_NO_RSA ssl/statem/statem_clnt.c:2161:5: 2159. { 2160. #ifndef OPENSSL_NO_RSA 2161. > unsigned char *encdata = NULL; 2162. EVP_PKEY *pkey = NULL; 2163. EVP_PKEY_CTX *pctx = NULL; ssl/statem/statem_clnt.c:2162:5: 2160. #ifndef OPENSSL_NO_RSA 2161. unsigned char *encdata = NULL; 2162. > EVP_PKEY *pkey = NULL; 2163. EVP_PKEY_CTX *pctx = NULL; 2164. size_t enclen; ssl/statem/statem_clnt.c:2163:5: 2161. unsigned char *encdata = NULL; 2162. EVP_PKEY *pkey = NULL; 2163. > EVP_PKEY_CTX *pctx = NULL; 2164. size_t enclen; 2165. unsigned char *pms = NULL; ssl/statem/statem_clnt.c:2165:5: 2163. EVP_PKEY_CTX *pctx = NULL; 2164. size_t enclen; 2165. > unsigned char *pms = NULL; 2166. size_t pmslen = 0; 2167. ssl/statem/statem_clnt.c:2166:5: 2164. size_t enclen; 2165. unsigned char *pms = NULL; 2166. > size_t pmslen = 0; 2167. 2168. if (s->session->peer == NULL) { ssl/statem/statem_clnt.c:2168:9: Taking false branch 2166. size_t pmslen = 0; 2167. 2168. if (s->session->peer == NULL) { ^ 2169. /* 2170. * We should always have a server certificate with SSL_kRSA. ssl/statem/statem_clnt.c:2176:5: 2174. } 2175. 2176. > pkey = X509_get0_pubkey(s->session->peer); 2177. if (EVP_PKEY_get0_RSA(pkey) == NULL) { 2178. SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR); crypto/x509/x509_cmp.c:265:1: start of procedure X509_get0_pubkey() 263. } 264. 265. > EVP_PKEY *X509_get0_pubkey(const X509 *x) 266. { 267. if (x == NULL) crypto/x509/x509_cmp.c:267:9: Taking false branch 265. EVP_PKEY *X509_get0_pubkey(const X509 *x) 266. { 267. if (x == NULL) ^ 268. return NULL; 269. return X509_PUBKEY_get0(x->cert_info.key); crypto/x509/x509_cmp.c:269:5: 267. if (x == NULL) 268. return NULL; 269. > return X509_PUBKEY_get0(x->cert_info.key); 270. } 271. crypto/x509/x_pubkey.c:140:1: start of procedure X509_PUBKEY_get0() 138. } 139. 140. > EVP_PKEY *X509_PUBKEY_get0(X509_PUBKEY *key) 141. { 142. EVP_PKEY *ret = NULL; crypto/x509/x_pubkey.c:142:5: 140. EVP_PKEY *X509_PUBKEY_get0(X509_PUBKEY *key) 141. { 142. > EVP_PKEY *ret = NULL; 143. 144. if (key == NULL || key->public_key == NULL) crypto/x509/x_pubkey.c:144:9: Taking false branch 142. EVP_PKEY *ret = NULL; 143. 144. if (key == NULL || key->public_key == NULL) ^ 145. return NULL; 146. crypto/x509/x_pubkey.c:144:24: Taking false branch 142. EVP_PKEY *ret = NULL; 143. 144. if (key == NULL || key->public_key == NULL) ^ 145. return NULL; 146. crypto/x509/x_pubkey.c:147:9: Taking true branch 145. return NULL; 146. 147. if (key->pkey != NULL) ^ 148. return key->pkey; 149. crypto/x509/x_pubkey.c:148:9: 146. 147. if (key->pkey != NULL) 148. > return key->pkey; 149. 150. /* crypto/x509/x_pubkey.c:166:1: return from a call to X509_PUBKEY_get0 164. 165. return NULL; 166. > } 167. 168. EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key) crypto/x509/x509_cmp.c:270:1: return from a call to X509_get0_pubkey 268. return NULL; 269. return X509_PUBKEY_get0(x->cert_info.key); 270. > } 271. 272. EVP_PKEY *X509_get_pubkey(X509 *x) ssl/statem/statem_clnt.c:2177:9: 2175. 2176. pkey = X509_get0_pubkey(s->session->peer); 2177. > if (EVP_PKEY_get0_RSA(pkey) == NULL) { 2178. SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR); 2179. return 0; crypto/evp/p_lib.c:261:1: start of procedure EVP_PKEY_get0_RSA() 259. } 260. 261. > RSA *EVP_PKEY_get0_RSA(EVP_PKEY *pkey) 262. { 263. if (pkey->type != EVP_PKEY_RSA) { crypto/evp/p_lib.c:263:9: Taking false branch 261. RSA *EVP_PKEY_get0_RSA(EVP_PKEY *pkey) 262. { 263. if (pkey->type != EVP_PKEY_RSA) { ^ 264. EVPerr(EVP_F_EVP_PKEY_GET0_RSA, EVP_R_EXPECTING_AN_RSA_KEY); 265. return NULL; crypto/evp/p_lib.c:267:5: 265. return NULL; 266. } 267. > return pkey->pkey.rsa; 268. } 269. crypto/evp/p_lib.c:268:1: return from a call to EVP_PKEY_get0_RSA 266. } 267. return pkey->pkey.rsa; 268. > } 269. 270. RSA *EVP_PKEY_get1_RSA(EVP_PKEY *pkey) ssl/statem/statem_clnt.c:2177:9: Taking false branch 2175. 2176. pkey = X509_get0_pubkey(s->session->peer); 2177. if (EVP_PKEY_get0_RSA(pkey) == NULL) { ^ 2178. SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR); 2179. return 0; ssl/statem/statem_clnt.c:2182:5: 2180. } 2181. 2182. > pmslen = SSL_MAX_MASTER_KEY_LENGTH; 2183. pms = OPENSSL_malloc(pmslen); 2184. if (pms == NULL) { ssl/statem/statem_clnt.c:2183:5: 2181. 2182. pmslen = SSL_MAX_MASTER_KEY_LENGTH; 2183. > pms = OPENSSL_malloc(pmslen); 2184. if (pms == NULL) { 2185. SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_MALLOC_FAILURE); crypto/mem.c:71:1: start of procedure CRYPTO_malloc() 69. } 70. 71. > void *CRYPTO_malloc(size_t num, const char *file, int line) 72. { 73. void *ret = NULL; crypto/mem.c:73:5: 71. void *CRYPTO_malloc(size_t num, const char *file, int line) 72. { 73. > void *ret = NULL; 74. 75. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) crypto/mem.c:75:9: Taking false branch 73. void *ret = NULL; 74. 75. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) ^ 76. return malloc_impl(num, file, line); 77. crypto/mem.c:78:9: Taking false branch 76. return malloc_impl(num, file, line); 77. 78. if (num <= 0) ^ 79. return NULL; 80. crypto/mem.c:81:5: 79. return NULL; 80. 81. > allow_customize = 0; 82. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 83. if (call_malloc_debug) { crypto/mem.c:91:5: 89. } 90. #else 91. > osslargused(file); osslargused(line); 92. ret = malloc(num); 93. #endif crypto/mem.c:91:24: 89. } 90. #else 91. > osslargused(file); osslargused(line); 92. ret = malloc(num); 93. #endif crypto/mem.c:92:5: 90. #else 91. osslargused(file); osslargused(line); 92. > ret = malloc(num); 93. #endif 94. crypto/mem.c:95:5: 93. #endif 94. 95. > return ret; 96. } 97. crypto/mem.c:96:1: return from a call to CRYPTO_malloc 94. 95. return ret; 96. > } 97. 98. void *CRYPTO_zalloc(size_t num, const char *file, int line) ssl/statem/statem_clnt.c:2184:9: Taking false branch 2182. pmslen = SSL_MAX_MASTER_KEY_LENGTH; 2183. pms = OPENSSL_malloc(pmslen); 2184. if (pms == NULL) { ^ 2185. SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_MALLOC_FAILURE); 2186. *al = SSL_AD_INTERNAL_ERROR; ssl/statem/statem_clnt.c:2190:5: 2188. } 2189. 2190. > pms[0] = s->client_version >> 8; 2191. pms[1] = s->client_version & 0xff; 2192. if (RAND_bytes(pms + 2, pmslen - 2) <= 0) { ssl/statem/statem_clnt.c:2191:5: 2189. 2190. pms[0] = s->client_version >> 8; 2191. > pms[1] = s->client_version & 0xff; 2192. if (RAND_bytes(pms + 2, pmslen - 2) <= 0) { 2193. goto err; ssl/statem/statem_clnt.c:2192:9: 2190. pms[0] = s->client_version >> 8; 2191. pms[1] = s->client_version & 0xff; 2192. > if (RAND_bytes(pms + 2, pmslen - 2) <= 0) { 2193. goto err; 2194. } crypto/rand/rand_lib.c:102:1: start of procedure RAND_bytes() 100. } 101. 102. > int RAND_bytes(unsigned char *buf, int num) 103. { 104. const RAND_METHOD *meth = RAND_get_rand_method(); crypto/rand/rand_lib.c:104:5: 102. int RAND_bytes(unsigned char *buf, int num) 103. { 104. > const RAND_METHOD *meth = RAND_get_rand_method(); 105. if (meth && meth->bytes) 106. return meth->bytes(buf, num); crypto/rand/rand_lib.c:39:1: start of procedure RAND_get_rand_method() 37. } 38. 39. > const RAND_METHOD *RAND_get_rand_method(void) 40. { 41. if (!default_RAND_meth) { crypto/rand/rand_lib.c:41:10: Taking false branch 39. const RAND_METHOD *RAND_get_rand_method(void) 40. { 41. if (!default_RAND_meth) { ^ 42. #ifndef OPENSSL_NO_ENGINE 43. ENGINE *e = ENGINE_get_default_RAND(); crypto/rand/rand_lib.c:57:5: 55. default_RAND_meth = RAND_OpenSSL(); 56. } 57. > return default_RAND_meth; 58. } 59. crypto/rand/rand_lib.c:58:1: return from a call to RAND_get_rand_method 56. } 57. return default_RAND_meth; 58. > } 59. 60. #ifndef OPENSSL_NO_ENGINE crypto/rand/rand_lib.c:105:9: Taking true branch 103. { 104. const RAND_METHOD *meth = RAND_get_rand_method(); 105. if (meth && meth->bytes) ^ 106. return meth->bytes(buf, num); 107. return (-1); crypto/rand/rand_lib.c:105:17: Taking false branch 103. { 104. const RAND_METHOD *meth = RAND_get_rand_method(); 105. if (meth && meth->bytes) ^ 106. return meth->bytes(buf, num); 107. return (-1); crypto/rand/rand_lib.c:107:5: 105. if (meth && meth->bytes) 106. return meth->bytes(buf, num); 107. > return (-1); 108. } 109. crypto/rand/rand_lib.c:108:1: return from a call to RAND_bytes 106. return meth->bytes(buf, num); 107. return (-1); 108. > } 109. 110. #if OPENSSL_API_COMPAT < 0x10100000L ssl/statem/statem_clnt.c:2192:9: Taking true branch 2190. pms[0] = s->client_version >> 8; 2191. pms[1] = s->client_version & 0xff; 2192. if (RAND_bytes(pms + 2, pmslen - 2) <= 0) { ^ 2193. goto err; 2194. } ssl/statem/statem_clnt.c:2231:2: 2229. 2230. return 1; 2231. > err: 2232. OPENSSL_clear_free(pms, pmslen); 2233. EVP_PKEY_CTX_free(pctx); ssl/statem/statem_clnt.c:2232:5: 2230. return 1; 2231. err: 2232. > OPENSSL_clear_free(pms, pmslen); 2233. EVP_PKEY_CTX_free(pctx); 2234. crypto/mem.c:183:1: start of procedure CRYPTO_clear_free() 181. } 182. 183. > void CRYPTO_clear_free(void *str, size_t num, const char *file, int line) 184. { 185. if (str == NULL) crypto/mem.c:185:9: Taking false branch 183. void CRYPTO_clear_free(void *str, size_t num, const char *file, int line) 184. { 185. if (str == NULL) ^ 186. return; 187. if (num) crypto/mem.c:187:9: Taking true branch 185. if (str == NULL) 186. return; 187. if (num) ^ 188. OPENSSL_cleanse(str, num); 189. CRYPTO_free(str, file, line); crypto/mem.c:188:9: Skipping OPENSSL_cleanse(): method has no implementation 186. return; 187. if (num) 188. OPENSSL_cleanse(str, num); ^ 189. CRYPTO_free(str, file, line); 190. } crypto/mem.c:189:5: 187. if (num) 188. OPENSSL_cleanse(str, num); 189. > CRYPTO_free(str, file, line); 190. } crypto/mem.c:163:1: start of procedure CRYPTO_free() 161. } 162. 163. > void CRYPTO_free(void *str, const char *file, int line) 164. { 165. if (free_impl != NULL && free_impl != &CRYPTO_free) { crypto/mem.c:165:9: Taking true branch 163. void CRYPTO_free(void *str, const char *file, int line) 164. { 165. if (free_impl != NULL && free_impl != &CRYPTO_free) { ^ 166. free_impl(str, file, line); 167. return; crypto/mem.c:165:30: Taking true branch 163. void CRYPTO_free(void *str, const char *file, int line) 164. { 165. if (free_impl != NULL && free_impl != &CRYPTO_free) { ^ 166. free_impl(str, file, line); 167. return; crypto/mem.c:166:9: Skipping __function_pointer__(): unresolved function pointer 164. { 165. if (free_impl != NULL && free_impl != &CRYPTO_free) { 166. free_impl(str, file, line); ^ 167. return; 168. } crypto/mem.c:167:9: 165. if (free_impl != NULL && free_impl != &CRYPTO_free) { 166. free_impl(str, file, line); 167. > return; 168. } 169. crypto/mem.c:181:1: return from a call to CRYPTO_free 179. free(str); 180. #endif 181. > } 182. 183. void CRYPTO_clear_free(void *str, size_t num, const char *file, int line) crypto/mem.c:190:1: return from a call to CRYPTO_clear_free 188. OPENSSL_cleanse(str, num); 189. CRYPTO_free(str, file, line); 190. > }
https://github.com/openssl/openssl/blob/869d0a37cfa7cfdbd42026d2b75d14cdc64e81e0/ssl/statem/statem_clnt.c/#L2232
d2a_code_trace_data_44184
static void contract(OPENSSL_LHASH *lh) { OPENSSL_LH_NODE **n, *n1, *np; np = lh->b[lh->p + lh->pmax - 1]; lh->b[lh->p + lh->pmax - 1] = NULL; if (lh->p == 0) { n = OPENSSL_realloc(lh->b, (unsigned int)(sizeof(OPENSSL_LH_NODE *) * lh->pmax)); if (n == NULL) { lh->error++; return; } lh->num_contract_reallocs++; lh->num_alloc_nodes /= 2; lh->pmax /= 2; lh->p = lh->pmax - 1; lh->b = n; } else lh->p--; lh->num_nodes--; lh->num_contracts++; n1 = lh->b[(int)lh->p]; if (n1 == NULL) lh->b[(int)lh->p] = np; else { while (n1->next != NULL) n1 = n1->next; n1->next = np; } } crypto/property/property.c:41: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `OPENSSL_LH_delete`. Showing all 10 steps of the trace crypto/property/property.c:41:1: Parameter `lh->pmax` 39. } QUERY; 40. 41. > DEFINE_LHASH_OF(QUERY); 42. 43. typedef struct { crypto/property/property.c:41:1: Call 39. } QUERY; 40. 41. > DEFINE_LHASH_OF(QUERY); 42. 43. typedef struct { crypto/lhash/lhash.c:136:1: Parameter `lh->pmax` 134. } 135. 136. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) 137. { 138. unsigned long hash; crypto/lhash/lhash.c:159:9: Call 157. if ((lh->num_nodes > MIN_NODES) && 158. (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes))) 159. contract(lh); ^ 160. 161. return ret; crypto/lhash/lhash.c:268:1: <Offset trace> 266. } 267. 268. > static void contract(OPENSSL_LHASH *lh) 269. { 270. OPENSSL_LH_NODE **n, *n1, *np; crypto/lhash/lhash.c:268:1: Parameter `lh->p` 266. } 267. 268. > static void contract(OPENSSL_LHASH *lh) 269. { 270. OPENSSL_LH_NODE **n, *n1, *np; crypto/lhash/lhash.c:288:9: Assignment 286. lh->b = n; 287. } else 288. lh->p--; ^ 289. 290. lh->num_nodes--; crypto/lhash/lhash.c:268:1: <Length trace> 266. } 267. 268. > static void contract(OPENSSL_LHASH *lh) 269. { 270. OPENSSL_LH_NODE **n, *n1, *np; crypto/lhash/lhash.c:268:1: Parameter `*lh->b` 266. } 267. 268. > static void contract(OPENSSL_LHASH *lh) 269. { 270. OPENSSL_LH_NODE **n, *n1, *np; crypto/lhash/lhash.c:293:10: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `OPENSSL_LH_delete` 291. lh->num_contracts++; 292. 293. n1 = lh->b[(int)lh->p]; ^ 294. if (n1 == NULL) 295. lh->b[(int)lh->p] = np;
https://github.com/openssl/openssl/blob/4460ad90af0338abe31286f29b36baf2e41abf19/crypto/lhash/lhash.c/#L293
d2a_code_trace_data_44185
int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) { assert(pkt->subs != NULL && len != 0); if (pkt->subs == NULL || len == 0) return 0; if (pkt->maxsize - pkt->written < len) return 0; if (pkt->buf->length - pkt->written < len) { size_t newlen; size_t reflen; reflen = (len > pkt->buf->length) ? len : pkt->buf->length; if (reflen > SIZE_MAX / 2) { newlen = SIZE_MAX; } else { newlen = reflen * 2; if (newlen < DEFAULT_BUF_SIZE) newlen = DEFAULT_BUF_SIZE; } if (BUF_MEM_grow(pkt->buf, newlen) == 0) return 0; } *allocbytes = (unsigned char *)pkt->buf->data + pkt->curr; return 1; } ssl/statem/statem_clnt.c:2199: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [`pkt->written`, `pkt->written` + 2]):unsigned64 by call to `WPACKET_allocate_bytes`. Showing all 9 steps of the trace ssl/statem/statem_clnt.c:2150:1: Parameter `pkt->written` 2148. } 2149. 2150. > static int tls_construct_cke_rsa(SSL *s, WPACKET *pkt, int *al) 2151. { 2152. #ifndef OPENSSL_NO_RSA ssl/statem/statem_clnt.c:2199:10: Call 2197. goto err; 2198. } 2199. if (!WPACKET_allocate_bytes(pkt, enclen, &encdata) ^ 2200. || EVP_PKEY_encrypt(pctx, encdata, &enclen, pms, pmslen) <= 0) { 2201. SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, SSL_R_BAD_RSA_ENCRYPT); ssl/packet.c:15:1: Parameter `pkt->written` 13. #define DEFAULT_BUF_SIZE 256 14. 15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes)) ssl/packet.c:17:10: Call 15. int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes)) ^ 18. return 0; 19. ssl/packet.c:36:1: <LHS trace> 34. } 35. 36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 37. { 38. /* Internal API, so should not fail */ ssl/packet.c:36:1: Parameter `pkt->buf->length` 34. } 35. 36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 37. { 38. /* Internal API, so should not fail */ ssl/packet.c:36:1: <RHS trace> 34. } 35. 36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 37. { 38. /* Internal API, so should not fail */ ssl/packet.c:36:1: Parameter `len` 34. } 35. 36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 37. { 38. /* Internal API, so should not fail */ ssl/packet.c:46:9: Binary operation: ([0, +oo] - [pkt->written, pkt->written + 2]):unsigned64 by call to `WPACKET_allocate_bytes` 44. return 0; 45. 46. if (pkt->buf->length - pkt->written < len) { ^ 47. size_t newlen; 48. size_t reflen;
https://github.com/openssl/openssl/blob/e4e1aa903e624044d3319622fc50222f1b2c7328/ssl/packet.c/#L46
d2a_code_trace_data_44186
static int addrinfo_wrap(int family, int socktype, const void *where, size_t wherelen, unsigned short port, BIO_ADDRINFO **bai) { OPENSSL_assert(bai != NULL); *bai = (BIO_ADDRINFO *)OPENSSL_zalloc(sizeof(**bai)); if (*bai == NULL) return 0; (*bai)->bai_family = family; (*bai)->bai_socktype = socktype; if (socktype == SOCK_STREAM) (*bai)->bai_protocol = IPPROTO_TCP; if (socktype == SOCK_DGRAM) (*bai)->bai_protocol = IPPROTO_UDP; #ifdef AF_UNIX if (family == AF_UNIX) (*bai)->bai_protocol = 0; #endif { BIO_ADDR *addr = BIO_ADDR_new(); if (addr != NULL) { BIO_ADDR_rawmake(addr, family, where, wherelen, port); (*bai)->bai_addr = BIO_ADDR_sockaddr_noconst(addr); } } (*bai)->bai_next = NULL; if ((*bai)->bai_addr == NULL) { BIO_ADDRINFO_free(*bai); *bai = NULL; return 0; } return 1; } crypto/bio/b_addr.c:582: error: MEMORY_LEAK memory dynamically allocated to `*bai` by call to `CRYPTO_zalloc()` at line 553, column 28 is not reachable after line 582, column 9. Showing all 48 steps of the trace crypto/bio/b_addr.c:546:1: start of procedure addrinfo_wrap() 544. * only happens if a memory allocation error occured. 545. */ 546. > static int addrinfo_wrap(int family, int socktype, 547. const void *where, size_t wherelen, 548. unsigned short port, crypto/bio/b_addr.c:551:5: Condition is true 549. BIO_ADDRINFO **bai) 550. { 551. OPENSSL_assert(bai != NULL); ^ 552. 553. *bai = (BIO_ADDRINFO *)OPENSSL_zalloc(sizeof(**bai)); crypto/bio/b_addr.c:553:5: 551. OPENSSL_assert(bai != NULL); 552. 553. > *bai = (BIO_ADDRINFO *)OPENSSL_zalloc(sizeof(**bai)); 554. 555. if (*bai == NULL) crypto/mem.c:156:1: start of procedure CRYPTO_zalloc() 154. } 155. 156. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 157. { 158. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:158:5: 156. void *CRYPTO_zalloc(size_t num, const char *file, int line) 157. { 158. > void *ret = CRYPTO_malloc(num, file, line); 159. 160. if (ret != NULL) crypto/mem.c:119:1: start of procedure CRYPTO_malloc() 117. } 118. 119. > void *CRYPTO_malloc(size_t num, const char *file, int line) 120. { 121. void *ret = NULL; crypto/mem.c:121:5: 119. void *CRYPTO_malloc(size_t num, const char *file, int line) 120. { 121. > void *ret = NULL; 122. 123. if (num <= 0) crypto/mem.c:123:9: Taking false branch 121. void *ret = NULL; 122. 123. if (num <= 0) ^ 124. return NULL; 125. crypto/mem.c:126:5: 124. return NULL; 125. 126. > allow_customize = 0; 127. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 128. if (call_malloc_debug) { crypto/mem.c:136:5: 134. } 135. #else 136. > (void)file; 137. (void)line; 138. ret = malloc(num); crypto/mem.c:137:5: 135. #else 136. (void)file; 137. > (void)line; 138. ret = malloc(num); 139. #endif crypto/mem.c:138:5: 136. (void)file; 137. (void)line; 138. > ret = malloc(num); 139. #endif 140. crypto/mem.c:153:5: 151. #endif 152. 153. > return ret; 154. } 155. crypto/mem.c:154:1: return from a call to CRYPTO_malloc 152. 153. return ret; 154. > } 155. 156. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:160:9: Taking true branch 158. void *ret = CRYPTO_malloc(num, file, line); 159. 160. if (ret != NULL) ^ 161. memset(ret, 0, num); 162. return ret; crypto/mem.c:161:9: 159. 160. if (ret != NULL) 161. > memset(ret, 0, num); 162. return ret; 163. } crypto/mem.c:162:5: 160. if (ret != NULL) 161. memset(ret, 0, num); 162. > return ret; 163. } 164. crypto/mem.c:163:1: return from a call to CRYPTO_zalloc 161. memset(ret, 0, num); 162. return ret; 163. > } 164. 165. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bio/b_addr.c:555:9: Taking false branch 553. *bai = (BIO_ADDRINFO *)OPENSSL_zalloc(sizeof(**bai)); 554. 555. if (*bai == NULL) ^ 556. return 0; 557. (*bai)->bai_family = family; crypto/bio/b_addr.c:557:5: 555. if (*bai == NULL) 556. return 0; 557. > (*bai)->bai_family = family; 558. (*bai)->bai_socktype = socktype; 559. if (socktype == SOCK_STREAM) crypto/bio/b_addr.c:558:5: 556. return 0; 557. (*bai)->bai_family = family; 558. > (*bai)->bai_socktype = socktype; 559. if (socktype == SOCK_STREAM) 560. (*bai)->bai_protocol = IPPROTO_TCP; crypto/bio/b_addr.c:559:9: Taking false branch 557. (*bai)->bai_family = family; 558. (*bai)->bai_socktype = socktype; 559. if (socktype == SOCK_STREAM) ^ 560. (*bai)->bai_protocol = IPPROTO_TCP; 561. if (socktype == SOCK_DGRAM) crypto/bio/b_addr.c:561:9: Taking false branch 559. if (socktype == SOCK_STREAM) 560. (*bai)->bai_protocol = IPPROTO_TCP; 561. if (socktype == SOCK_DGRAM) ^ 562. (*bai)->bai_protocol = IPPROTO_UDP; 563. #ifdef AF_UNIX crypto/bio/b_addr.c:564:9: Taking false branch 562. (*bai)->bai_protocol = IPPROTO_UDP; 563. #ifdef AF_UNIX 564. if (family == AF_UNIX) ^ 565. (*bai)->bai_protocol = 0; 566. #endif crypto/bio/b_addr.c:573:9: 571. creating a memory leak here, we are not. It will be 572. all right. */ 573. > BIO_ADDR *addr = BIO_ADDR_new(); 574. if (addr != NULL) { 575. BIO_ADDR_rawmake(addr, family, where, wherelen, port); crypto/bio/b_addr.c:76:1: start of procedure BIO_ADDR_new() 74. */ 75. 76. > BIO_ADDR *BIO_ADDR_new(void) 77. { 78. BIO_ADDR *ret = (BIO_ADDR *)OPENSSL_zalloc(sizeof(BIO_ADDR)); crypto/bio/b_addr.c:78:5: 76. BIO_ADDR *BIO_ADDR_new(void) 77. { 78. > BIO_ADDR *ret = (BIO_ADDR *)OPENSSL_zalloc(sizeof(BIO_ADDR)); 79. return ret; 80. } crypto/mem.c:156:1: start of procedure CRYPTO_zalloc() 154. } 155. 156. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 157. { 158. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:158:5: 156. void *CRYPTO_zalloc(size_t num, const char *file, int line) 157. { 158. > void *ret = CRYPTO_malloc(num, file, line); 159. 160. if (ret != NULL) crypto/mem.c:119:1: start of procedure CRYPTO_malloc() 117. } 118. 119. > void *CRYPTO_malloc(size_t num, const char *file, int line) 120. { 121. void *ret = NULL; crypto/mem.c:121:5: 119. void *CRYPTO_malloc(size_t num, const char *file, int line) 120. { 121. > void *ret = NULL; 122. 123. if (num <= 0) crypto/mem.c:123:9: Taking false branch 121. void *ret = NULL; 122. 123. if (num <= 0) ^ 124. return NULL; 125. crypto/mem.c:126:5: 124. return NULL; 125. 126. > allow_customize = 0; 127. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 128. if (call_malloc_debug) { crypto/mem.c:136:5: 134. } 135. #else 136. > (void)file; 137. (void)line; 138. ret = malloc(num); crypto/mem.c:137:5: 135. #else 136. (void)file; 137. > (void)line; 138. ret = malloc(num); 139. #endif crypto/mem.c:138:5: 136. (void)file; 137. (void)line; 138. > ret = malloc(num); 139. #endif 140. crypto/mem.c:153:5: 151. #endif 152. 153. > return ret; 154. } 155. crypto/mem.c:154:1: return from a call to CRYPTO_malloc 152. 153. return ret; 154. > } 155. 156. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:160:9: Taking false branch 158. void *ret = CRYPTO_malloc(num, file, line); 159. 160. if (ret != NULL) ^ 161. memset(ret, 0, num); 162. return ret; crypto/mem.c:162:5: 160. if (ret != NULL) 161. memset(ret, 0, num); 162. > return ret; 163. } 164. crypto/mem.c:163:1: return from a call to CRYPTO_zalloc 161. memset(ret, 0, num); 162. return ret; 163. > } 164. 165. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bio/b_addr.c:79:5: 77. { 78. BIO_ADDR *ret = (BIO_ADDR *)OPENSSL_zalloc(sizeof(BIO_ADDR)); 79. > return ret; 80. } 81. crypto/bio/b_addr.c:80:1: return from a call to BIO_ADDR_new 78. BIO_ADDR *ret = (BIO_ADDR *)OPENSSL_zalloc(sizeof(BIO_ADDR)); 79. return ret; 80. > } 81. 82. void BIO_ADDR_free(BIO_ADDR *ap) crypto/bio/b_addr.c:574:13: Taking false branch 572. all right. */ 573. BIO_ADDR *addr = BIO_ADDR_new(); 574. if (addr != NULL) { ^ 575. BIO_ADDR_rawmake(addr, family, where, wherelen, port); 576. (*bai)->bai_addr = BIO_ADDR_sockaddr_noconst(addr); crypto/bio/b_addr.c:579:5: 577. } 578. } 579. > (*bai)->bai_next = NULL; 580. if ((*bai)->bai_addr == NULL) { 581. BIO_ADDRINFO_free(*bai); crypto/bio/b_addr.c:580:9: Taking true branch 578. } 579. (*bai)->bai_next = NULL; 580. if ((*bai)->bai_addr == NULL) { ^ 581. BIO_ADDRINFO_free(*bai); 582. *bai = NULL; crypto/bio/b_addr.c:581:9: Skipping BIO_ADDRINFO_free(): empty list of specs 579. (*bai)->bai_next = NULL; 580. if ((*bai)->bai_addr == NULL) { 581. BIO_ADDRINFO_free(*bai); ^ 582. *bai = NULL; 583. return 0; crypto/bio/b_addr.c:582:9: 580. if ((*bai)->bai_addr == NULL) { 581. BIO_ADDRINFO_free(*bai); 582. > *bai = NULL; 583. return 0; 584. }
https://github.com/openssl/openssl/blob/1cc98f75bfaf16a3a1038cf36cb053f330e4ac30/crypto/bio/b_addr.c/#L582
d2a_code_trace_data_44187
int ssl3_get_cert_verify(SSL *s) { EVP_PKEY *pkey=NULL; unsigned char *p; int al,ok,ret=0; long n; int type=0,i,j; X509 *peer; const EVP_MD *md = NULL; EVP_MD_CTX mctx; EVP_MD_CTX_init(&mctx); n=s->method->ssl_get_message(s, SSL3_ST_SR_CERT_VRFY_A, SSL3_ST_SR_CERT_VRFY_B, -1, 516, &ok); if (!ok) return((int)n); if (s->session->peer != NULL) { peer=s->session->peer; pkey=X509_get_pubkey(peer); type=X509_certificate_type(peer,pkey); } else { peer=NULL; pkey=NULL; } if (s->s3->tmp.message_type != SSL3_MT_CERTIFICATE_VERIFY) { s->s3->tmp.reuse_message=1; if ((peer != NULL) && (type & EVP_PKT_SIGN)) { al=SSL_AD_UNEXPECTED_MESSAGE; SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_MISSING_VERIFY_MESSAGE); goto f_err; } ret=1; goto end; } if (peer == NULL) { SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_NO_CLIENT_CERT_RECEIVED); al=SSL_AD_UNEXPECTED_MESSAGE; goto f_err; } if (!(type & EVP_PKT_SIGN)) { SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE); al=SSL_AD_ILLEGAL_PARAMETER; goto f_err; } if (s->s3->change_cipher_spec) { SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_CCS_RECEIVED_EARLY); al=SSL_AD_UNEXPECTED_MESSAGE; goto f_err; } p=(unsigned char *)s->init_msg; if (n==64 && (pkey->type==NID_id_GostR3410_94 || pkey->type == NID_id_GostR3410_2001) ) { i=64; } else { if (SSL_USE_SIGALGS(s)) { int rv = tls12_check_peer_sigalg(&md, s, p, pkey); if (rv == -1) { al = SSL_AD_INTERNAL_ERROR; goto f_err; } else if (rv == 0) { al = SSL_AD_DECODE_ERROR; goto f_err; } #ifdef SSL_DEBUG fprintf(stderr, "USING TLSv1.2 HASH %s\n", EVP_MD_name(md)); #endif p += 2; n -= 2; } n2s(p,i); n-=2; if (i > n) { SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_LENGTH_MISMATCH); al=SSL_AD_DECODE_ERROR; goto f_err; } } j=EVP_PKEY_size(pkey); if ((i > j) || (n > j) || (n <= 0)) { SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_WRONG_SIGNATURE_SIZE); al=SSL_AD_DECODE_ERROR; goto f_err; } if (SSL_USE_SIGALGS(s)) { long hdatalen = 0; void *hdata; hdatalen = BIO_get_mem_data(s->s3->handshake_buffer, &hdata); if (hdatalen <= 0) { SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, ERR_R_INTERNAL_ERROR); al=SSL_AD_INTERNAL_ERROR; goto f_err; } #ifdef SSL_DEBUG fprintf(stderr, "Using TLS 1.2 with client verify alg %s\n", EVP_MD_name(md)); #endif if (!EVP_VerifyInit_ex(&mctx, md, NULL) || !EVP_VerifyUpdate(&mctx, hdata, hdatalen)) { SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, ERR_R_EVP_LIB); al=SSL_AD_INTERNAL_ERROR; goto f_err; } if (EVP_VerifyFinal(&mctx, p , i, pkey) <= 0) { al=SSL_AD_DECRYPT_ERROR; SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_BAD_SIGNATURE); goto f_err; } } else #ifndef OPENSSL_NO_RSA if (pkey->type == EVP_PKEY_RSA) { i=RSA_verify(NID_md5_sha1, s->s3->tmp.cert_verify_md, MD5_DIGEST_LENGTH+SHA_DIGEST_LENGTH, p, i, pkey->pkey.rsa); if (i < 0) { al=SSL_AD_DECRYPT_ERROR; SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_BAD_RSA_DECRYPT); goto f_err; } if (i == 0) { al=SSL_AD_DECRYPT_ERROR; SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_BAD_RSA_SIGNATURE); goto f_err; } } else #endif #ifndef OPENSSL_NO_DSA if (pkey->type == EVP_PKEY_DSA) { j=DSA_verify(pkey->save_type, &(s->s3->tmp.cert_verify_md[MD5_DIGEST_LENGTH]), SHA_DIGEST_LENGTH,p,i,pkey->pkey.dsa); if (j <= 0) { al=SSL_AD_DECRYPT_ERROR; SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_BAD_DSA_SIGNATURE); goto f_err; } } else #endif #ifndef OPENSSL_NO_ECDSA if (pkey->type == EVP_PKEY_EC) { j=ECDSA_verify(pkey->save_type, &(s->s3->tmp.cert_verify_md[MD5_DIGEST_LENGTH]), SHA_DIGEST_LENGTH,p,i,pkey->pkey.ec); if (j <= 0) { al=SSL_AD_DECRYPT_ERROR; SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, SSL_R_BAD_ECDSA_SIGNATURE); goto f_err; } } else #endif if (pkey->type == NID_id_GostR3410_94 || pkey->type == NID_id_GostR3410_2001) { unsigned char signature[64]; int idx; EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new(pkey,NULL); EVP_PKEY_verify_init(pctx); if (i!=64) { fprintf(stderr,"GOST signature length is %d",i); } for (idx=0;idx<64;idx++) { signature[63-idx]=p[idx]; } j=EVP_PKEY_verify(pctx,signature,64,s->s3->tmp.cert_verify_md,32); EVP_PKEY_CTX_free(pctx); if (j<=0) { al=SSL_AD_DECRYPT_ERROR; SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, SSL_R_BAD_ECDSA_SIGNATURE); goto f_err; } } else { SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,ERR_R_INTERNAL_ERROR); al=SSL_AD_UNSUPPORTED_CERTIFICATE; goto f_err; } ret=1; if (0) { f_err: ssl3_send_alert(s,SSL3_AL_FATAL,al); } end: if (s->s3->handshake_buffer) { BIO_free(s->s3->handshake_buffer); s->s3->handshake_buffer = NULL; s->s3->flags &= ~TLS1_FLAGS_KEEP_HANDSHAKE; } EVP_MD_CTX_cleanup(&mctx); EVP_PKEY_free(pkey); return(ret); } ssl/s3_srvr.c:3097: error: NULL_DEREFERENCE pointer `pkey` last assigned on line 3049 could be null and is dereferenced at line 3097, column 16. Showing all 27 steps of the trace ssl/s3_srvr.c:3025:1: start of procedure ssl3_get_cert_verify() 3023. } 3024. 3025. > int ssl3_get_cert_verify(SSL *s) 3026. { 3027. EVP_PKEY *pkey=NULL; ssl/s3_srvr.c:3027:2: 3025. int ssl3_get_cert_verify(SSL *s) 3026. { 3027. > EVP_PKEY *pkey=NULL; 3028. unsigned char *p; 3029. int al,ok,ret=0; ssl/s3_srvr.c:3029:2: 3027. EVP_PKEY *pkey=NULL; 3028. unsigned char *p; 3029. > int al,ok,ret=0; 3030. long n; 3031. int type=0,i,j; ssl/s3_srvr.c:3031:2: 3029. int al,ok,ret=0; 3030. long n; 3031. > int type=0,i,j; 3032. X509 *peer; 3033. const EVP_MD *md = NULL; ssl/s3_srvr.c:3033:2: 3031. int type=0,i,j; 3032. X509 *peer; 3033. > const EVP_MD *md = NULL; 3034. EVP_MD_CTX mctx; 3035. EVP_MD_CTX_init(&mctx); ssl/s3_srvr.c:3035:2: 3033. const EVP_MD *md = NULL; 3034. EVP_MD_CTX mctx; 3035. > EVP_MD_CTX_init(&mctx); 3036. 3037. n=s->method->ssl_get_message(s, crypto/evp/digest.c:120:1: start of procedure EVP_MD_CTX_init() 118. #endif 119. 120. > void EVP_MD_CTX_init(EVP_MD_CTX *ctx) 121. { 122. memset(ctx,'\0',sizeof *ctx); crypto/evp/digest.c:122:2: 120. void EVP_MD_CTX_init(EVP_MD_CTX *ctx) 121. { 122. > memset(ctx,'\0',sizeof *ctx); 123. } 124. crypto/evp/digest.c:123:2: return from a call to EVP_MD_CTX_init 121. { 122. memset(ctx,'\0',sizeof *ctx); 123. } ^ 124. 125. EVP_MD_CTX *EVP_MD_CTX_create(void) ssl/s3_srvr.c:3037:2: Skipping __function_pointer__(): unresolved function pointer 3035. EVP_MD_CTX_init(&mctx); 3036. 3037. n=s->method->ssl_get_message(s, ^ 3038. SSL3_ST_SR_CERT_VRFY_A, 3039. SSL3_ST_SR_CERT_VRFY_B, ssl/s3_srvr.c:3044:7: Taking false branch 3042. &ok); 3043. 3044. if (!ok) return((int)n); ^ 3045. 3046. if (s->session->peer != NULL) ssl/s3_srvr.c:3046:6: Taking true branch 3044. if (!ok) return((int)n); 3045. 3046. if (s->session->peer != NULL) ^ 3047. { 3048. peer=s->session->peer; ssl/s3_srvr.c:3048:3: 3046. if (s->session->peer != NULL) 3047. { 3048. > peer=s->session->peer; 3049. pkey=X509_get_pubkey(peer); 3050. type=X509_certificate_type(peer,pkey); ssl/s3_srvr.c:3049:3: 3047. { 3048. peer=s->session->peer; 3049. > pkey=X509_get_pubkey(peer); 3050. type=X509_certificate_type(peer,pkey); 3051. } crypto/x509/x509_cmp.c:300:1: start of procedure X509_get_pubkey() 298. } 299. 300. > EVP_PKEY *X509_get_pubkey(X509 *x) 301. { 302. if ((x == NULL) || (x->cert_info == NULL)) crypto/x509/x509_cmp.c:302:7: Taking false branch 300. EVP_PKEY *X509_get_pubkey(X509 *x) 301. { 302. if ((x == NULL) || (x->cert_info == NULL)) ^ 303. return(NULL); 304. return(X509_PUBKEY_get(x->cert_info->key)); crypto/x509/x509_cmp.c:302:22: Taking true branch 300. EVP_PKEY *X509_get_pubkey(X509 *x) 301. { 302. if ((x == NULL) || (x->cert_info == NULL)) ^ 303. return(NULL); 304. return(X509_PUBKEY_get(x->cert_info->key)); crypto/x509/x509_cmp.c:303:3: 301. { 302. if ((x == NULL) || (x->cert_info == NULL)) 303. > return(NULL); 304. return(X509_PUBKEY_get(x->cert_info->key)); 305. } crypto/x509/x509_cmp.c:305:2: return from a call to X509_get_pubkey 303. return(NULL); 304. return(X509_PUBKEY_get(x->cert_info->key)); 305. } ^ 306. 307. ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x) ssl/s3_srvr.c:3050:3: Skipping X509_certificate_type(): empty list of specs 3048. peer=s->session->peer; 3049. pkey=X509_get_pubkey(peer); 3050. type=X509_certificate_type(peer,pkey); ^ 3051. } 3052. else ssl/s3_srvr.c:3058:6: Taking false branch 3056. } 3057. 3058. if (s->s3->tmp.message_type != SSL3_MT_CERTIFICATE_VERIFY) ^ 3059. { 3060. s->s3->tmp.reuse_message=1; ssl/s3_srvr.c:3071:6: Taking false branch 3069. } 3070. 3071. if (peer == NULL) ^ 3072. { 3073. SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_NO_CLIENT_CERT_RECEIVED); ssl/s3_srvr.c:3078:8: Taking false branch 3076. } 3077. 3078. if (!(type & EVP_PKT_SIGN)) ^ 3079. { 3080. SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE); ssl/s3_srvr.c:3085:6: Taking false branch 3083. } 3084. 3085. if (s->s3->change_cipher_spec) ^ 3086. { 3087. SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_CCS_RECEIVED_EARLY); ssl/s3_srvr.c:3093:2: 3091. 3092. /* we now have a signature that we need to verify */ 3093. > p=(unsigned char *)s->init_msg; 3094. /* Check for broken implementations of GOST ciphersuites */ 3095. /* If key is GOST and n is exactly 64, it is bare ssl/s3_srvr.c:3097:6: Taking true branch 3095. /* If key is GOST and n is exactly 64, it is bare 3096. * signature without length field */ 3097. if (n==64 && (pkey->type==NID_id_GostR3410_94 || ^ 3098. pkey->type == NID_id_GostR3410_2001) ) 3099. { ssl/s3_srvr.c:3097:16: 3095. /* If key is GOST and n is exactly 64, it is bare 3096. * signature without length field */ 3097. > if (n==64 && (pkey->type==NID_id_GostR3410_94 || 3098. pkey->type == NID_id_GostR3410_2001) ) 3099. {
https://github.com/openssl/openssl/blob/4082fea81c150e9f2643819148d275e500f309a3/ssl/s3_srvr.c/#L3097
d2a_code_trace_data_44188
static int init_output_stream_streamcopy(OutputStream *ost) { OutputFile *of = output_files[ost->file_index]; InputStream *ist = get_input_stream(ost); AVCodecParameters *par_dst = ost->st->codecpar; AVCodecParameters *par_src = ist->st->codecpar; AVRational sar; uint32_t codec_tag = par_dst->codec_tag; int i, ret; if (!codec_tag) { if (!of->ctx->oformat->codec_tag || av_codec_get_id (of->ctx->oformat->codec_tag, par_src->codec_tag) == par_src->codec_id || av_codec_get_tag(of->ctx->oformat->codec_tag, par_src->codec_id) <= 0) codec_tag = par_src->codec_tag; } ret = avcodec_parameters_copy(par_dst, par_src); if (ret < 0) return ret; par_dst->codec_tag = codec_tag; ost->st->disposition = ist->st->disposition; ost->st->time_base = ist->st->time_base; if (ist->st->nb_side_data) { ost->st->side_data = av_realloc_array(NULL, ist->st->nb_side_data, sizeof(*ist->st->side_data)); if (!ost->st->side_data) return AVERROR(ENOMEM); for (i = 0; i < ist->st->nb_side_data; i++) { const AVPacketSideData *sd_src = &ist->st->side_data[i]; AVPacketSideData *sd_dst = &ost->st->side_data[i]; sd_dst->data = av_malloc(sd_src->size); if (!sd_dst->data) return AVERROR(ENOMEM); memcpy(sd_dst->data, sd_src->data, sd_src->size); sd_dst->size = sd_src->size; sd_dst->type = sd_src->type; ost->st->nb_side_data++; } } ost->parser = av_parser_init(par_dst->codec_id); ost->parser_avctx = avcodec_alloc_context3(NULL); if (!ost->parser_avctx) return AVERROR(ENOMEM); if (par_dst->codec_type == AVMEDIA_TYPE_VIDEO) { if (ost->frame_aspect_ratio) sar = av_d2q(ost->frame_aspect_ratio * par_dst->height / par_dst->width, 255); else if (ist->st->sample_aspect_ratio.num) sar = ist->st->sample_aspect_ratio; else sar = par_src->sample_aspect_ratio; ost->st->sample_aspect_ratio = par_dst->sample_aspect_ratio = sar; } return 0; } avconv.c:1832: error: Null Dereference pointer `ist` last assigned on line 1830 could be null and is dereferenced at line 1832, column 34. avconv.c:1827:1: start of procedure init_output_stream_streamcopy() 1825. } 1826. 1827. static int init_output_stream_streamcopy(OutputStream *ost) ^ 1828. { 1829. OutputFile *of = output_files[ost->file_index]; avconv.c:1829:5: 1827. static int init_output_stream_streamcopy(OutputStream *ost) 1828. { 1829. OutputFile *of = output_files[ost->file_index]; ^ 1830. InputStream *ist = get_input_stream(ost); 1831. AVCodecParameters *par_dst = ost->st->codecpar; avconv.c:1830:5: 1828. { 1829. OutputFile *of = output_files[ost->file_index]; 1830. InputStream *ist = get_input_stream(ost); ^ 1831. AVCodecParameters *par_dst = ost->st->codecpar; 1832. AVCodecParameters *par_src = ist->st->codecpar; avconv.c:1728:1: start of procedure get_input_stream() 1726. } 1727. 1728. static InputStream *get_input_stream(OutputStream *ost) ^ 1729. { 1730. if (ost->source_index >= 0) avconv.c:1730:9: Taking false branch 1728. static InputStream *get_input_stream(OutputStream *ost) 1729. { 1730. if (ost->source_index >= 0) ^ 1731. return input_streams[ost->source_index]; 1732. avconv.c:1733:9: Taking true branch 1731. return input_streams[ost->source_index]; 1732. 1733. if (ost->filter) { ^ 1734. FilterGraph *fg = ost->filter->graph; 1735. int i; avconv.c:1734:9: 1732. 1733. if (ost->filter) { 1734. FilterGraph *fg = ost->filter->graph; ^ 1735. int i; 1736. avconv.c:1737:14: 1735. int i; 1736. 1737. for (i = 0; i < fg->nb_inputs; i++) ^ 1738. if (fg->inputs[i]->ist->dec_ctx->codec_type == ost->enc_ctx->codec_type) 1739. return fg->inputs[i]->ist; avconv.c:1737:21: Loop condition is true. Entering loop body 1735. int i; 1736. 1737. for (i = 0; i < fg->nb_inputs; i++) ^ 1738. if (fg->inputs[i]->ist->dec_ctx->codec_type == ost->enc_ctx->codec_type) 1739. return fg->inputs[i]->ist; avconv.c:1738:17: Taking false branch 1736. 1737. for (i = 0; i < fg->nb_inputs; i++) 1738. if (fg->inputs[i]->ist->dec_ctx->codec_type == ost->enc_ctx->codec_type) ^ 1739. return fg->inputs[i]->ist; 1740. } avconv.c:1737:40: 1735. int i; 1736. 1737. for (i = 0; i < fg->nb_inputs; i++) ^ 1738. if (fg->inputs[i]->ist->dec_ctx->codec_type == ost->enc_ctx->codec_type) 1739. return fg->inputs[i]->ist; avconv.c:1737:21: Loop condition is false. Leaving loop 1735. int i; 1736. 1737. for (i = 0; i < fg->nb_inputs; i++) ^ 1738. if (fg->inputs[i]->ist->dec_ctx->codec_type == ost->enc_ctx->codec_type) 1739. return fg->inputs[i]->ist; avconv.c:1742:5: 1740. } 1741. 1742. return NULL; ^ 1743. } 1744. avconv.c:1743:1: return from a call to get_input_stream 1741. 1742. return NULL; 1743. } ^ 1744. 1745. /* open the muxer when all the streams are initialized */ avconv.c:1831:5: 1829. OutputFile *of = output_files[ost->file_index]; 1830. InputStream *ist = get_input_stream(ost); 1831. AVCodecParameters *par_dst = ost->st->codecpar; ^ 1832. AVCodecParameters *par_src = ist->st->codecpar; 1833. AVRational sar; avconv.c:1832:5: 1830. InputStream *ist = get_input_stream(ost); 1831. AVCodecParameters *par_dst = ost->st->codecpar; 1832. AVCodecParameters *par_src = ist->st->codecpar; ^ 1833. AVRational sar; 1834. uint32_t codec_tag = par_dst->codec_tag;
https://github.com/libav/libav/blob/d0a603a534a0ee4b255e5e72742428a7f7f42b83/avconv.c/#L1832
d2a_code_trace_data_44189
void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) { int i, j, max; const BN_ULONG *ap; BN_ULONG *rp; max = n * 2; ap = a; rp = r; rp[0] = rp[max - 1] = 0; rp++; j = n; if (--j > 0) { ap++; rp[j] = bn_mul_words(rp, ap, j, ap[-1]); rp += 2; } for (i = n - 2; i > 0; i--) { j--; ap++; rp[j] = bn_mul_add_words(rp, ap, j, ap[-1]); rp += 2; } bn_add_words(r, r, r, max); bn_sqr_words(tmp, a, n); bn_add_words(r, r, tmp, max); } apps/dhparam.c:268: error: BUFFER_OVERRUN_L3 Offset: [16, +oo] (⇐ 1 + [15, +oo]) Size: [0, 8388607] by call to `DH_check`. Showing all 31 steps of the trace apps/dhparam.c:205:32: Call 203. num, g); 204. BIO_printf(bio_err, "This is going to take a long time\n"); 205. if (dh == NULL || !DH_generate_parameters_ex(dh, num, g, cb)) { ^ 206. BN_GENCB_free(cb); 207. ERR_print_errors(bio_err); crypto/dh/dh_gen.c:23:1: Parameter `ret->p->top` 21. BN_GENCB *cb); 22. 23. > int DH_generate_parameters_ex(DH *ret, int prime_len, int generator, 24. BN_GENCB *cb) 25. { apps/dhparam.c:268:14: Call 266. 267. if (check) { 268. if (!DH_check(dh, &i)) { ^ 269. ERR_print_errors(bio_err); 270. goto end; crypto/dh/dh_check.c:25:1: Parameter `dh->g->top` 23. */ 24. 25. > int DH_check(const DH *dh, int *ret) 26. { 27. int ok = 0, r; crypto/dh/dh_check.c:45:13: Call 43. 44. if (dh->q) { 45. if (BN_cmp(dh->g, BN_value_one()) <= 0) ^ 46. *ret |= DH_NOT_SUITABLE_GENERATOR; 47. else if (BN_cmp(dh->g, dh->p) >= 0) crypto/bn/bn_lib.c:645:1: Parameter `a->top` 643. } 644. 645. > int BN_cmp(const BIGNUM *a, const BIGNUM *b) 646. { 647. int i; crypto/dh/dh_check.c:47:18: Call 45. if (BN_cmp(dh->g, BN_value_one()) <= 0) 46. *ret |= DH_NOT_SUITABLE_GENERATOR; 47. else if (BN_cmp(dh->g, dh->p) >= 0) ^ 48. *ret |= DH_NOT_SUITABLE_GENERATOR; 49. else { crypto/bn/bn_lib.c:645:1: Parameter `a->top` 643. } 644. 645. > int BN_cmp(const BIGNUM *a, const BIGNUM *b) 646. { 647. int i; crypto/dh/dh_check.c:51:18: Call 49. else { 50. /* Check g^q == 1 mod p */ 51. if (!BN_mod_exp(t1, dh->g, dh->q, dh->p, ctx)) ^ 52. goto err; 53. if (!BN_is_one(t1)) crypto/bn/bn_exp.c:90:1: Parameter `a->top` 88. } 89. 90. > int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, 91. BN_CTX *ctx) 92. { crypto/bn/bn_exp.c:150:19: Call 148. } else 149. # endif 150. ret = BN_mod_exp_mont(r, a, p, m, ctx, NULL); ^ 151. } else 152. #endif crypto/bn/bn_exp.c:300:1: Parameter `a->top` 298. } 299. 300. > int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, 301. const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont) 302. { crypto/bn/bn_exp.c:312:16: Call 310. 311. if (BN_get_flags(p, BN_FLG_CONSTTIME) != 0) { 312. return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont); ^ 313. } 314. crypto/bn/bn_exp.c:600:1: Parameter `a->top` 598. * http://www.daemonology.net/hyperthreading-considered-harmful/) 599. */ 600. > int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, 601. const BIGNUM *m, BN_CTX *ctx, 602. BN_MONT_CTX *in_mont) crypto/bn/bn_exp.c:757:17: Call 755. if (!BN_to_montgomery(&am, &am, mont, ctx)) 756. goto err; 757. } else if (!BN_to_montgomery(&am, a, mont, ctx)) ^ 758. goto err; 759. crypto/bn/bn_lib.c:945:1: Parameter `a->top` 943. } 944. 945. > int BN_to_montgomery(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont, 946. BN_CTX *ctx) 947. { crypto/bn/bn_lib.c:948:12: Call 946. BN_CTX *ctx) 947. { 948. return BN_mod_mul_montgomery(r, a, &(mont->RR), mont, ctx); ^ 949. } 950. crypto/bn/bn_mont.c:26:1: Parameter `a->top` 24. #endif 25. 26. > int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, 27. BN_MONT_CTX *mont, BN_CTX *ctx) 28. { crypto/bn/bn_mont.c:53:14: Call 51. bn_check_top(tmp); 52. if (a == b) { 53. if (!BN_sqr(tmp, a, ctx)) ^ 54. goto err; 55. } else { crypto/bn/bn_sqr.c:17:1: Parameter `a->top` 15. * I've just gone over this and it is now %20 faster on x86 - eay - 27 Jun 96 16. */ 17. > int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) 18. { 19. int max, al; crypto/bn/bn_sqr.c:25:5: Assignment 23. bn_check_top(a); 24. 25. al = a->top; ^ 26. if (al <= 0) { 27. r->top = 0; crypto/bn/bn_sqr.c:74:17: Call 72. if (bn_wexpand(tmp, max) == NULL) 73. goto err; 74. bn_sqr_normal(rr->d, a->d, al, tmp->d); ^ 75. } 76. } crypto/bn/bn_sqr.c:104:1: <Offset trace> 102. 103. /* tmp must have 2*n words */ 104. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 105. { 106. int i, j, max; crypto/bn/bn_sqr.c:104:1: Parameter `n` 102. 103. /* tmp must have 2*n words */ 104. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 105. { 106. int i, j, max; crypto/bn/bn_sqr.c:115:5: Assignment 113. rp[0] = rp[max - 1] = 0; 114. rp++; 115. j = n; ^ 116. 117. if (--j > 0) { crypto/bn/bn_sqr.c:117:9: Assignment 115. j = n; 116. 117. if (--j > 0) { ^ 118. ap++; 119. rp[j] = bn_mul_words(rp, ap, j, ap[-1]); crypto/bn/bn_sqr.c:104:1: <Length trace> 102. 103. /* tmp must have 2*n words */ 104. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 105. { 106. int i, j, max; crypto/bn/bn_sqr.c:104:1: Parameter `*r` 102. 103. /* tmp must have 2*n words */ 104. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 105. { 106. int i, j, max; crypto/bn/bn_sqr.c:112:5: Assignment 110. max = n * 2; 111. ap = a; 112. rp = r; ^ 113. rp[0] = rp[max - 1] = 0; 114. rp++; crypto/bn/bn_sqr.c:114:5: Assignment 112. rp = r; 113. rp[0] = rp[max - 1] = 0; 114. rp++; ^ 115. j = n; 116. crypto/bn/bn_sqr.c:119:9: Array access: Offset: [16, +oo] (⇐ 1 + [15, +oo]) Size: [0, 8388607] by call to `DH_check` 117. if (--j > 0) { 118. ap++; 119. rp[j] = bn_mul_words(rp, ap, j, ap[-1]); ^ 120. rp += 2; 121. }
https://github.com/openssl/openssl/blob/748e85308ef4f3e672975b3604ea2d76424fa404/crypto/bn/bn_sqr.c/#L119
d2a_code_trace_data_44190
int test_div_recp(BIO *bp, BN_CTX *ctx) { BIGNUM *a, *b, *c, *d, *e; BN_RECP_CTX *recp; int i; recp = BN_RECP_CTX_new(); a = BN_new(); b = BN_new(); c = BN_new(); d = BN_new(); e = BN_new(); for (i = 0; i < num0 + num1; i++) { if (i < num1) { BN_bntest_rand(a, 400, 0, 0); BN_copy(b, a); BN_lshift(a, a, i); BN_add_word(a, i); } else BN_bntest_rand(b, 50 + 3 * (i - num1), 0, 0); a->neg = rand_neg(); b->neg = rand_neg(); BN_RECP_CTX_set(recp, b, ctx); BN_div_recp(d, c, a, recp, ctx); if (bp != NULL) { if (!results) { BN_print(bp, a); BIO_puts(bp, " / "); BN_print(bp, b); BIO_puts(bp, " - "); } BN_print(bp, d); BIO_puts(bp, "\n"); if (!results) { BN_print(bp, a); BIO_puts(bp, " % "); BN_print(bp, b); BIO_puts(bp, " - "); } BN_print(bp, c); BIO_puts(bp, "\n"); } BN_mul(e, d, b, ctx); BN_add(d, e, c); BN_sub(d, d, a); if (!BN_is_zero(d)) { fprintf(stderr, "Reciprocal division test failed!\n"); fprintf(stderr, "a="); BN_print_fp(stderr, a); fprintf(stderr, "\nb="); BN_print_fp(stderr, b); fprintf(stderr, "\n"); return 0; } } BN_free(a); BN_free(b); BN_free(c); BN_free(d); BN_free(e); BN_RECP_CTX_free(recp); return (1); } test/bntest.c:638: error: MEMORY_LEAK memory dynamically allocated by call to `BN_new()` at line 588, column 9 is not reachable after line 638, column 5. Showing all 149 steps of the trace test/bntest.c:581:1: start of procedure test_div_recp() 579. } 580. 581. > int test_div_recp(BIO *bp, BN_CTX *ctx) 582. { 583. BIGNUM *a, *b, *c, *d, *e; test/bntest.c:587:5: 585. int i; 586. 587. > recp = BN_RECP_CTX_new(); 588. a = BN_new(); 589. b = BN_new(); crypto/bn/bn_recp.c:70:1: start of procedure BN_RECP_CTX_new() 68. } 69. 70. > BN_RECP_CTX *BN_RECP_CTX_new(void) 71. { 72. BN_RECP_CTX *ret; crypto/bn/bn_recp.c:74:9: 72. BN_RECP_CTX *ret; 73. 74. > if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL) 75. return (NULL); 76. crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/bn/bn_recp.c:74:9: Taking false branch 72. BN_RECP_CTX *ret; 73. 74. if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL) ^ 75. return (NULL); 76. crypto/bn/bn_recp.c:77:5: 75. return (NULL); 76. 77. > BN_RECP_CTX_init(ret); 78. ret->flags = BN_FLG_MALLOCED; 79. return (ret); crypto/bn/bn_recp.c:62:1: start of procedure BN_RECP_CTX_init() 60. #include "bn_lcl.h" 61. 62. > void BN_RECP_CTX_init(BN_RECP_CTX *recp) 63. { 64. bn_init(&(recp->N)); crypto/bn/bn_recp.c:64:5: Skipping bn_init(): empty list of specs 62. void BN_RECP_CTX_init(BN_RECP_CTX *recp) 63. { 64. bn_init(&(recp->N)); ^ 65. bn_init(&(recp->Nr)); 66. recp->num_bits = 0; crypto/bn/bn_recp.c:65:5: Skipping bn_init(): empty list of specs 63. { 64. bn_init(&(recp->N)); 65. bn_init(&(recp->Nr)); ^ 66. recp->num_bits = 0; 67. recp->flags = 0; crypto/bn/bn_recp.c:66:5: 64. bn_init(&(recp->N)); 65. bn_init(&(recp->Nr)); 66. > recp->num_bits = 0; 67. recp->flags = 0; 68. } crypto/bn/bn_recp.c:67:5: 65. bn_init(&(recp->Nr)); 66. recp->num_bits = 0; 67. > recp->flags = 0; 68. } 69. crypto/bn/bn_recp.c:68:1: return from a call to BN_RECP_CTX_init 66. recp->num_bits = 0; 67. recp->flags = 0; 68. > } 69. 70. BN_RECP_CTX *BN_RECP_CTX_new(void) crypto/bn/bn_recp.c:78:5: 76. 77. BN_RECP_CTX_init(ret); 78. > ret->flags = BN_FLG_MALLOCED; 79. return (ret); 80. } crypto/bn/bn_recp.c:79:5: 77. BN_RECP_CTX_init(ret); 78. ret->flags = BN_FLG_MALLOCED; 79. > return (ret); 80. } 81. crypto/bn/bn_recp.c:80:1: return from a call to BN_RECP_CTX_new 78. ret->flags = BN_FLG_MALLOCED; 79. return (ret); 80. > } 81. 82. void BN_RECP_CTX_free(BN_RECP_CTX *recp) test/bntest.c:588:5: 586. 587. recp = BN_RECP_CTX_new(); 588. > a = BN_new(); 589. b = BN_new(); 590. c = BN_new(); crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) test/bntest.c:589:5: 587. recp = BN_RECP_CTX_new(); 588. a = BN_new(); 589. > b = BN_new(); 590. c = BN_new(); 591. d = BN_new(); crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) test/bntest.c:590:5: 588. a = BN_new(); 589. b = BN_new(); 590. > c = BN_new(); 591. d = BN_new(); 592. e = BN_new(); crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) test/bntest.c:591:5: 589. b = BN_new(); 590. c = BN_new(); 591. > d = BN_new(); 592. e = BN_new(); 593. crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) test/bntest.c:592:5: 590. c = BN_new(); 591. d = BN_new(); 592. > e = BN_new(); 593. 594. for (i = 0; i < num0 + num1; i++) { crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) test/bntest.c:594:10: 592. e = BN_new(); 593. 594. > for (i = 0; i < num0 + num1; i++) { 595. if (i < num1) { 596. BN_bntest_rand(a, 400, 0, 0); test/bntest.c:594:17: Loop condition is false. Leaving loop 592. e = BN_new(); 593. 594. for (i = 0; i < num0 + num1; i++) { ^ 595. if (i < num1) { 596. BN_bntest_rand(a, 400, 0, 0); test/bntest.c:638:5: 636. } 637. } 638. > BN_free(a); 639. BN_free(b); 640. BN_free(c); crypto/bn/bn_lib.c:252:1: start of procedure BN_free() 250. } 251. 252. > void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) crypto/bn/bn_lib.c:254:9: Taking false branch 252. void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) ^ 255. return; 256. bn_check_top(a); crypto/bn/bn_lib.c:257:10: 255. return; 256. bn_check_top(a); 257. > if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:965:1: start of procedure BN_get_flags() 963. } 964. 965. > int BN_get_flags(const BIGNUM *b, int n) 966. { 967. return b->flags & n; crypto/bn/bn_lib.c:967:5: 965. int BN_get_flags(const BIGNUM *b, int n) 966. { 967. > return b->flags & n; 968. } 969. crypto/bn/bn_lib.c:968:1: return from a call to BN_get_flags 966. { 967. return b->flags & n; 968. > } 969. 970. /* Populate a BN_GENCB structure with an "old"-style callback */ crypto/bn/bn_lib.c:257:10: Taking false branch 255. return; 256. bn_check_top(a); 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) ^ 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:259:9: Taking false branch 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) ^ 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:263:9: 261. else { 262. #if OPENSSL_API_COMPAT < 0x00908000L 263. > a->flags |= BN_FLG_FREE; 264. #endif 265. a->d = NULL; crypto/bn/bn_lib.c:265:9: 263. a->flags |= BN_FLG_FREE; 264. #endif 265. > a->d = NULL; 266. } 267. } crypto/bn/bn_lib.c:259:5: 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. > if (a->flags & BN_FLG_MALLOCED) 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:267:1: return from a call to BN_free 265. a->d = NULL; 266. } 267. > } 268. 269. void bn_init(BIGNUM *a)
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/test/bntest.c/#L638
d2a_code_trace_data_44191
static int is_hwaccel_pix_fmt(enum AVPixelFormat pix_fmt) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); return desc->flags & AV_PIX_FMT_FLAG_HWACCEL; } libavcodec/utils.c:876: error: Null Dereference pointer `desc` last assigned on line 875 could be null and is dereferenced at line 876, column 12. libavcodec/utils.c:873:1: start of procedure is_hwaccel_pix_fmt() 871. } 872. 873. static int is_hwaccel_pix_fmt(enum AVPixelFormat pix_fmt) ^ 874. { 875. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); libavcodec/utils.c:875:5: 873. static int is_hwaccel_pix_fmt(enum AVPixelFormat pix_fmt) 874. { 875. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); ^ 876. return desc->flags & AV_PIX_FMT_FLAG_HWACCEL; 877. } libavutil/pixdesc.c:1665:1: start of procedure av_pix_fmt_desc_get() 1663. } 1664. 1665. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt) ^ 1666. { 1667. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) libavutil/pixdesc.c:1667:9: Taking false branch 1665. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt) 1666. { 1667. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) ^ 1668. return NULL; 1669. return &av_pix_fmt_descriptors[pix_fmt]; libavutil/pixdesc.c:1667:24: Taking true branch 1665. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt) 1666. { 1667. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) ^ 1668. return NULL; 1669. return &av_pix_fmt_descriptors[pix_fmt]; libavutil/pixdesc.c:1668:9: 1666. { 1667. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) 1668. return NULL; ^ 1669. return &av_pix_fmt_descriptors[pix_fmt]; 1670. } libavutil/pixdesc.c:1670:1: return from a call to av_pix_fmt_desc_get 1668. return NULL; 1669. return &av_pix_fmt_descriptors[pix_fmt]; 1670. } ^ 1671. 1672. const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev) libavcodec/utils.c:876:5: 874. { 875. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); 876. return desc->flags & AV_PIX_FMT_FLAG_HWACCEL; ^ 877. } 878.
https://github.com/libav/libav/blob/607ad990d31e6be52980970e5ce8cd25ab3de812/libavcodec/utils.c/#L876
d2a_code_trace_data_44192
static inline int dequant(AVSContext *h, DCTELEM *level_buf, uint8_t *run_buf, DCTELEM *dst, int mul, int shift, int coeff_num) { int round = 1 << (shift - 1); int pos = -1; const uint8_t *scantab = h->scantable.permutated; while(--coeff_num >= 0){ pos += run_buf[coeff_num]; if(pos > 63) { av_log(h->s.avctx, AV_LOG_ERROR, "position out of block bounds at pic %d MB(%d,%d)\n", h->picture.poc, h->mbx, h->mby); return -1; } dst[scantab[pos]] = (level_buf[coeff_num]*mul + round) >> shift; } return 0; } libavcodec/cavsdec.c:143: error: Buffer Overrun L2 Offset: [0, 64] Size: 64 by call to `dequant`. libavcodec/cavsdec.c:115:1: Array declaration 113. * @param stride line stride in frame buffer 114. */ 115. static int decode_residual_block(AVSContext *h, GetBitContext *gb, ^ 116. const dec_2dvlc_t *r, int esc_golomb_order, 117. int qp, uint8_t *dst, int stride) { libavcodec/cavsdec.c:143:8: Call 141. run_buf[i] = run; 142. } 143. if(dequant(h,level_buf, run_buf, block, ff_cavs_dequant_mul[qp], ^ 144. ff_cavs_dequant_shift[qp], i)) 145. return -1; libavcodec/cavs.h:279:1: <Offset trace> 277. } 278. 279. static inline int dequant(AVSContext *h, DCTELEM *level_buf, uint8_t *run_buf, ^ 280. DCTELEM *dst, int mul, int shift, int coeff_num) { 281. int round = 1 << (shift - 1); libavcodec/cavs.h:279:1: Parameter `coeff_num` 277. } 278. 279. static inline int dequant(AVSContext *h, DCTELEM *level_buf, uint8_t *run_buf, ^ 280. DCTELEM *dst, int mul, int shift, int coeff_num) { 281. int round = 1 << (shift - 1); libavcodec/cavs.h:286:11: Assignment 284. 285. /* inverse scan and dequantization */ 286. while(--coeff_num >= 0){ ^ 287. pos += run_buf[coeff_num]; 288. if(pos > 63) { libavcodec/cavs.h:279:1: <Length trace> 277. } 278. 279. static inline int dequant(AVSContext *h, DCTELEM *level_buf, uint8_t *run_buf, ^ 280. DCTELEM *dst, int mul, int shift, int coeff_num) { 281. int round = 1 << (shift - 1); libavcodec/cavs.h:279:1: Parameter `*level_buf` 277. } 278. 279. static inline int dequant(AVSContext *h, DCTELEM *level_buf, uint8_t *run_buf, ^ 280. DCTELEM *dst, int mul, int shift, int coeff_num) { 281. int round = 1 << (shift - 1); libavcodec/cavs.h:294:30: Array access: Offset: [0, 64] Size: 64 by call to `dequant` 292. return -1; 293. } 294. dst[scantab[pos]] = (level_buf[coeff_num]*mul + round) >> shift; ^ 295. } 296. return 0;
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/cavs.h/#L294
d2a_code_trace_data_44193
STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method, STACK_OF(SSL_CIPHER) *tls13_ciphersuites, STACK_OF(SSL_CIPHER) **cipher_list, STACK_OF(SSL_CIPHER) **cipher_list_by_id, const char *rule_str, CERT *c) { int ok, num_of_ciphers, num_of_alias_max, num_of_group_aliases, i; uint32_t disabled_mkey, disabled_auth, disabled_enc, disabled_mac; STACK_OF(SSL_CIPHER) *cipherstack; const char *rule_p; CIPHER_ORDER *co_list = NULL, *head = NULL, *tail = NULL, *curr; const SSL_CIPHER **ca_list = NULL; if (rule_str == NULL || cipher_list == NULL || cipher_list_by_id == NULL) return NULL; #ifndef OPENSSL_NO_EC if (!check_suiteb_cipher_list(ssl_method, c, &rule_str)) return NULL; #endif disabled_mkey = disabled_mkey_mask; disabled_auth = disabled_auth_mask; disabled_enc = disabled_enc_mask; disabled_mac = disabled_mac_mask; num_of_ciphers = ssl_method->num_ciphers(); co_list = OPENSSL_malloc(sizeof(*co_list) * num_of_ciphers); if (co_list == NULL) { SSLerr(SSL_F_SSL_CREATE_CIPHER_LIST, ERR_R_MALLOC_FAILURE); return NULL; } ssl_cipher_collect_ciphers(ssl_method, num_of_ciphers, disabled_mkey, disabled_auth, disabled_enc, disabled_mac, co_list, &head, &tail); ssl_cipher_apply_rule(0, SSL_kECDHE, SSL_aECDSA, 0, 0, 0, 0, CIPHER_ADD, -1, &head, &tail); ssl_cipher_apply_rule(0, SSL_kECDHE, 0, 0, 0, 0, 0, CIPHER_ADD, -1, &head, &tail); ssl_cipher_apply_rule(0, SSL_kECDHE, 0, 0, 0, 0, 0, CIPHER_DEL, -1, &head, &tail); ssl_cipher_apply_rule(0, 0, 0, SSL_AESGCM, 0, 0, 0, CIPHER_ADD, -1, &head, &tail); ssl_cipher_apply_rule(0, 0, 0, SSL_CHACHA20, 0, 0, 0, CIPHER_ADD, -1, &head, &tail); ssl_cipher_apply_rule(0, 0, 0, SSL_AES ^ SSL_AESGCM, 0, 0, 0, CIPHER_ADD, -1, &head, &tail); ssl_cipher_apply_rule(0, 0, 0, 0, 0, 0, 0, CIPHER_ADD, -1, &head, &tail); ssl_cipher_apply_rule(0, 0, 0, 0, SSL_MD5, 0, 0, CIPHER_ORD, -1, &head, &tail); ssl_cipher_apply_rule(0, 0, SSL_aNULL, 0, 0, 0, 0, CIPHER_ORD, -1, &head, &tail); ssl_cipher_apply_rule(0, SSL_kRSA, 0, 0, 0, 0, 0, CIPHER_ORD, -1, &head, &tail); ssl_cipher_apply_rule(0, SSL_kPSK, 0, 0, 0, 0, 0, CIPHER_ORD, -1, &head, &tail); ssl_cipher_apply_rule(0, 0, 0, SSL_RC4, 0, 0, 0, CIPHER_ORD, -1, &head, &tail); if (!ssl_cipher_strength_sort(&head, &tail)) { OPENSSL_free(co_list); return NULL; } ssl_cipher_apply_rule(0, 0, 0, 0, 0, TLS1_2_VERSION, 0, CIPHER_BUMP, -1, &head, &tail); ssl_cipher_apply_rule(0, 0, 0, 0, SSL_AEAD, 0, 0, CIPHER_BUMP, -1, &head, &tail); ssl_cipher_apply_rule(0, SSL_kDHE | SSL_kECDHE, 0, 0, 0, 0, 0, CIPHER_BUMP, -1, &head, &tail); ssl_cipher_apply_rule(0, SSL_kDHE | SSL_kECDHE, 0, 0, SSL_AEAD, 0, 0, CIPHER_BUMP, -1, &head, &tail); ssl_cipher_apply_rule(0, 0, 0, 0, 0, 0, 0, CIPHER_DEL, -1, &head, &tail); num_of_group_aliases = OSSL_NELEM(cipher_aliases); num_of_alias_max = num_of_ciphers + num_of_group_aliases + 1; ca_list = OPENSSL_malloc(sizeof(*ca_list) * num_of_alias_max); if (ca_list == NULL) { OPENSSL_free(co_list); SSLerr(SSL_F_SSL_CREATE_CIPHER_LIST, ERR_R_MALLOC_FAILURE); return NULL; } ssl_cipher_collect_aliases(ca_list, num_of_group_aliases, disabled_mkey, disabled_auth, disabled_enc, disabled_mac, head); ok = 1; rule_p = rule_str; if (strncmp(rule_str, "DEFAULT", 7) == 0) { ok = ssl_cipher_process_rulestr(SSL_DEFAULT_CIPHER_LIST, &head, &tail, ca_list, c); rule_p += 7; if (*rule_p == ':') rule_p++; } if (ok && (strlen(rule_p) > 0)) ok = ssl_cipher_process_rulestr(rule_p, &head, &tail, ca_list, c); OPENSSL_free(ca_list); if (!ok) { OPENSSL_free(co_list); return NULL; } if ((cipherstack = sk_SSL_CIPHER_new_null()) == NULL) { OPENSSL_free(co_list); return NULL; } for (i = 0; i < sk_SSL_CIPHER_num(tls13_ciphersuites); i++) { if (!sk_SSL_CIPHER_push(cipherstack, sk_SSL_CIPHER_value(tls13_ciphersuites, i))) { sk_SSL_CIPHER_free(cipherstack); return NULL; } } for (curr = head; curr != NULL; curr = curr->next) { if (curr->active) { if (!sk_SSL_CIPHER_push(cipherstack, curr->cipher)) { OPENSSL_free(co_list); sk_SSL_CIPHER_free(cipherstack); return NULL; } #ifdef CIPHER_DEBUG fprintf(stderr, "<%s>\n", curr->cipher->name); #endif } } OPENSSL_free(co_list); if (!update_cipher_list_by_id(cipher_list_by_id, cipherstack)) { sk_SSL_CIPHER_free(cipherstack); return NULL; } sk_SSL_CIPHER_free(*cipher_list); *cipher_list = cipherstack; return cipherstack; } test/sslapitest.c:284: error: BUFFER_OVERRUN_L1 Offset: 7 Size: 4 by call to `SSL_CTX_set_cipher_list`. Showing all 10 steps of the trace test/sslapitest.c:284:10: Call 282. 283. /* We also want to ensure that we use RSA-based key exchange. */ 284. if (!TEST_true(SSL_CTX_set_cipher_list(cctx, "RSA"))) ^ 285. goto end; 286. ssl/ssl_lib.c:2511:1: Parameter `*str` 2509. 2510. /** specify the ciphers to be used by default by the SSL_CTX */ 2511. > int SSL_CTX_set_cipher_list(SSL_CTX *ctx, const char *str) 2512. { 2513. STACK_OF(SSL_CIPHER) *sk; ssl/ssl_lib.c:2515:10: Call 2513. STACK_OF(SSL_CIPHER) *sk; 2514. 2515. sk = ssl_create_cipher_list(ctx->method, ctx->tls13_ciphersuites, ^ 2516. &ctx->cipher_list, &ctx->cipher_list_by_id, str, 2517. ctx->cert); ssl/ssl_ciph.c:1403:1: <Length trace> 1401. } 1402. 1403. > STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method, 1404. STACK_OF(SSL_CIPHER) *tls13_ciphersuites, 1405. STACK_OF(SSL_CIPHER) **cipher_list, ssl/ssl_ciph.c:1403:1: Parameter `*rule_str` 1401. } 1402. 1403. > STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method, 1404. STACK_OF(SSL_CIPHER) *tls13_ciphersuites, 1405. STACK_OF(SSL_CIPHER) **cipher_list, ssl/ssl_ciph.c:1423:10: Call 1421. return NULL; 1422. #ifndef OPENSSL_NO_EC 1423. if (!check_suiteb_cipher_list(ssl_method, c, &rule_str)) ^ 1424. return NULL; 1425. #endif ssl/ssl_ciph.c:1223:1: Parameter `**prule_str` 1221. 1222. #ifndef OPENSSL_NO_EC 1223. > static int check_suiteb_cipher_list(const SSL_METHOD *meth, CERT *c, 1224. const char **prule_str) 1225. { ssl/ssl_ciph.c:1572:5: Assignment 1570. */ 1571. ok = 1; 1572. rule_p = rule_str; ^ 1573. if (strncmp(rule_str, "DEFAULT", 7) == 0) { 1574. ok = ssl_cipher_process_rulestr(SSL_DEFAULT_CIPHER_LIST, ssl/ssl_ciph.c:1576:9: Assignment 1574. ok = ssl_cipher_process_rulestr(SSL_DEFAULT_CIPHER_LIST, 1575. &head, &tail, ca_list, c); 1576. rule_p += 7; ^ 1577. if (*rule_p == ':') 1578. rule_p++; ssl/ssl_ciph.c:1577:13: Array access: Offset: 7 Size: 4 by call to `SSL_CTX_set_cipher_list` 1575. &head, &tail, ca_list, c); 1576. rule_p += 7; 1577. if (*rule_p == ':') ^ 1578. rule_p++; 1579. }
https://github.com/openssl/openssl/blob/4845aeba4c49e1bd65259a5014d7e3ab38657d42/ssl/ssl_ciph.c/#L1577
d2a_code_trace_data_44194
void avformat_close_input(AVFormatContext **ps) { AVFormatContext *s = *ps; AVIOContext *pb = s->pb; if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) || (s->flags & AVFMT_FLAG_CUSTOM_IO)) pb = NULL; flush_packet_queue(s); if (s->iformat) { if (s->iformat->read_close) s->iformat->read_close(s); } avformat_free_context(s); *ps = NULL; avio_close(pb); } libavformat/utils.c:2579: error: Null Dereference pointer `pb` last assigned on line 2566 could be null and is dereferenced by call to `avio_close()` at line 2579, column 5. libavformat/utils.c:2559:1: start of procedure avformat_close_input() 2557. } 2558. 2559. void avformat_close_input(AVFormatContext **ps) ^ 2560. { 2561. AVFormatContext *s = *ps; libavformat/utils.c:2561:5: 2559. void avformat_close_input(AVFormatContext **ps) 2560. { 2561. AVFormatContext *s = *ps; ^ 2562. AVIOContext *pb = s->pb; 2563. libavformat/utils.c:2562:5: 2560. { 2561. AVFormatContext *s = *ps; 2562. AVIOContext *pb = s->pb; ^ 2563. 2564. if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) || libavformat/utils.c:2564:10: Taking true branch 2562. AVIOContext *pb = s->pb; 2563. 2564. if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) || ^ 2565. (s->flags & AVFMT_FLAG_CUSTOM_IO)) 2566. pb = NULL; libavformat/utils.c:2564:24: Taking false branch 2562. AVIOContext *pb = s->pb; 2563. 2564. if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) || ^ 2565. (s->flags & AVFMT_FLAG_CUSTOM_IO)) 2566. pb = NULL; libavformat/utils.c:2565:10: Taking true branch 2563. 2564. if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) || 2565. (s->flags & AVFMT_FLAG_CUSTOM_IO)) ^ 2566. pb = NULL; 2567. libavformat/utils.c:2566:9: 2564. if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) || 2565. (s->flags & AVFMT_FLAG_CUSTOM_IO)) 2566. pb = NULL; ^ 2567. 2568. flush_packet_queue(s); libavformat/utils.c:2568:5: Skipping flush_packet_queue(): empty list of specs 2566. pb = NULL; 2567. 2568. flush_packet_queue(s); ^ 2569. 2570. if (s->iformat) { libavformat/utils.c:2570:9: Taking true branch 2568. flush_packet_queue(s); 2569. 2570. if (s->iformat) { ^ 2571. if (s->iformat->read_close) 2572. s->iformat->read_close(s); libavformat/utils.c:2571:13: Taking true branch 2569. 2570. if (s->iformat) { 2571. if (s->iformat->read_close) ^ 2572. s->iformat->read_close(s); 2573. } libavformat/utils.c:2572:13: Skipping __function_pointer__(): unresolved function pointer 2570. if (s->iformat) { 2571. if (s->iformat->read_close) 2572. s->iformat->read_close(s); ^ 2573. } 2574. libavformat/utils.c:2575:5: Skipping avformat_free_context(): empty list of specs 2573. } 2574. 2575. avformat_free_context(s); ^ 2576. 2577. *ps = NULL; libavformat/utils.c:2577:5: 2575. avformat_free_context(s); 2576. 2577. *ps = NULL; ^ 2578. 2579. avio_close(pb); libavformat/utils.c:2579:5: 2577. *ps = NULL; 2578. 2579. avio_close(pb); ^ 2580. } 2581. libavformat/aviobuf.c:794:1: start of procedure avio_close() 792. } 793. 794. int avio_close(AVIOContext *s) ^ 795. { 796. URLContext *h; libavformat/aviobuf.c:798:10: Taking false branch 796. URLContext *h; 797. 798. if (!s) ^ 799. return 0; 800. libavformat/aviobuf.c:801:5: 799. return 0; 800. 801. avio_flush(s); ^ 802. h = s->opaque; 803. av_freep(&s->buffer); libavformat/aviobuf.c:180:1: start of procedure avio_flush() 178. } 179. 180. void avio_flush(AVIOContext *s) ^ 181. { 182. flush_buffer(s); libavformat/aviobuf.c:182:5: 180. void avio_flush(AVIOContext *s) 181. { 182. flush_buffer(s); ^ 183. s->must_flush = 0; 184. } libavformat/aviobuf.c:124:1: start of procedure flush_buffer() 122. } 123. 124. static void flush_buffer(AVIOContext *s) ^ 125. { 126. if (s->buf_ptr > s->buffer) { libavformat/aviobuf.c:126:9: 124. static void flush_buffer(AVIOContext *s) 125. { 126. if (s->buf_ptr > s->buffer) { ^ 127. if (s->write_packet && !s->error) { 128. int ret = s->write_packet(s->opaque, s->buffer,
https://github.com/libav/libav/blob/d6d27f3e58e6980bce4a490e7d8cc0f6a84521fe/libavformat/utils.c/#L2579
d2a_code_trace_data_44195
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:1170: error: Uninitialized Value The value read from xmax was never initialized. libavcodec/motion_est_template.c:1170:9: 1168. CHECK_MV(P_TOP[0]>>shift, P_TOP[1]>>shift) 1169. CHECK_MV(P_TOPRIGHT[0]>>shift, P_TOPRIGHT[1]>>shift) 1170. CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16, ^ 1171. (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16) 1172. }
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1170
d2a_code_trace_data_44196
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:1098: error: Uninitialized Value The value read from ymin was never initialized. libavcodec/motion_est_template.c:1098:53: 1096. int my= (last_mv[xy][1]*ref_mv_scale + (1<<15))>>16; 1097. 1098. if(mx>xmax || mx<xmin || my>ymax || my<ymin) continue; ^ 1099. CHECK_MV(mx,my) 1100. }
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1098
d2a_code_trace_data_44197
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]):unsigned32 by call to `ssl3_cbc_digest_record`. Showing all 8 steps of the trace ssl/s3_enc.c:726:1: Parameter `ssl->s3->rrec.orig_len` 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_plus_padding_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:563:2: Assignment 561. * bytes of `header' before the start of the data (TLS) or 71/75 bytes 562. * (SSLv3) */ 563. len = data_plus_mac_plus_padding_size + header_length; ^ 564. /* max_mac_bytes contains the maximum bytes of bytes in the MAC, including 565. * |header|, assuming that there's no padding. */ 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:566:2: Binary operation: ([13, +oo] - [16, 64]):unsigned32 by call to `ssl3_cbc_digest_record` 564. /* max_mac_bytes contains the maximum bytes of bytes in the MAC, including 565. * |header|, assuming that there's no padding. */ 566. max_mac_bytes = len - md_size - 1; ^ 567. /* num_blocks is the maximum number of hash blocks. */ 568. num_blocks = (max_mac_bytes + 1 + md_length_size + md_block_size - 1) / md_block_size;
https://github.com/openssl/openssl/blob/f93a41877d8d7a287debb7c63d7b646abaaf269c/ssl/s3_cbc.c/#L566
d2a_code_trace_data_44198
int test_div(BIO *bp, BN_CTX *ctx) { BIGNUM *a, *b, *c, *d, *e; int i; a = BN_new(); b = BN_new(); c = BN_new(); d = BN_new(); e = BN_new(); BN_one(a); BN_zero(b); if (BN_div(d, c, a, b, ctx)) { fprintf(stderr, "Division by zero succeeded!\n"); return 0; } for (i = 0; i < num0 + num1; i++) { if (i < num1) { BN_bntest_rand(a, 400, 0, 0); BN_copy(b, a); BN_lshift(a, a, i); BN_add_word(a, i); } else BN_bntest_rand(b, 50 + 3 * (i - num1), 0, 0); a->neg = rand_neg(); b->neg = rand_neg(); BN_div(d, c, a, b, ctx); if (bp != NULL) { if (!results) { BN_print(bp, a); BIO_puts(bp, " / "); BN_print(bp, b); BIO_puts(bp, " - "); } BN_print(bp, d); BIO_puts(bp, "\n"); if (!results) { BN_print(bp, a); BIO_puts(bp, " % "); BN_print(bp, b); BIO_puts(bp, " - "); } BN_print(bp, c); BIO_puts(bp, "\n"); } BN_mul(e, d, b, ctx); BN_add(d, e, c); BN_sub(d, d, a); if (!BN_is_zero(d)) { fprintf(stderr, "Division test failed!\n"); return 0; } } BN_free(a); BN_free(b); BN_free(c); BN_free(d); BN_free(e); return (1); } test/bntest.c:506: error: MEMORY_LEAK memory dynamically allocated by call to `BN_new()` at line 454, column 9 is not reachable after line 506, column 5. Showing all 147 steps of the trace test/bntest.c:449:1: start of procedure test_div() 447. } 448. 449. > int test_div(BIO *bp, BN_CTX *ctx) 450. { 451. BIGNUM *a, *b, *c, *d, *e; test/bntest.c:454:5: 452. int i; 453. 454. > a = BN_new(); 455. b = BN_new(); 456. c = BN_new(); crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) test/bntest.c:455:5: 453. 454. a = BN_new(); 455. > b = BN_new(); 456. c = BN_new(); 457. d = BN_new(); crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) test/bntest.c:456:5: 454. a = BN_new(); 455. b = BN_new(); 456. > c = BN_new(); 457. d = BN_new(); 458. e = BN_new(); crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) test/bntest.c:457:5: 455. b = BN_new(); 456. c = BN_new(); 457. > d = BN_new(); 458. e = BN_new(); 459. crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) test/bntest.c:458:5: 456. c = BN_new(); 457. d = BN_new(); 458. > e = BN_new(); 459. 460. BN_one(a); crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) test/bntest.c:460:5: 458. e = BN_new(); 459. 460. > BN_one(a); 461. BN_zero(b); 462. crypto/bn/bn_lib.c:530:1: start of procedure BN_set_word() 528. } 529. 530. > int BN_set_word(BIGNUM *a, BN_ULONG w) 531. { 532. bn_check_top(a); crypto/bn/bn_lib.c:533:9: Condition is true 531. { 532. bn_check_top(a); 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 534. return (0); 535. a->neg = 0; crypto/bn/bn_lib.c:533:9: Taking false branch 531. { 532. bn_check_top(a); 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 534. return (0); 535. a->neg = 0; crypto/bn/bn_lib.c:535:5: 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) 534. return (0); 535. > a->neg = 0; 536. a->d[0] = w; 537. a->top = (w ? 1 : 0); crypto/bn/bn_lib.c:536:5: 534. return (0); 535. a->neg = 0; 536. > a->d[0] = w; 537. a->top = (w ? 1 : 0); 538. bn_check_top(a); crypto/bn/bn_lib.c:537:15: Condition is true 535. a->neg = 0; 536. a->d[0] = w; 537. a->top = (w ? 1 : 0); ^ 538. bn_check_top(a); 539. return (1); crypto/bn/bn_lib.c:537:5: 535. a->neg = 0; 536. a->d[0] = w; 537. > a->top = (w ? 1 : 0); 538. bn_check_top(a); 539. return (1); crypto/bn/bn_lib.c:539:5: 537. a->top = (w ? 1 : 0); 538. bn_check_top(a); 539. > return (1); 540. } 541. crypto/bn/bn_lib.c:540:1: return from a call to BN_set_word 538. bn_check_top(a); 539. return (1); 540. > } 541. 542. BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret) test/bntest.c:461:5: 459. 460. BN_one(a); 461. > BN_zero(b); 462. 463. if (BN_div(d, c, a, b, ctx)) { crypto/bn/bn_lib.c:530:1: start of procedure BN_set_word() 528. } 529. 530. > int BN_set_word(BIGNUM *a, BN_ULONG w) 531. { 532. bn_check_top(a); crypto/bn/bn_lib.c:533:9: Condition is true 531. { 532. bn_check_top(a); 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 534. return (0); 535. a->neg = 0; crypto/bn/bn_lib.c:533:9: Taking false branch 531. { 532. bn_check_top(a); 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 534. return (0); 535. a->neg = 0; crypto/bn/bn_lib.c:535:5: 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) 534. return (0); 535. > a->neg = 0; 536. a->d[0] = w; 537. a->top = (w ? 1 : 0); crypto/bn/bn_lib.c:536:5: 534. return (0); 535. a->neg = 0; 536. > a->d[0] = w; 537. a->top = (w ? 1 : 0); 538. bn_check_top(a); crypto/bn/bn_lib.c:537:15: Condition is false 535. a->neg = 0; 536. a->d[0] = w; 537. a->top = (w ? 1 : 0); ^ 538. bn_check_top(a); 539. return (1); crypto/bn/bn_lib.c:537:5: 535. a->neg = 0; 536. a->d[0] = w; 537. > a->top = (w ? 1 : 0); 538. bn_check_top(a); 539. return (1); crypto/bn/bn_lib.c:539:5: 537. a->top = (w ? 1 : 0); 538. bn_check_top(a); 539. > return (1); 540. } 541. crypto/bn/bn_lib.c:540:1: return from a call to BN_set_word 538. bn_check_top(a); 539. return (1); 540. > } 541. 542. BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret) test/bntest.c:463:9: Taking false branch 461. BN_zero(b); 462. 463. if (BN_div(d, c, a, b, ctx)) { ^ 464. fprintf(stderr, "Division by zero succeeded!\n"); 465. return 0; test/bntest.c:468:10: 466. } 467. 468. > for (i = 0; i < num0 + num1; i++) { 469. if (i < num1) { 470. BN_bntest_rand(a, 400, 0, 0); test/bntest.c:468:17: Loop condition is false. Leaving loop 466. } 467. 468. for (i = 0; i < num0 + num1; i++) { ^ 469. if (i < num1) { 470. BN_bntest_rand(a, 400, 0, 0); test/bntest.c:506:5: 504. } 505. } 506. > BN_free(a); 507. BN_free(b); 508. BN_free(c); crypto/bn/bn_lib.c:252:1: start of procedure BN_free() 250. } 251. 252. > void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) crypto/bn/bn_lib.c:254:9: Taking false branch 252. void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) ^ 255. return; 256. bn_check_top(a); crypto/bn/bn_lib.c:257:10: 255. return; 256. bn_check_top(a); 257. > if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:965:1: start of procedure BN_get_flags() 963. } 964. 965. > int BN_get_flags(const BIGNUM *b, int n) 966. { 967. return b->flags & n; crypto/bn/bn_lib.c:967:5: 965. int BN_get_flags(const BIGNUM *b, int n) 966. { 967. > return b->flags & n; 968. } 969. crypto/bn/bn_lib.c:968:1: return from a call to BN_get_flags 966. { 967. return b->flags & n; 968. > } 969. 970. /* Populate a BN_GENCB structure with an "old"-style callback */ crypto/bn/bn_lib.c:257:10: Taking false branch 255. return; 256. bn_check_top(a); 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) ^ 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:259:9: Taking false branch 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) ^ 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:263:9: 261. else { 262. #if OPENSSL_API_COMPAT < 0x00908000L 263. > a->flags |= BN_FLG_FREE; 264. #endif 265. a->d = NULL; crypto/bn/bn_lib.c:265:9: 263. a->flags |= BN_FLG_FREE; 264. #endif 265. > a->d = NULL; 266. } 267. } crypto/bn/bn_lib.c:259:5: 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. > if (a->flags & BN_FLG_MALLOCED) 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:267:1: return from a call to BN_free 265. a->d = NULL; 266. } 267. > } 268. 269. void bn_init(BIGNUM *a)
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/test/bntest.c/#L506
d2a_code_trace_data_44199
static inline void mix(uint8_t state[2][4][4], uint32_t multbl[4][256], int s1, int s3){ ((uint32_t *)(state))[0] = mix_core(multbl, state[1][0][0], state[1][s1 ][1], state[1][2][2], state[1][s3 ][3]); ((uint32_t *)(state))[1] = mix_core(multbl, state[1][1][0], state[1][s3-1][1], state[1][3][2], state[1][s1-1][3]); ((uint32_t *)(state))[2] = mix_core(multbl, state[1][2][0], state[1][s3 ][1], state[1][0][2], state[1][s1 ][3]); ((uint32_t *)(state))[3] = mix_core(multbl, state[1][3][0], state[1][s1-1][1], state[1][1][2], state[1][s3-1][3]); } libavutil/aes.c:181: error: Buffer Overrun L1 Offset: 3 Size: 3 by call to `mix`. libavutil/aes.c:125:1: Array declaration 123. 124. // this is based on the reference AES code by Paulo Barreto and Vincent Rijmen 125. int av_aes_init(AVAES *a, const uint8_t *key, int key_bits, int decrypt) { ^ 126. int i, j, t, rconpointer = 0; 127. uint8_t tk[8][4]; libavutil/aes.c:181:13: Call 179. memcpy(tmp[2], a->round_key[i][0], 16); 180. subshift(tmp[1], 0, sbox); 181. mix(tmp, dec_multbl, 1, 3); ^ 182. memcpy(a->round_key[i][0], tmp[0], 16); 183. } libavutil/aes.c:73:1: <Length trace> 71. } 72. 73. static inline void mix(uint8_t state[2][4][4], uint32_t multbl[4][256], int s1, int s3){ ^ 74. ((uint32_t *)(state))[0] = mix_core(multbl, state[1][0][0], state[1][s1 ][1], state[1][2][2], state[1][s3 ][3]); 75. ((uint32_t *)(state))[1] = mix_core(multbl, state[1][1][0], state[1][s3-1][1], state[1][3][2], state[1][s1-1][3]); libavutil/aes.c:73:1: Parameter `*state` 71. } 72. 73. static inline void mix(uint8_t state[2][4][4], uint32_t multbl[4][256], int s1, int s3){ ^ 74. ((uint32_t *)(state))[0] = mix_core(multbl, state[1][0][0], state[1][s1 ][1], state[1][2][2], state[1][s3 ][3]); 75. ((uint32_t *)(state))[1] = mix_core(multbl, state[1][1][0], state[1][s3-1][1], state[1][3][2], state[1][s1-1][3]); libavutil/aes.c:77:5: Array access: Offset: 3 Size: 3 by call to `mix` 75. ((uint32_t *)(state))[1] = mix_core(multbl, state[1][1][0], state[1][s3-1][1], state[1][3][2], state[1][s1-1][3]); 76. ((uint32_t *)(state))[2] = mix_core(multbl, state[1][2][0], state[1][s3 ][1], state[1][0][2], state[1][s1 ][3]); 77. ((uint32_t *)(state))[3] = mix_core(multbl, state[1][3][0], state[1][s1-1][1], state[1][1][2], state[1][s3-1][3]); ^ 78. } 79.
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavutil/aes.c/#L77
d2a_code_trace_data_44200
static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) { BN_ULONG *a = NULL; bn_check_top(b); if (words > (INT_MAX / (4 * BN_BITS2))) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_BIGNUM_TOO_LONG); return NULL; } if (BN_get_flags(b, BN_FLG_STATIC_DATA)) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA); return (NULL); } if (BN_get_flags(b, BN_FLG_SECURE)) a = OPENSSL_secure_zalloc(words * sizeof(*a)); else a = OPENSSL_zalloc(words * sizeof(*a)); if (a == NULL) { BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE); return (NULL); } assert(b->top <= words); if (b->top > 0) memcpy(a, b->d, sizeof(*a) * b->top); return a; } crypto/bn/bn_gf2m.c:990: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_set_bit`. Showing all 16 steps of the trace crypto/bn/bn_gf2m.c:987:14: Call 985. 986. BN_CTX_start(ctx); 987. if ((u = BN_CTX_get(ctx)) == NULL) ^ 988. goto err; 989. crypto/bn/bn_ctx.c:229:5: Call 227. } 228. /* OK, make sure the returned bignum is "zero" */ 229. BN_zero(ret); ^ 230. ctx->used++; 231. CTXDBG_RET(ctx, ret); crypto/bn/bn_lib.c:402:15: Assignment 400. a->neg = 0; 401. a->d[0] = w; 402. a->top = (w ? 1 : 0); ^ 403. bn_check_top(a); 404. return (1); crypto/bn/bn_lib.c:402:5: Assignment 400. a->neg = 0; 401. a->d[0] = w; 402. a->top = (w ? 1 : 0); ^ 403. bn_check_top(a); 404. return (1); crypto/bn/bn_gf2m.c:990:10: Call 988. goto err; 989. 990. if (!BN_set_bit(u, p[0] - 1)) ^ 991. goto err; 992. ret = BN_GF2m_mod_exp_arr(r, a, u, p, ctx); crypto/bn/bn_lib.c:624:1: Parameter `*a->d` 622. } 623. 624. > int BN_set_bit(BIGNUM *a, int n) 625. { 626. int i, j, k; crypto/bn/bn_lib.c:634:13: Call 632. j = n % BN_BITS2; 633. if (a->top <= i) { 634. if (bn_wexpand(a, i + 1) == NULL) ^ 635. return (0); 636. for (k = a->top; k < i + 1; k++) crypto/bn/bn_lib.c:948:1: Parameter `*a->d` 946. } 947. 948. > BIGNUM *bn_wexpand(BIGNUM *a, int words) 949. { 950. return (words <= a->dmax) ? a : bn_expand2(a, words); crypto/bn/bn_lib.c:950:37: Call 948. BIGNUM *bn_wexpand(BIGNUM *a, int words) 949. { 950. return (words <= a->dmax) ? a : bn_expand2(a, words); ^ 951. } 952. crypto/bn/bn_lib.c:284:1: Parameter `*b->d` 282. */ 283. 284. > BIGNUM *bn_expand2(BIGNUM *b, int words) 285. { 286. bn_check_top(b); crypto/bn/bn_lib.c:289:23: Call 287. 288. if (words > b->dmax) { 289. BN_ULONG *a = bn_expand_internal(b, words); ^ 290. if (!a) 291. return NULL; crypto/bn/bn_lib.c:246:1: <Offset trace> 244. /* This is used by bn_expand2() */ 245. /* The caller MUST check that words > b->dmax before calling this */ 246. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 247. { 248. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:246:1: Parameter `b->top` 244. /* This is used by bn_expand2() */ 245. /* The caller MUST check that words > b->dmax before calling this */ 246. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 247. { 248. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:246:1: <Length trace> 244. /* This is used by bn_expand2() */ 245. /* The caller MUST check that words > b->dmax before calling this */ 246. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 247. { 248. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:246:1: Parameter `*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 = NULL; crypto/bn/bn_lib.c:271:9: Array access: Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_set_bit` 269. assert(b->top <= words); 270. if (b->top > 0) 271. memcpy(a, b->d, sizeof(*a) * b->top); ^ 272. 273. return a;
https://github.com/openssl/openssl/blob/05eec39505ba8af6f3c1558a26c565987707cd37/crypto/bn/bn_lib.c/#L271
d2a_code_trace_data_44201
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; } test/evp_test.c:1007: error: INTEGER_OVERFLOW_L1 (0 - 1):unsigned64 by call to `EVP_CipherUpdate`. Showing all 8 steps of the trace test/evp_test.c:1007:25: Call 1005. } 1006. if (cdat->aad_len > 1 1007. && !EVP_CipherUpdate(ctx, NULL, &chunklen, ^ 1008. cdat->aad + donelen, 1)) 1009. goto err; crypto/evp/evp_enc.c:207:1: Parameter `inl` 205. } 206. 207. > int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, 208. const unsigned char *in, int inl) 209. { crypto/evp/evp_enc.c:211:16: Call 209. { 210. if (ctx->encrypt) 211. return EVP_EncryptUpdate(ctx, out, outl, in, inl); ^ 212. else 213. return EVP_DecryptUpdate(ctx, out, outl, in, inl); crypto/evp/evp_enc.c:295:1: Parameter `inl` 293. } 294. 295. > int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, 296. const unsigned char *in, int inl) 297. { crypto/evp/evp_enc.c:304:24: Call 302. if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) { 303. /* If block size > 1 then the cipher will have to do this check */ 304. if (bl == 1 && is_partially_overlapping(out, in, inl)) { ^ 305. EVPerr(EVP_F_EVP_ENCRYPTUPDATE, EVP_R_PARTIALLY_OVERLAPPING); 306. return 0; crypto/evp/evp_enc.c:281:1: <RHS trace> 279. #endif 280. 281. > int is_partially_overlapping(const void *ptr1, const void *ptr2, int len) 282. { 283. PTRDIFF_T diff = (PTRDIFF_T)ptr1-(PTRDIFF_T)ptr2; crypto/evp/evp_enc.c:281:1: Parameter `len` 279. #endif 280. 281. > int is_partially_overlapping(const void *ptr1, const void *ptr2, int len) 282. { 283. PTRDIFF_T diff = (PTRDIFF_T)ptr1-(PTRDIFF_T)ptr2; crypto/evp/evp_enc.c:290:50: Binary operation: (0 - 1):unsigned64 by call to `EVP_CipherUpdate` 288. */ 289. int overlapped = (len > 0) & (diff != 0) & ((diff < (PTRDIFF_T)len) | 290. (diff > (0 - (PTRDIFF_T)len))); ^ 291. 292. return overlapped;
https://github.com/openssl/openssl/blob/222c3da35cc508446df150a16080943019ba6f54/crypto/evp/evp_enc.c/#L290
d2a_code_trace_data_44202
void *lh_delete(LHASH *lh, const void *data) { unsigned long hash; LHASH_NODE *nn,**rn; const 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((void *)ret); } ssl/s3_clnt.c:313: error: INTEGER_OVERFLOW_L2 ([0, `s->ctx->sessions->num_items`] - 1):unsigned64 by call to `ssl3_check_cert_and_algorithm`. Showing all 17 steps of the trace ssl/s3_clnt.c:184:1: Parameter `s->ctx->sessions->num_items` 182. } 183. 184. > int ssl3_connect(SSL *s) 185. { 186. BUF_MEM *buf=NULL; ssl/s3_clnt.c:306:8: Call 304. case SSL3_ST_CR_KEY_EXCH_A: 305. case SSL3_ST_CR_KEY_EXCH_B: 306. ret=ssl3_get_key_exchange(s); ^ 307. if (ret <= 0) goto end; 308. s->state=SSL3_ST_CR_CERT_REQ_A; ssl/s3_clnt.c:962:1: Parameter `s->ctx->sessions->num_items` 960. } 961. 962. > static int ssl3_get_key_exchange(SSL *s) 963. { 964. #ifndef OPENSSL_NO_RSA ssl/s3_clnt.c:988:4: Call 986. /* use same message size as in ssl3_get_certificate_request() 987. * as ServerKeyExchange message may be skipped */ 988. n=ssl3_get_message(s, ^ 989. SSL3_ST_CR_KEY_EXCH_A, 990. SSL3_ST_CR_KEY_EXCH_B, ssl/s3_both.c:351:1: Parameter `s->ctx->sessions->num_items` 349. * the body is read in state 'stn'. 350. */ 351. > long ssl3_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok) 352. { 353. unsigned char *p; ssl/s3_clnt.c:313:9: Call 311. /* at this point we check that we have the 312. * required stuff from the server */ 313. if (!ssl3_check_cert_and_algorithm(s)) ^ 314. { 315. ret= -1; ssl/s3_clnt.c:2223:1: Parameter `s->ctx->sessions->num_items` 2221. #define has_bits(i,m) (((i)&(m)) == (m)) 2222. 2223. > static int ssl3_check_cert_and_algorithm(SSL *s) 2224. { 2225. int i,idx; ssl/s3_clnt.c:2355:2: Call 2353. return(1); 2354. f_err: 2355. ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_HANDSHAKE_FAILURE); ^ 2356. err: 2357. return(0); ssl/s3_pkt.c:1233:1: Parameter `s->ctx->sessions->num_items` 1231. } 1232. 1233. > void ssl3_send_alert(SSL *s, int level, int desc) 1234. { 1235. /* Map tls/ssl alert value to correct one */ ssl/s3_pkt.c:1242:3: Call 1240. /* If a fatal one, remove from cache */ 1241. if ((level == 2) && (s->session != NULL)) 1242. SSL_CTX_remove_session(s->ctx,s->session); ^ 1243. 1244. s->s3->alert_dispatch=1; ssl/ssl_sess.c:474:1: Parameter `ctx->sessions->num_items` 472. } 473. 474. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 475. { 476. return remove_session_lock(ctx, c, 1); ssl/ssl_sess.c:476:9: Call 474. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 475. { 476. return remove_session_lock(ctx, c, 1); ^ 477. } 478. ssl/ssl_sess.c:479:1: Parameter `ctx->sessions->num_items` 477. } 478. 479. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck) 480. { 481. SSL_SESSION *r; ssl/ssl_sess.c:490:21: Call 488. { 489. ret=1; 490. r=(SSL_SESSION *)lh_delete(ctx->sessions,c); ^ 491. SSL_SESSION_list_remove(ctx,c); 492. } crypto/lhash/lhash.c:217:1: <LHS trace> 215. } 216. 217. > void *lh_delete(LHASH *lh, const void *data) 218. { 219. unsigned long hash; crypto/lhash/lhash.c:217:1: Parameter `lh->num_items` 215. } 216. 217. > void *lh_delete(LHASH *lh, const void *data) 218. { 219. unsigned long hash; crypto/lhash/lhash.c:240:2: Binary operation: ([0, s->ctx->sessions->num_items] - 1):unsigned64 by call to `ssl3_check_cert_and_algorithm` 238. } 239. 240. lh->num_items--; ^ 241. if ((lh->num_nodes > MIN_NODES) && 242. (lh->down_load >= (lh->num_items*LH_LOAD_MULT/lh->num_nodes)))
https://github.com/openssl/openssl/blob/ceb12d3074849e3e01e1b64b6512eb2ade325807/crypto/lhash/lhash.c/#L240
d2a_code_trace_data_44203
int ASYNC_start_job(ASYNC_JOB **job, int *ret, int (*func)(void *), void *args, size_t size) { if (async_get_ctx() == NULL && async_ctx_new() == NULL) { return ASYNC_ERR; } if (*job) { async_get_ctx()->currjob = *job; } for (;;) { if (async_get_ctx()->currjob != NULL) { if (async_get_ctx()->currjob->status == ASYNC_JOB_STOPPING) { *ret = async_get_ctx()->currjob->ret; async_release_job(async_get_ctx()->currjob); async_get_ctx()->currjob = NULL; *job = NULL; return ASYNC_FINISH; } if (async_get_ctx()->currjob->status == ASYNC_JOB_PAUSING) { *job = async_get_ctx()->currjob; async_get_ctx()->currjob->status = ASYNC_JOB_PAUSED; async_get_ctx()->currjob = NULL; return ASYNC_PAUSE; } if (async_get_ctx()->currjob->status == ASYNC_JOB_PAUSED) { async_get_ctx()->currjob = *job; if (!async_fibre_swapcontext(&async_get_ctx()->dispatcher, &async_get_ctx()->currjob->fibrectx, 1)) { ASYNCerr(ASYNC_F_ASYNC_START_JOB, ASYNC_R_FAILED_TO_SWAP_CONTEXT); goto err; } continue; } ASYNCerr(ASYNC_F_ASYNC_START_JOB, ERR_R_INTERNAL_ERROR); async_release_job(async_get_ctx()->currjob); async_get_ctx()->currjob = NULL; *job = NULL; return ASYNC_ERR; } if ((async_get_ctx()->currjob = async_get_pool_job()) == NULL) { return ASYNC_NO_JOBS; } if (args != NULL) { async_get_ctx()->currjob->funcargs = OPENSSL_malloc(size); if (async_get_ctx()->currjob->funcargs == NULL) { ASYNCerr(ASYNC_F_ASYNC_START_JOB, ERR_R_MALLOC_FAILURE); async_release_job(async_get_ctx()->currjob); async_get_ctx()->currjob = NULL; return ASYNC_ERR; } memcpy(async_get_ctx()->currjob->funcargs, args, size); } else { async_get_ctx()->currjob->funcargs = NULL; } async_get_ctx()->currjob->func = func; if (!async_fibre_swapcontext(&async_get_ctx()->dispatcher, &async_get_ctx()->currjob->fibrectx, 1)) { ASYNCerr(ASYNC_F_ASYNC_START_JOB, ASYNC_R_FAILED_TO_SWAP_CONTEXT); goto err; } } err: async_release_job(async_get_ctx()->currjob); async_get_ctx()->currjob = NULL; *job = NULL; return ASYNC_ERR; } crypto/async/async.c:217: error: MEMORY_LEAK memory dynamically allocated by call to `async_ctx_new()` at line 217, column 36 is not reachable after line 217, column 36. Showing all 22 steps of the trace crypto/async/async.c:214:1: start of procedure ASYNC_start_job() 212. } 213. 214. > int ASYNC_start_job(ASYNC_JOB **job, int *ret, int (*func)(void *), 215. void *args, size_t size) 216. { crypto/async/async.c:217:9: Taking true branch 215. void *args, size_t size) 216. { 217. if (async_get_ctx() == NULL && async_ctx_new() == NULL) { ^ 218. return ASYNC_ERR; 219. } crypto/async/async.c:217:36: 215. void *args, size_t size) 216. { 217. > if (async_get_ctx() == NULL && async_ctx_new() == NULL) { 218. return ASYNC_ERR; 219. } crypto/async/async.c:75:1: start of procedure async_ctx_new() 73. static void async_free_pool_internal(async_pool *pool); 74. 75. > static async_ctx *async_ctx_new(void) 76. { 77. async_ctx *nctx = NULL; crypto/async/async.c:77:5: 75. static async_ctx *async_ctx_new(void) 76. { 77. > async_ctx *nctx = NULL; 78. 79. nctx = OPENSSL_malloc(sizeof (async_ctx)); crypto/async/async.c:79:5: 77. async_ctx *nctx = NULL; 78. 79. > nctx = OPENSSL_malloc(sizeof (async_ctx)); 80. if (nctx == NULL) { 81. ASYNCerr(ASYNC_F_ASYNC_CTX_NEW, 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/async/async.c:80:9: Taking false branch 78. 79. nctx = OPENSSL_malloc(sizeof (async_ctx)); 80. if (nctx == NULL) { ^ 81. ASYNCerr(ASYNC_F_ASYNC_CTX_NEW, ERR_R_MALLOC_FAILURE); 82. goto err; crypto/async/async.c:86:5: 84. 85. async_fibre_init_dispatcher(&nctx->dispatcher); 86. > nctx->currjob = NULL; 87. nctx->blocked = 0; 88. if (!async_set_ctx(nctx)) crypto/async/async.c:87:5: 85. async_fibre_init_dispatcher(&nctx->dispatcher); 86. nctx->currjob = NULL; 87. > nctx->blocked = 0; 88. if (!async_set_ctx(nctx)) 89. goto err; crypto/async/async.c:88:10: Taking false branch 86. nctx->currjob = NULL; 87. nctx->blocked = 0; 88. if (!async_set_ctx(nctx)) ^ 89. goto err; 90. crypto/async/async.c:91:5: 89. goto err; 90. 91. > return nctx; 92. err: 93. OPENSSL_free(nctx); crypto/async/async.c:96:1: return from a call to async_ctx_new 94. 95. return NULL; 96. > } 97. 98. static int async_ctx_free(void) crypto/async/async.c:217:36: Taking false branch 215. void *args, size_t size) 216. { 217. if (async_get_ctx() == NULL && async_ctx_new() == NULL) { ^ 218. return ASYNC_ERR; 219. }
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/crypto/async/async.c/#L217
d2a_code_trace_data_44204
static void dca_downmix(float **samples, int srcfmt, int lfe_present, float coef[DCA_PRIM_CHANNELS_MAX + 1][2], const int8_t *channel_mapping) { int c, l, r, sl, sr, s; int i; float t, u, v; switch (srcfmt) { case DCA_MONO: case DCA_4F2R: av_log(NULL, 0, "Not implemented!\n"); break; case DCA_CHANNEL: case DCA_STEREO: case DCA_STEREO_TOTAL: case DCA_STEREO_SUMDIFF: break; case DCA_3F: c = channel_mapping[0]; l = channel_mapping[1]; r = channel_mapping[2]; DOWNMIX_TO_STEREO(MIX_FRONT3(samples, coef), ); break; case DCA_2F1R: s = channel_mapping[2]; DOWNMIX_TO_STEREO(MIX_REAR1(samples, s, 2, coef), ); break; case DCA_3F1R: c = channel_mapping[0]; l = channel_mapping[1]; r = channel_mapping[2]; s = channel_mapping[3]; DOWNMIX_TO_STEREO(MIX_FRONT3(samples, coef), MIX_REAR1(samples, s, 3, coef)); break; case DCA_2F2R: sl = channel_mapping[2]; sr = channel_mapping[3]; DOWNMIX_TO_STEREO(MIX_REAR2(samples, sl, sr, 2, coef), ); break; case DCA_3F2R: c = channel_mapping[0]; l = channel_mapping[1]; r = channel_mapping[2]; sl = channel_mapping[3]; sr = channel_mapping[4]; DOWNMIX_TO_STEREO(MIX_FRONT3(samples, coef), MIX_REAR2(samples, sl, sr, 3, coef)); break; } if (lfe_present) { int lf_buf = ff_dca_lfe_index[srcfmt]; int lf_idx = ff_dca_channels[srcfmt]; for (i = 0; i < 256; i++) { samples[0][i] += samples[lf_buf][i] * coef[lf_idx][0]; samples[1][i] += samples[lf_buf][i] * coef[lf_idx][1]; } } } libavcodec/dcadec.c:998: error: Buffer Overrun L2 Offset: [0, 255] Size: 8 by call to `dca_downmix`. libavcodec/dcadec.c:942:1: Parameter `s->samples_chanptr[*]` 940. } 941. 942. static int dca_filter_channels(DCAContext *s, int block_index, int upsample) ^ 943. { 944. int k; libavcodec/dcadec.c:998:9: Call 996. if (s->audio_header.prim_channels + !!s->lfe > 2 && 997. s->avctx->request_channel_layout == AV_CH_LAYOUT_STEREO) { 998. dca_downmix(s->samples_chanptr, s->amode, !!s->lfe, s->downmix_coef, ^ 999. s->channel_order_tab); 1000. } libavcodec/dcadec.c:722:9: <Offset trace> 720. l = channel_mapping[1]; 721. r = channel_mapping[2]; 722. DOWNMIX_TO_STEREO(MIX_FRONT3(samples, coef), ); ^ 723. break; 724. case DCA_2F1R: libavcodec/dcadec.c:722:9: Assignment 720. l = channel_mapping[1]; 721. r = channel_mapping[2]; 722. DOWNMIX_TO_STEREO(MIX_FRONT3(samples, coef), ); ^ 723. break; 724. case DCA_2F1R: libavcodec/dcadec.c:700:1: <Length trace> 698. } 699. 700. static void dca_downmix(float **samples, int srcfmt, int lfe_present, ^ 701. float coef[DCA_PRIM_CHANNELS_MAX + 1][2], 702. const int8_t *channel_mapping) libavcodec/dcadec.c:700:1: Parameter `**samples` 698. } 699. 700. static void dca_downmix(float **samples, int srcfmt, int lfe_present, ^ 701. float coef[DCA_PRIM_CHANNELS_MAX + 1][2], 702. const int8_t *channel_mapping) libavcodec/dcadec.c:722:9: Array access: Offset: [0, 255] Size: 8 by call to `dca_downmix` 720. l = channel_mapping[1]; 721. r = channel_mapping[2]; 722. DOWNMIX_TO_STEREO(MIX_FRONT3(samples, coef), ); ^ 723. break; 724. case DCA_2F1R:
https://github.com/libav/libav/blob/c1aac39eaccd32dc3b74ccfcce701d3d888fbc6b/libavcodec/dcadec.c/#L722
d2a_code_trace_data_44205
static int decode_residual(H264Context *h, GetBitContext *gb, DCTELEM *block, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff){ MpegEncContext * const s = &h->s; static const int coeff_token_table_index[17]= {0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3}; int level[16]; int zeros_left, coeff_num, coeff_token, total_coeff, i, j, trailing_ones, run_before; if(n == CHROMA_DC_BLOCK_INDEX){ coeff_token= get_vlc2(gb, chroma_dc_coeff_token_vlc.table, CHROMA_DC_COEFF_TOKEN_VLC_BITS, 1); total_coeff= coeff_token>>2; }else{ if(n == LUMA_DC_BLOCK_INDEX){ total_coeff= pred_non_zero_count(h, 0); coeff_token= get_vlc2(gb, coeff_token_vlc[ coeff_token_table_index[total_coeff] ].table, COEFF_TOKEN_VLC_BITS, 2); total_coeff= coeff_token>>2; }else{ total_coeff= pred_non_zero_count(h, n); coeff_token= get_vlc2(gb, coeff_token_vlc[ coeff_token_table_index[total_coeff] ].table, COEFF_TOKEN_VLC_BITS, 2); total_coeff= coeff_token>>2; h->non_zero_count_cache[ scan8[n] ]= total_coeff; } } if(total_coeff==0) return 0; if(total_coeff > (unsigned)max_coeff) { av_log(h->s.avctx, AV_LOG_ERROR, "corrupted macroblock %d %d (total_coeff=%d)\n", s->mb_x, s->mb_y, total_coeff); return -1; } trailing_ones= coeff_token&3; tprintf(h->s.avctx, "trailing:%d, total:%d\n", trailing_ones, total_coeff); assert(total_coeff<=16); for(i=0; i<trailing_ones; i++){ level[i]= 1 - 2*get_bits1(gb); } if(i<total_coeff) { int level_code, mask; int suffix_length = total_coeff > 10 && trailing_ones < 3; int prefix= get_level_prefix(gb); if(prefix<14){ if(suffix_length) level_code= (prefix<<suffix_length) + get_bits(gb, suffix_length); else level_code= (prefix<<suffix_length); }else if(prefix==14){ if(suffix_length) level_code= (prefix<<suffix_length) + get_bits(gb, suffix_length); else level_code= prefix + get_bits(gb, 4); }else if(prefix==15){ level_code= (prefix<<suffix_length) + get_bits(gb, 12); if(suffix_length==0) level_code+=15; }else{ av_log(h->s.avctx, AV_LOG_ERROR, "prefix too large at %d %d\n", s->mb_x, s->mb_y); return -1; } if(trailing_ones < 3) level_code += 2; suffix_length = 1; if(level_code > 5) suffix_length++; mask= -(level_code&1); level[i]= (((2+level_code)>>1) ^ mask) - mask; i++; for(;i<total_coeff;i++) { static const int suffix_limit[7] = {0,5,11,23,47,95,INT_MAX }; prefix = get_level_prefix(gb); if(prefix<15){ level_code = (prefix<<suffix_length) + get_bits(gb, suffix_length); }else if(prefix==15){ level_code = (prefix<<suffix_length) + get_bits(gb, 12); }else{ av_log(h->s.avctx, AV_LOG_ERROR, "prefix too large at %d %d\n", s->mb_x, s->mb_y); return -1; } mask= -(level_code&1); level[i]= (((2+level_code)>>1) ^ mask) - mask; if(level_code > suffix_limit[suffix_length]) suffix_length++; } } if(total_coeff == max_coeff) zeros_left=0; else{ if(n == CHROMA_DC_BLOCK_INDEX) zeros_left= get_vlc2(gb, chroma_dc_total_zeros_vlc[ total_coeff-1 ].table, CHROMA_DC_TOTAL_ZEROS_VLC_BITS, 1); else zeros_left= get_vlc2(gb, total_zeros_vlc[ total_coeff-1 ].table, TOTAL_ZEROS_VLC_BITS, 1); } coeff_num = zeros_left + total_coeff - 1; j = scantable[coeff_num]; if(n > 24){ block[j] = level[0]; for(i=1;i<total_coeff;i++) { if(zeros_left <= 0) run_before = 0; else if(zeros_left < 7){ run_before= get_vlc2(gb, run_vlc[zeros_left-1].table, RUN_VLC_BITS, 1); }else{ run_before= get_vlc2(gb, run7_vlc.table, RUN7_VLC_BITS, 2); } zeros_left -= run_before; coeff_num -= 1 + run_before; j= scantable[ coeff_num ]; block[j]= level[i]; } }else{ block[j] = (level[0] * qmul[j] + 32)>>6; for(i=1;i<total_coeff;i++) { if(zeros_left <= 0) run_before = 0; else if(zeros_left < 7){ run_before= get_vlc2(gb, run_vlc[zeros_left-1].table, RUN_VLC_BITS, 1); }else{ run_before= get_vlc2(gb, run7_vlc.table, RUN7_VLC_BITS, 2); } zeros_left -= run_before; coeff_num -= 1 + run_before; j= scantable[ coeff_num ]; block[j]= (level[i] * qmul[j] + 32)>>6; } } if(zeros_left<0){ av_log(h->s.avctx, AV_LOG_ERROR, "negative number of zero coeffs at %d %d\n", s->mb_x, s->mb_y); return -1; } return 0; } libavcodec/h264.c:4413: error: Uninitialized Value The value read from level[_] was never initialized. libavcodec/h264.c:4413:13: 4411. j= scantable[ coeff_num ]; 4412. 4413. block[j]= level[i]; ^ 4414. } 4415. }else{
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/h264.c/#L4413
d2a_code_trace_data_44206
static int mkv_add_seekhead_entry(mkv_seekhead *seekhead, unsigned int elementid, uint64_t filepos) { int err; if (seekhead->max_entries > 0 && seekhead->max_entries <= seekhead->num_entries) return -1; if ((err = av_reallocp_array(&seekhead->entries, seekhead->num_entries + 1, sizeof(*seekhead->entries))) < 0) { seekhead->num_entries = 0; return err; } seekhead->entries[seekhead->num_entries].elementid = elementid; seekhead->entries[seekhead->num_entries++].segmentpos = filepos - seekhead->segment_offset; return 0; } libavformat/matroskaenc.c:309: error: Null Dereference pointer `seekhead->entries` last assigned on line 303 could be null and is dereferenced at line 309, column 5. libavformat/matroskaenc.c:295:1: start of procedure mkv_add_seekhead_entry() 293. } 294. 295. static int mkv_add_seekhead_entry(mkv_seekhead *seekhead, unsigned int elementid, uint64_t filepos) ^ 296. { 297. int err; libavformat/matroskaenc.c:300:9: Taking true branch 298. 299. // don't store more elements than we reserved space for 300. if (seekhead->max_entries > 0 && seekhead->max_entries <= seekhead->num_entries) ^ 301. return -1; 302. libavformat/matroskaenc.c:300:38: Taking false branch 298. 299. // don't store more elements than we reserved space for 300. if (seekhead->max_entries > 0 && seekhead->max_entries <= seekhead->num_entries) ^ 301. return -1; 302. libavformat/matroskaenc.c:303:9: 301. return -1; 302. 303. if ((err = av_reallocp_array(&seekhead->entries, seekhead->num_entries + 1, ^ 304. sizeof(*seekhead->entries))) < 0) { 305. seekhead->num_entries = 0; libavutil/mem.c:146:1: start of procedure av_reallocp_array() 144. } 145. 146. int av_reallocp_array(void *ptr, size_t nmemb, size_t size) ^ 147. { 148. void **ptrptr = ptr; libavutil/mem.c:148:5: 146. int av_reallocp_array(void *ptr, size_t nmemb, size_t size) 147. { 148. void **ptrptr = ptr; ^ 149. void *ret; 150. if (!size || nmemb >= INT_MAX / size) libavutil/mem.c:150:10: Taking false branch 148. void **ptrptr = ptr; 149. void *ret; 150. if (!size || nmemb >= INT_MAX / size) ^ 151. return AVERROR(ENOMEM); 152. if (!nmemb) { libavutil/mem.c:150:18: Taking false branch 148. void **ptrptr = ptr; 149. void *ret; 150. if (!size || nmemb >= INT_MAX / size) ^ 151. return AVERROR(ENOMEM); 152. if (!nmemb) { libavutil/mem.c:152:10: Taking true branch 150. if (!size || nmemb >= INT_MAX / size) 151. return AVERROR(ENOMEM); 152. if (!nmemb) { ^ 153. av_freep(ptr); 154. return 0; libavutil/mem.c:153:9: 151. return AVERROR(ENOMEM); 152. if (!nmemb) { 153. av_freep(ptr); ^ 154. return 0; 155. } libavutil/mem.c:177:1: start of procedure av_freep() 175. } 176. 177. void av_freep(void *arg) ^ 178. { 179. void **ptr = (void **)arg; libavutil/mem.c:179:5: 177. void av_freep(void *arg) 178. { 179. void **ptr = (void **)arg; ^ 180. av_free(*ptr); 181. *ptr = NULL; libavutil/mem.c:180:5: 178. { 179. void **ptr = (void **)arg; 180. av_free(*ptr); ^ 181. *ptr = NULL; 182. } libavutil/mem.c:165:1: start of procedure av_free() 163. } 164. 165. void av_free(void *ptr) ^ 166. { 167. #if CONFIG_MEMALIGN_HACK libavutil/mem.c:173:5: 171. _aligned_free(ptr); 172. #else 173. free(ptr); ^ 174. #endif 175. } libavutil/mem.c:175:1: return from a call to av_free 173. free(ptr); 174. #endif 175. } ^ 176. 177. void av_freep(void *arg) libavutil/mem.c:181:5: 179. void **ptr = (void **)arg; 180. av_free(*ptr); 181. *ptr = NULL; ^ 182. } 183. libavutil/mem.c:182:1: return from a call to av_freep 180. av_free(*ptr); 181. *ptr = NULL; 182. } ^ 183. 184. void *av_mallocz(size_t size) libavutil/mem.c:154:9: 152. if (!nmemb) { 153. av_freep(ptr); 154. return 0; ^ 155. } 156. ret = av_realloc(*ptrptr, nmemb * size); libavutil/mem.c:163:1: return from a call to av_reallocp_array 161. *ptrptr = ret; 162. return 0; 163. } ^ 164. 165. void av_free(void *ptr) libavformat/matroskaenc.c:303:9: Taking false branch 301. return -1; 302. 303. if ((err = av_reallocp_array(&seekhead->entries, seekhead->num_entries + 1, ^ 304. sizeof(*seekhead->entries))) < 0) { 305. seekhead->num_entries = 0; libavformat/matroskaenc.c:309:5: 307. } 308. 309. seekhead->entries[seekhead->num_entries].elementid = elementid; ^ 310. seekhead->entries[seekhead->num_entries++].segmentpos = filepos - seekhead->segment_offset; 311.
https://github.com/libav/libav/blob/00a63bfb87af6cf7bcdf85848830a90c7e052d41/libavformat/matroskaenc.c/#L309
d2a_code_trace_data_44207
static int hwcrhk_insert_card(const char *prompt_info, const char *wrong_info, HWCryptoHook_PassphraseContext *ppctx, HWCryptoHook_CallerContext *cactx) { int ok = -1; UI *ui; void *callback_data = NULL; UI_METHOD *ui_method = NULL; if (cactx) { if (cactx->ui_method) ui_method = cactx->ui_method; if (cactx->callback_data) callback_data = cactx->callback_data; } if (ppctx) { if (ppctx->ui_method) ui_method = ppctx->ui_method; if (ppctx->callback_data) callback_data = ppctx->callback_data; } if (ui_method == NULL) { HWCRHKerr(HWCRHK_F_HWCRHK_INSERT_CARD, HWCRHK_R_NO_CALLBACK); return -1; } ui = UI_new_method(ui_method); if (ui) { char answer; char buf[BUFSIZ]; if (wrong_info) BIO_snprintf(buf, sizeof(buf)-1, "Current card: \"%s\"\n", wrong_info); ok = UI_dup_info_string(ui, buf); if (ok >= 0 && prompt_info) { BIO_snprintf(buf, sizeof(buf)-1, "Insert card \"%s\"", prompt_info); ok = UI_dup_input_boolean(ui, buf, "\n then hit <enter> or C<enter> to cancel\n", "\r\n", "Cc", UI_INPUT_FLAG_ECHO, &answer); } UI_add_user_data(ui, callback_data); if (ok >= 0) ok = UI_process(ui); UI_free(ui); if (ok == -2 || (ok >= 0 && answer == 'C')) ok = 1; else if (ok < 0) ok = -1; else ok = 0; } return ok; } crypto/engine/hw_ncipher.c:1330: error: UNINITIALIZED_VALUE The value read from answer was never initialized. Showing all 1 steps of the trace crypto/engine/hw_ncipher.c:1330:31: 1328. UI_free(ui); 1329. 1330. > if (ok == -2 || (ok >= 0 && answer == 'C')) 1331. ok = 1; 1332. else if (ok < 0)
https://github.com/openssl/openssl/blob/5b46eee0f552012fd13ff469f0d81ae158f77fd1/crypto/engine/hw_ncipher.c/#L1330
d2a_code_trace_data_44208
int ssl3_get_cert_verify(SSL *s) { EVP_PKEY *pkey = NULL; unsigned char *sig, *data; int al, ok, ret = 0; long n; int type = 0, i, j; unsigned int len; X509 *peer; const EVP_MD *md = NULL; EVP_MD_CTX mctx; PACKET pkt; EVP_MD_CTX_init(&mctx); if (s->session->peer == NULL) { ret = 1; goto end; } n = s->method->ssl_get_message(s, SSL3_ST_SR_CERT_VRFY_A, SSL3_ST_SR_CERT_VRFY_B, SSL3_MT_CERTIFICATE_VERIFY, SSL3_RT_MAX_PLAIN_LENGTH, &ok); if (!ok) return ((int)n); peer = s->session->peer; pkey = X509_get_pubkey(peer); type = X509_certificate_type(peer, pkey); if (!(type & EVP_PKT_SIGN)) { SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE); al = SSL_AD_ILLEGAL_PARAMETER; goto f_err; } if (!PACKET_buf_init(&pkt, s->init_msg, n)) { SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, ERR_R_INTERNAL_ERROR); al = SSL_AD_INTERNAL_ERROR; goto f_err; } if (n == 64 && pkey->type == NID_id_GostR3410_2001) { len = 64; } else { if (SSL_USE_SIGALGS(s)) { int rv; if (!PACKET_get_bytes(&pkt, &sig, 2)) { al = SSL_AD_DECODE_ERROR; goto f_err; } rv = tls12_check_peer_sigalg(&md, s, sig, pkey); if (rv == -1) { al = SSL_AD_INTERNAL_ERROR; goto f_err; } else if (rv == 0) { al = SSL_AD_DECODE_ERROR; goto f_err; } #ifdef SSL_DEBUG fprintf(stderr, "USING TLSv1.2 HASH %s\n", EVP_MD_name(md)); #endif } if (!PACKET_get_net_2(&pkt, &len)) { SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, SSL_R_LENGTH_MISMATCH); al = SSL_AD_DECODE_ERROR; goto f_err; } } j = EVP_PKEY_size(pkey); if (((int)len > j) || ((int)PACKET_remaining(&pkt) > j) || (n <= 0)) { SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, SSL_R_WRONG_SIGNATURE_SIZE); al = SSL_AD_DECODE_ERROR; goto f_err; } if (!PACKET_get_bytes(&pkt, &data, len)) { SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, SSL_R_LENGTH_MISMATCH); al = SSL_AD_DECODE_ERROR; goto f_err; } if (SSL_USE_SIGALGS(s)) { long hdatalen = 0; void *hdata; hdatalen = BIO_get_mem_data(s->s3->handshake_buffer, &hdata); if (hdatalen <= 0) { SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, ERR_R_INTERNAL_ERROR); al = SSL_AD_INTERNAL_ERROR; goto f_err; } #ifdef SSL_DEBUG fprintf(stderr, "Using TLS 1.2 with client verify alg %s\n", EVP_MD_name(md)); #endif if (!EVP_VerifyInit_ex(&mctx, md, NULL) || !EVP_VerifyUpdate(&mctx, hdata, hdatalen)) { SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, ERR_R_EVP_LIB); al = SSL_AD_INTERNAL_ERROR; goto f_err; } if (EVP_VerifyFinal(&mctx, data, len, pkey) <= 0) { al = SSL_AD_DECRYPT_ERROR; SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, SSL_R_BAD_SIGNATURE); goto f_err; } } else #ifndef OPENSSL_NO_RSA if (pkey->type == EVP_PKEY_RSA) { i = RSA_verify(NID_md5_sha1, s->s3->tmp.cert_verify_md, MD5_DIGEST_LENGTH + SHA_DIGEST_LENGTH, data, len, pkey->pkey.rsa); if (i < 0) { al = SSL_AD_DECRYPT_ERROR; SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, SSL_R_BAD_RSA_DECRYPT); goto f_err; } if (i == 0) { al = SSL_AD_DECRYPT_ERROR; SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, SSL_R_BAD_RSA_SIGNATURE); goto f_err; } } else #endif #ifndef OPENSSL_NO_DSA if (pkey->type == EVP_PKEY_DSA) { j = DSA_verify(pkey->save_type, &(s->s3->tmp.cert_verify_md[MD5_DIGEST_LENGTH]), SHA_DIGEST_LENGTH, data, len, pkey->pkey.dsa); if (j <= 0) { al = SSL_AD_DECRYPT_ERROR; SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, SSL_R_BAD_DSA_SIGNATURE); goto f_err; } } else #endif #ifndef OPENSSL_NO_EC if (pkey->type == EVP_PKEY_EC) { j = ECDSA_verify(pkey->save_type, &(s->s3->tmp.cert_verify_md[MD5_DIGEST_LENGTH]), SHA_DIGEST_LENGTH, data, len, pkey->pkey.ec); if (j <= 0) { al = SSL_AD_DECRYPT_ERROR; SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, SSL_R_BAD_ECDSA_SIGNATURE); goto f_err; } } else #endif if (pkey->type == NID_id_GostR3410_2001) { unsigned char signature[64]; int idx; EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new(pkey, NULL); EVP_PKEY_verify_init(pctx); if (len != 64) { fprintf(stderr, "GOST signature length is %d", len); } for (idx = 0; idx < 64; idx++) { signature[63 - idx] = data[idx]; } j = EVP_PKEY_verify(pctx, signature, 64, s->s3->tmp.cert_verify_md, 32); EVP_PKEY_CTX_free(pctx); if (j <= 0) { al = SSL_AD_DECRYPT_ERROR; SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, SSL_R_BAD_ECDSA_SIGNATURE); goto f_err; } } else { SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, ERR_R_INTERNAL_ERROR); al = SSL_AD_UNSUPPORTED_CERTIFICATE; goto f_err; } ret = 1; if (0) { f_err: ssl3_send_alert(s, SSL3_AL_FATAL, al); s->state = SSL_ST_ERR; } end: BIO_free(s->s3->handshake_buffer); s->s3->handshake_buffer = NULL; EVP_MD_CTX_cleanup(&mctx); EVP_PKEY_free(pkey); return (ret); } ssl/s3_srvr.c:2931: error: NULL_DEREFERENCE pointer `pkey` last assigned on line 2910 could be null and is dereferenced at line 2931, column 20. Showing all 34 steps of the trace ssl/s3_srvr.c:2873:1: start of procedure ssl3_get_cert_verify() 2871. } 2872. 2873. > int ssl3_get_cert_verify(SSL *s) 2874. { 2875. EVP_PKEY *pkey = NULL; ssl/s3_srvr.c:2875:5: 2873. int ssl3_get_cert_verify(SSL *s) 2874. { 2875. > EVP_PKEY *pkey = NULL; 2876. unsigned char *sig, *data; 2877. int al, ok, ret = 0; ssl/s3_srvr.c:2877:5: 2875. EVP_PKEY *pkey = NULL; 2876. unsigned char *sig, *data; 2877. > int al, ok, ret = 0; 2878. long n; 2879. int type = 0, i, j; ssl/s3_srvr.c:2879:5: 2877. int al, ok, ret = 0; 2878. long n; 2879. > int type = 0, i, j; 2880. unsigned int len; 2881. X509 *peer; ssl/s3_srvr.c:2882:5: 2880. unsigned int len; 2881. X509 *peer; 2882. > const EVP_MD *md = NULL; 2883. EVP_MD_CTX mctx; 2884. PACKET pkt; ssl/s3_srvr.c:2885:5: 2883. EVP_MD_CTX mctx; 2884. PACKET pkt; 2885. > EVP_MD_CTX_init(&mctx); 2886. 2887. /* crypto/evp/digest.c:120:1: start of procedure EVP_MD_CTX_init() 118. #endif 119. 120. > void EVP_MD_CTX_init(EVP_MD_CTX *ctx) 121. { 122. memset(ctx, 0, sizeof(*ctx)); crypto/evp/digest.c:122:5: 120. void EVP_MD_CTX_init(EVP_MD_CTX *ctx) 121. { 122. > memset(ctx, 0, sizeof(*ctx)); 123. } 124. crypto/evp/digest.c:123:1: return from a call to EVP_MD_CTX_init 121. { 122. memset(ctx, 0, sizeof(*ctx)); 123. > } 124. 125. EVP_MD_CTX *EVP_MD_CTX_create(void) ssl/s3_srvr.c:2895:9: Taking false branch 2893. * CertificateVerify state so we should not arrive here. 2894. */ 2895. if (s->session->peer == NULL) { ^ 2896. ret = 1; 2897. goto end; ssl/s3_srvr.c:2900:5: Skipping __function_pointer__(): unresolved function pointer 2898. } 2899. 2900. n = s->method->ssl_get_message(s, ^ 2901. SSL3_ST_SR_CERT_VRFY_A, 2902. SSL3_ST_SR_CERT_VRFY_B, ssl/s3_srvr.c:2906:10: Taking false branch 2904. SSL3_RT_MAX_PLAIN_LENGTH, &ok); 2905. 2906. if (!ok) ^ 2907. return ((int)n); 2908. ssl/s3_srvr.c:2909:5: 2907. return ((int)n); 2908. 2909. > peer = s->session->peer; 2910. pkey = X509_get_pubkey(peer); 2911. type = X509_certificate_type(peer, pkey); ssl/s3_srvr.c:2910:5: 2908. 2909. peer = s->session->peer; 2910. > pkey = X509_get_pubkey(peer); 2911. type = X509_certificate_type(peer, pkey); 2912. crypto/x509/x509_cmp.c:307:1: start of procedure X509_get_pubkey() 305. } 306. 307. > EVP_PKEY *X509_get_pubkey(X509 *x) 308. { 309. if ((x == NULL) || (x->cert_info == NULL)) crypto/x509/x509_cmp.c:309:10: Taking false branch 307. EVP_PKEY *X509_get_pubkey(X509 *x) 308. { 309. if ((x == NULL) || (x->cert_info == NULL)) ^ 310. return (NULL); 311. return (X509_PUBKEY_get(x->cert_info->key)); crypto/x509/x509_cmp.c:309:25: Taking true branch 307. EVP_PKEY *X509_get_pubkey(X509 *x) 308. { 309. if ((x == NULL) || (x->cert_info == NULL)) ^ 310. return (NULL); 311. return (X509_PUBKEY_get(x->cert_info->key)); crypto/x509/x509_cmp.c:310:9: 308. { 309. if ((x == NULL) || (x->cert_info == NULL)) 310. > return (NULL); 311. return (X509_PUBKEY_get(x->cert_info->key)); 312. } crypto/x509/x509_cmp.c:312:1: return from a call to X509_get_pubkey 310. return (NULL); 311. return (X509_PUBKEY_get(x->cert_info->key)); 312. > } 313. 314. ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x) ssl/s3_srvr.c:2911:5: Skipping X509_certificate_type(): empty list of specs 2909. peer = s->session->peer; 2910. pkey = X509_get_pubkey(peer); 2911. type = X509_certificate_type(peer, pkey); ^ 2912. 2913. if (!(type & EVP_PKT_SIGN)) { ssl/s3_srvr.c:2913:11: Taking false branch 2911. type = X509_certificate_type(peer, pkey); 2912. 2913. if (!(type & EVP_PKT_SIGN)) { ^ 2914. SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, 2915. SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE); ssl/s3_srvr.c:2921:10: 2919. 2920. /* we now have a signature that we need to verify */ 2921. > if (!PACKET_buf_init(&pkt, s->init_msg, n)) { 2922. SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, ERR_R_INTERNAL_ERROR); 2923. al = SSL_AD_INTERNAL_ERROR; ssl/packet_locl.h:106:1: start of procedure PACKET_buf_init() 104. * is being used. 105. */ 106. > static inline int PACKET_buf_init(PACKET *pkt, unsigned char *buf, size_t len) 107. { 108. pkt->start = pkt->curr = buf; ssl/packet_locl.h:108:5: 106. static inline int PACKET_buf_init(PACKET *pkt, unsigned char *buf, size_t len) 107. { 108. > pkt->start = pkt->curr = buf; 109. pkt->end = pkt->start + len; 110. ssl/packet_locl.h:109:5: 107. { 108. pkt->start = pkt->curr = buf; 109. > pkt->end = pkt->start + len; 110. 111. /* Sanity checks */ ssl/packet_locl.h:112:9: Taking false branch 110. 111. /* Sanity checks */ 112. if (pkt->start > pkt->end ^ 113. || pkt->curr < pkt->start 114. || pkt->curr > pkt->end ssl/packet_locl.h:113:16: Taking false branch 111. /* Sanity checks */ 112. if (pkt->start > pkt->end 113. || pkt->curr < pkt->start ^ 114. || pkt->curr > pkt->end 115. || len != (size_t)(pkt->end - pkt->start)) { ssl/packet_locl.h:114:16: Taking false branch 112. if (pkt->start > pkt->end 113. || pkt->curr < pkt->start 114. || pkt->curr > pkt->end ^ 115. || len != (size_t)(pkt->end - pkt->start)) { 116. return 0; ssl/packet_locl.h:115:16: Taking false branch 113. || pkt->curr < pkt->start 114. || pkt->curr > pkt->end 115. || len != (size_t)(pkt->end - pkt->start)) { ^ 116. return 0; 117. } ssl/packet_locl.h:119:5: 117. } 118. 119. > return 1; 120. } 121. ssl/packet_locl.h:120:1: return from a call to PACKET_buf_init 118. 119. return 1; 120. > } 121. 122. /* ssl/s3_srvr.c:2921:10: Taking false branch 2919. 2920. /* we now have a signature that we need to verify */ 2921. if (!PACKET_buf_init(&pkt, s->init_msg, n)) { ^ 2922. SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, ERR_R_INTERNAL_ERROR); 2923. al = SSL_AD_INTERNAL_ERROR; ssl/s3_srvr.c:2931:9: Taking true branch 2929. * length field 2930. */ 2931. if (n == 64 && pkey->type == NID_id_GostR3410_2001) { ^ 2932. len = 64; 2933. } else { ssl/s3_srvr.c:2931:20: 2929. * length field 2930. */ 2931. > if (n == 64 && pkey->type == NID_id_GostR3410_2001) { 2932. len = 64; 2933. } else {
https://github.com/openssl/openssl/blob/208b2d541dcb3b8f62639d2a8cc5771af4ba8755/ssl/s3_srvr.c/#L2931
d2a_code_trace_data_44209
int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) { assert(pkt->subs != NULL && len != 0); if (pkt->subs == NULL || len == 0) return 0; if (pkt->maxsize - pkt->written < len) return 0; if (pkt->buf->length - pkt->written < len) { size_t newlen; size_t reflen; reflen = (len > pkt->buf->length) ? len : pkt->buf->length; if (reflen > SIZE_MAX / 2) { newlen = SIZE_MAX; } else { newlen = reflen * 2; if (newlen < DEFAULT_BUF_SIZE) newlen = DEFAULT_BUF_SIZE; } if (BUF_MEM_grow(pkt->buf, newlen) == 0) return 0; } *allocbytes = (unsigned char *)pkt->buf->data + pkt->curr; pkt->written += len; pkt->curr += len; return 1; } ssl/t1_lib.c:1101: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [0, `s->s3->previous_client_finished_len` + `pkt->written` + `s->srp_ctx.login->strlen` + `s->tlsext_hostname->strlen` + 28]):unsigned64 by call to `WPACKET_put_bytes__`. Showing all 9 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:1101:14: Call 1099. tls1_get_formatlist(s, &pformats, &num_formats); 1100. 1101. if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_ec_point_formats) ^ 1102. /* Sub-packet for formats extension */ 1103. || !WPACKET_start_sub_packet_u16(pkt) ssl/packet.c:242:1: Parameter `pkt->written` 240. } 241. 242. > int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size) 243. { 244. unsigned char *data; ssl/packet.c:250:17: Call 248. 249. if (size > sizeof(unsigned int) 250. || !WPACKET_allocate_bytes(pkt, size, &data) ^ 251. || !put_value(data, val, size)) 252. return 0; ssl/packet.c:15:1: <LHS trace> 13. #define DEFAULT_BUF_SIZE 256 14. 15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. /* Internal API, so should not fail */ ssl/packet.c:15:1: Parameter `pkt->buf->length` 13. #define DEFAULT_BUF_SIZE 256 14. 15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. /* Internal API, so should not fail */ ssl/packet.c:15:1: <RHS trace> 13. #define DEFAULT_BUF_SIZE 256 14. 15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. /* Internal API, so should not fail */ ssl/packet.c:15:1: Parameter `len` 13. #define DEFAULT_BUF_SIZE 256 14. 15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. /* Internal API, so should not fail */ ssl/packet.c:25:9: Binary operation: ([0, +oo] - [0, s->s3->previous_client_finished_len + pkt->written + s->srp_ctx.login->strlen + s->tlsext_hostname->strlen + 28]):unsigned64 by call to `WPACKET_put_bytes__` 23. return 0; 24. 25. if (pkt->buf->length - pkt->written < len) { ^ 26. size_t newlen; 27. size_t reflen;
https://github.com/openssl/openssl/blob/a6972f346248fbc37e42056bb943fae0896a2967/ssl/packet.c/#L25
d2a_code_trace_data_44210
int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm) { char *v; int gmt = 0; int i; int y = 0, M = 0, d = 0, h = 0, m = 0, s = 0; char *f = NULL; int f_len = 0; i = tm->length; v = (char *)tm->data; if (i < 12) goto err; if (v[i - 1] == 'Z') gmt = 1; for (i = 0; i < 12; i++) if ((v[i] > '9') || (v[i] < '0')) goto err; y = (v[0] - '0') * 1000 + (v[1] - '0') * 100 + (v[2] - '0') * 10 + (v[3] - '0'); M = (v[4] - '0') * 10 + (v[5] - '0'); if ((M > 12) || (M < 1)) goto err; d = (v[6] - '0') * 10 + (v[7] - '0'); h = (v[8] - '0') * 10 + (v[9] - '0'); m = (v[10] - '0') * 10 + (v[11] - '0'); if (tm->length >= 14 && (v[12] >= '0') && (v[12] <= '9') && (v[13] >= '0') && (v[13] <= '9')) { s = (v[12] - '0') * 10 + (v[13] - '0'); if (tm->length >= 15 && v[14] == '.') { int l = tm->length; f = &v[14]; f_len = 1; while (14 + f_len < l && f[f_len] >= '0' && f[f_len] <= '9') ++f_len; } } if (BIO_printf(bp, "%s %2d %02d:%02d:%02d%.*s %d%s", _asn1_mon[M - 1], d, h, m, s, f_len, f, y, (gmt) ? " GMT" : "") <= 0) return (0); else return (1); err: BIO_write(bp, "Bad time value", 14); return (0); } crypto/x509/t_crl.c:80: error: BUFFER_OVERRUN_L3 Offset: [-529, +oo] Size: 12 by call to `ASN1_TIME_print`. Showing all 11 steps of the trace crypto/x509/t_crl.c:53:9: Call 51. X509_CRL_get0_signature(x, &sig, &sig_alg); 52. X509_signature_print(out, sig_alg, NULL); 53. p = X509_NAME_oneline(X509_CRL_get_issuer(x), NULL, 0); ^ 54. BIO_printf(out, "%8sIssuer: %s\n", "", p); 55. OPENSSL_free(p); crypto/x509/x509_obj.c:46:9: Assignment 44. if (!BUF_MEM_grow(b, 200)) 45. goto err; 46. b->data[0] = '\0'; ^ 47. len = 200; 48. } else if (len == 0) { crypto/x509/t_crl.c:80:9: Call 78. i2a_ASN1_INTEGER(out, X509_REVOKED_get0_serialNumber(r)); 79. BIO_printf(out, "\n Revocation Date: "); 80. ASN1_TIME_print(out, X509_REVOKED_get0_revocationDate(r)); ^ 81. BIO_printf(out, "\n"); 82. X509V3_extensions_print(out, "CRL entry extensions", crypto/asn1/a_time.c:162:1: Parameter `*tm->data` 160. } 161. 162. > int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm) 163. { 164. if (tm->type == V_ASN1_UTCTIME) crypto/asn1/a_time.c:167:16: Call 165. return ASN1_UTCTIME_print(bp, tm); 166. if (tm->type == V_ASN1_GENERALIZEDTIME) 167. return ASN1_GENERALIZEDTIME_print(bp, tm); ^ 168. BIO_write(bp, "Bad time value", 14); 169. return (0); crypto/asn1/a_gentm.c:223:1: <Offset trace> 221. }; 222. 223. > int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm) 224. { 225. char *v; crypto/asn1/a_gentm.c:223:1: Parameter `*tm->data` 221. }; 222. 223. > int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm) 224. { 225. char *v; crypto/asn1/a_gentm.c:244:5: Assignment 242. y = (v[0] - '0') * 1000 + (v[1] - '0') * 100 243. + (v[2] - '0') * 10 + (v[3] - '0'); 244. M = (v[4] - '0') * 10 + (v[5] - '0'); ^ 245. if ((M > 12) || (M < 1)) 246. goto err; crypto/asn1/a_gentm.c:218:1: <Length trace> 216. } 217. 218. > const char *_asn1_mon[12] = { 219. "Jan", "Feb", "Mar", "Apr", "May", "Jun", 220. "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" crypto/asn1/a_gentm.c:218:1: Array declaration 216. } 217. 218. > const char *_asn1_mon[12] = { 219. "Jan", "Feb", "Mar", "Apr", "May", "Jun", 220. "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" crypto/asn1/a_gentm.c:265:20: Array access: Offset: [-529, +oo] Size: 12 by call to `ASN1_TIME_print` 263. 264. if (BIO_printf(bp, "%s %2d %02d:%02d:%02d%.*s %d%s", 265. _asn1_mon[M - 1], d, h, m, s, f_len, f, y, ^ 266. (gmt) ? " GMT" : "") <= 0) 267. return (0);
https://github.com/openssl/openssl/blob/645c694d85c8f48c74e7db8730ead874656c781e/crypto/asn1/a_gentm.c/#L265
d2a_code_trace_data_44211
int ASYNC_init_thread(size_t max_size, size_t init_size) { async_pool *pool; size_t curr_size = 0; if (init_size > max_size) { ASYNCerr(ASYNC_F_ASYNC_INIT_THREAD, ASYNC_R_INVALID_POOL_SIZE); return 0; } if (!async_local_init()) { ASYNCerr(ASYNC_F_ASYNC_INIT_THREAD, ASYNC_R_INIT_FAILED); return 0; } pool = OPENSSL_zalloc(sizeof *pool); if (pool == NULL) { ASYNCerr(ASYNC_F_ASYNC_INIT_THREAD, ERR_R_MALLOC_FAILURE); return 0; } pool->jobs = sk_ASYNC_JOB_new_null(); if (pool->jobs == NULL) { ASYNCerr(ASYNC_F_ASYNC_INIT_THREAD, ERR_R_MALLOC_FAILURE); OPENSSL_free(pool); return 0; } pool->max_size = max_size; while (init_size--) { ASYNC_JOB *job; job = async_job_new(); if (job == NULL || !async_fibre_makecontext(&job->fibrectx)) { async_job_free(job); break; } job->funcargs = NULL; sk_ASYNC_JOB_push(pool->jobs, job); curr_size++; } pool->curr_size = curr_size; if (!async_set_pool(pool)) { ASYNCerr(ASYNC_F_ASYNC_INIT_THREAD, ASYNC_R_FAILED_TO_SET_POOL); goto err; } return 1; err: async_free_pool_internal(pool); return 0; } crypto/async/async.c:388: error: MEMORY_LEAK memory dynamically allocated by call to `async_job_new()` at line 378, column 15 is not reachable after line 388, column 9. Showing all 207 steps of the trace crypto/async/async.c:346:1: start of procedure ASYNC_init_thread() 344. } 345. 346. > int ASYNC_init_thread(size_t max_size, size_t init_size) 347. { 348. async_pool *pool; crypto/async/async.c:349:5: 347. { 348. async_pool *pool; 349. > size_t curr_size = 0; 350. 351. if (init_size > max_size) { crypto/async/async.c:351:9: Taking false branch 349. size_t curr_size = 0; 350. 351. if (init_size > max_size) { ^ 352. ASYNCerr(ASYNC_F_ASYNC_INIT_THREAD, ASYNC_R_INVALID_POOL_SIZE); 353. return 0; crypto/async/async.c:356:10: 354. } 355. 356. > if (!async_local_init()) { 357. ASYNCerr(ASYNC_F_ASYNC_INIT_THREAD, ASYNC_R_INIT_FAILED); 358. return 0; crypto/async/arch/async_posix.c:76:1: start of procedure async_local_init() 74. } 75. 76. > int async_local_init(void) 77. { 78. if (!async_set_ctx(NULL) || ! async_set_pool(NULL)) crypto/async/arch/async_posix.c:78:10: Taking false branch 76. int async_local_init(void) 77. { 78. if (!async_set_ctx(NULL) || ! async_set_pool(NULL)) ^ 79. return 0; 80. crypto/async/arch/async_posix.c:78:35: Taking false branch 76. int async_local_init(void) 77. { 78. if (!async_set_ctx(NULL) || ! async_set_pool(NULL)) ^ 79. return 0; 80. crypto/async/arch/async_posix.c:81:5: 79. return 0; 80. 81. > return 1; 82. } 83. crypto/async/arch/async_posix.c:82:1: return from a call to async_local_init 80. 81. return 1; 82. > } 83. 84. void async_local_cleanup(void) crypto/async/async.c:356:10: Taking false branch 354. } 355. 356. if (!async_local_init()) { ^ 357. ASYNCerr(ASYNC_F_ASYNC_INIT_THREAD, ASYNC_R_INIT_FAILED); 358. return 0; crypto/async/async.c:360:5: 358. return 0; 359. } 360. > pool = OPENSSL_zalloc(sizeof *pool); 361. if (pool == NULL) { 362. ASYNCerr(ASYNC_F_ASYNC_INIT_THREAD, ERR_R_MALLOC_FAILURE); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/async/async.c:361:9: Taking false branch 359. } 360. pool = OPENSSL_zalloc(sizeof *pool); 361. if (pool == NULL) { ^ 362. ASYNCerr(ASYNC_F_ASYNC_INIT_THREAD, ERR_R_MALLOC_FAILURE); 363. return 0; crypto/async/async.c:366:5: 364. } 365. 366. > pool->jobs = sk_ASYNC_JOB_new_null(); 367. if (pool->jobs == NULL) { 368. ASYNCerr(ASYNC_F_ASYNC_INIT_THREAD, ERR_R_MALLOC_FAILURE); crypto/async/async_locl.h:90:1: start of procedure sk_ASYNC_JOB_new_null() 88. }; 89. 90. > DEFINE_STACK_OF(ASYNC_JOB) 91. 92. struct async_pool_st { crypto/stack/stack.c:145:1: start of procedure sk_new_null() 143. } 144. 145. > _STACK *sk_new_null(void) 146. { 147. return sk_new((int (*)(const void *, const void *))0); crypto/stack/stack.c:147:5: 145. _STACK *sk_new_null(void) 146. { 147. > return sk_new((int (*)(const void *, const void *))0); 148. } 149. crypto/stack/stack.c:150:1: start of procedure sk_new() 148. } 149. 150. > _STACK *sk_new(int (*c) (const void *, const void *)) 151. { 152. _STACK *ret; crypto/stack/stack.c:154:9: 152. _STACK *ret; 153. 154. > if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL) 155. goto err; 156. if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL) crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/stack/stack.c:154:9: Taking false branch 152. _STACK *ret; 153. 154. if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL) ^ 155. goto err; 156. if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL) crypto/stack/stack.c:156:9: 154. if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL) 155. goto err; 156. > if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL) 157. goto err; 158. ret->comp = c; crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/stack/stack.c:156:9: Taking false branch 154. if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL) 155. goto err; 156. if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL) ^ 157. goto err; 158. ret->comp = c; crypto/stack/stack.c:158:5: 156. if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL) 157. goto err; 158. > ret->comp = c; 159. ret->num_alloc = MIN_NODES; 160. return (ret); crypto/stack/stack.c:159:5: 157. goto err; 158. ret->comp = c; 159. > ret->num_alloc = MIN_NODES; 160. return (ret); 161. crypto/stack/stack.c:160:5: 158. ret->comp = c; 159. ret->num_alloc = MIN_NODES; 160. > return (ret); 161. 162. err: crypto/stack/stack.c:165:1: return from a call to sk_new 163. OPENSSL_free(ret); 164. return (NULL); 165. > } 166. 167. int sk_insert(_STACK *st, void *data, int loc) crypto/stack/stack.c:148:1: return from a call to sk_new_null 146. { 147. return sk_new((int (*)(const void *, const void *))0); 148. > } 149. 150. _STACK *sk_new(int (*c) (const void *, const void *)) crypto/async/async_locl.h:90:1: return from a call to sk_ASYNC_JOB_new_null 88. }; 89. 90. > DEFINE_STACK_OF(ASYNC_JOB) 91. 92. struct async_pool_st { crypto/async/async.c:367:9: Taking false branch 365. 366. pool->jobs = sk_ASYNC_JOB_new_null(); 367. if (pool->jobs == NULL) { ^ 368. ASYNCerr(ASYNC_F_ASYNC_INIT_THREAD, ERR_R_MALLOC_FAILURE); 369. OPENSSL_free(pool); crypto/async/async.c:373:5: 371. } 372. 373. > pool->max_size = max_size; 374. 375. /* Pre-create jobs as required */ crypto/async/async.c:376:12: Loop condition is true. Entering loop body 374. 375. /* Pre-create jobs as required */ 376. while (init_size--) { ^ 377. ASYNC_JOB *job; 378. job = async_job_new(); crypto/async/async.c:378:9: 376. while (init_size--) { 377. ASYNC_JOB *job; 378. > job = async_job_new(); 379. if (job == NULL || !async_fibre_makecontext(&job->fibrectx)) { 380. /* crypto/async/async.c:112:1: start of procedure async_job_new() 110. } 111. 112. > static ASYNC_JOB *async_job_new(void) 113. { 114. ASYNC_JOB *job = NULL; crypto/async/async.c:114:5: 112. static ASYNC_JOB *async_job_new(void) 113. { 114. > ASYNC_JOB *job = NULL; 115. OSSL_ASYNC_FD pipefds[2]; 116. crypto/async/async.c:117:5: 115. OSSL_ASYNC_FD pipefds[2]; 116. 117. > job = OPENSSL_malloc(sizeof (ASYNC_JOB)); 118. if (job == NULL) { 119. ASYNCerr(ASYNC_F_ASYNC_JOB_NEW, 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/async/async.c:118:9: Taking false branch 116. 117. job = OPENSSL_malloc(sizeof (ASYNC_JOB)); 118. if (job == NULL) { ^ 119. ASYNCerr(ASYNC_F_ASYNC_JOB_NEW, ERR_R_MALLOC_FAILURE); 120. return NULL; crypto/async/async.c:123:10: 121. } 122. 123. > if (!async_pipe(pipefds)) { 124. OPENSSL_free(job); 125. ASYNCerr(ASYNC_F_ASYNC_JOB_NEW, ASYNC_R_CANNOT_CREATE_WAIT_PIPE); crypto/async/arch/async_posix.c:115:1: start of procedure async_pipe() 113. } 114. 115. > int async_pipe(OSSL_ASYNC_FD *pipefds) 116. { 117. if (pipe(pipefds) == 0) crypto/async/arch/async_posix.c:117:9: Taking true branch 115. int async_pipe(OSSL_ASYNC_FD *pipefds) 116. { 117. if (pipe(pipefds) == 0) ^ 118. return 1; 119. crypto/async/arch/async_posix.c:118:9: 116. { 117. if (pipe(pipefds) == 0) 118. > return 1; 119. 120. return 0; crypto/async/arch/async_posix.c:121:1: return from a call to async_pipe 119. 120. return 0; 121. > } 122. 123. int async_close_fd(OSSL_ASYNC_FD fd) crypto/async/async.c:123:10: Taking false branch 121. } 122. 123. if (!async_pipe(pipefds)) { ^ 124. OPENSSL_free(job); 125. ASYNCerr(ASYNC_F_ASYNC_JOB_NEW, ASYNC_R_CANNOT_CREATE_WAIT_PIPE); crypto/async/async.c:129:5: 127. } 128. 129. > job->wake_set = 0; 130. job->wait_fd = pipefds[0]; 131. job->wake_fd = pipefds[1]; crypto/async/async.c:130:5: 128. 129. job->wake_set = 0; 130. > job->wait_fd = pipefds[0]; 131. job->wake_fd = pipefds[1]; 132. crypto/async/async.c:131:5: 129. job->wake_set = 0; 130. job->wait_fd = pipefds[0]; 131. > job->wake_fd = pipefds[1]; 132. 133. job->status = ASYNC_JOB_RUNNING; crypto/async/async.c:133:5: 131. job->wake_fd = pipefds[1]; 132. 133. > job->status = ASYNC_JOB_RUNNING; 134. job->funcargs = NULL; 135. crypto/async/async.c:134:5: 132. 133. job->status = ASYNC_JOB_RUNNING; 134. > job->funcargs = NULL; 135. 136. return job; crypto/async/async.c:136:5: 134. job->funcargs = NULL; 135. 136. > return job; 137. } 138. crypto/async/async.c:137:1: return from a call to async_job_new 135. 136. return job; 137. > } 138. 139. static void async_job_free(ASYNC_JOB *job) crypto/async/async.c:379:13: Taking false branch 377. ASYNC_JOB *job; 378. job = async_job_new(); 379. if (job == NULL || !async_fibre_makecontext(&job->fibrectx)) { ^ 380. /* 381. * Not actually fatal because we already created the pool, just crypto/async/async.c:379:29: 377. ASYNC_JOB *job; 378. job = async_job_new(); 379. > if (job == NULL || !async_fibre_makecontext(&job->fibrectx)) { 380. /* 381. * Not actually fatal because we already created the pool, just crypto/async/arch/async_posix.c:92:1: start of procedure async_fibre_makecontext() 90. } 91. 92. > int async_fibre_makecontext(async_fibre *fibre) 93. { 94. fibre->env_init = 0; crypto/async/arch/async_posix.c:94:5: 92. int async_fibre_makecontext(async_fibre *fibre) 93. { 94. > fibre->env_init = 0; 95. if (getcontext(&fibre->fibre) == 0) { 96. fibre->fibre.uc_stack.ss_sp = OPENSSL_malloc(STACKSIZE); crypto/async/arch/async_posix.c:95:9: Taking true branch 93. { 94. fibre->env_init = 0; 95. if (getcontext(&fibre->fibre) == 0) { ^ 96. fibre->fibre.uc_stack.ss_sp = OPENSSL_malloc(STACKSIZE); 97. if (fibre->fibre.uc_stack.ss_sp != NULL) { crypto/async/arch/async_posix.c:96:9: 94. fibre->env_init = 0; 95. if (getcontext(&fibre->fibre) == 0) { 96. > fibre->fibre.uc_stack.ss_sp = OPENSSL_malloc(STACKSIZE); 97. if (fibre->fibre.uc_stack.ss_sp != NULL) { 98. fibre->fibre.uc_stack.ss_size = STACKSIZE; 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/async/arch/async_posix.c:97:13: Taking true branch 95. if (getcontext(&fibre->fibre) == 0) { 96. fibre->fibre.uc_stack.ss_sp = OPENSSL_malloc(STACKSIZE); 97. if (fibre->fibre.uc_stack.ss_sp != NULL) { ^ 98. fibre->fibre.uc_stack.ss_size = STACKSIZE; 99. fibre->fibre.uc_link = NULL; crypto/async/arch/async_posix.c:98:13: 96. fibre->fibre.uc_stack.ss_sp = OPENSSL_malloc(STACKSIZE); 97. if (fibre->fibre.uc_stack.ss_sp != NULL) { 98. > fibre->fibre.uc_stack.ss_size = STACKSIZE; 99. fibre->fibre.uc_link = NULL; 100. makecontext(&fibre->fibre, async_start_func, 0); crypto/async/arch/async_posix.c:99:13: 97. if (fibre->fibre.uc_stack.ss_sp != NULL) { 98. fibre->fibre.uc_stack.ss_size = STACKSIZE; 99. > fibre->fibre.uc_link = NULL; 100. makecontext(&fibre->fibre, async_start_func, 0); 101. return 1; crypto/async/arch/async_posix.c:100:13: Skipping makecontext(): method has no implementation 98. fibre->fibre.uc_stack.ss_size = STACKSIZE; 99. fibre->fibre.uc_link = NULL; 100. makecontext(&fibre->fibre, async_start_func, 0); ^ 101. return 1; 102. } crypto/async/arch/async_posix.c:101:13: 99. fibre->fibre.uc_link = NULL; 100. makecontext(&fibre->fibre, async_start_func, 0); 101. > return 1; 102. } 103. } else { crypto/async/arch/async_posix.c:107:1: return from a call to async_fibre_makecontext 105. } 106. return 0; 107. > } 108. 109. void async_fibre_free(async_fibre *fibre) crypto/async/async.c:379:29: Taking false branch 377. ASYNC_JOB *job; 378. job = async_job_new(); 379. if (job == NULL || !async_fibre_makecontext(&job->fibrectx)) { ^ 380. /* 381. * Not actually fatal because we already created the pool, just crypto/async/async.c:387:9: 385. break; 386. } 387. > job->funcargs = NULL; 388. sk_ASYNC_JOB_push(pool->jobs, job); 389. curr_size++; crypto/async/async.c:388:9: 386. } 387. job->funcargs = NULL; 388. > sk_ASYNC_JOB_push(pool->jobs, job); 389. curr_size++; 390. } crypto/async/async_locl.h:90:1: start of procedure sk_ASYNC_JOB_push() 88. }; 89. 90. > DEFINE_STACK_OF(ASYNC_JOB) 91. 92. struct async_pool_st { crypto/stack/stack.c:259:1: start of procedure sk_push() 257. } 258. 259. > int sk_push(_STACK *st, void *data) 260. { 261. return (sk_insert(st, data, st->num)); crypto/stack/stack.c:261:5: 259. int sk_push(_STACK *st, void *data) 260. { 261. > return (sk_insert(st, data, st->num)); 262. } 263. crypto/stack/stack.c:167:1: start of procedure sk_insert() 165. } 166. 167. > int sk_insert(_STACK *st, void *data, int loc) 168. { 169. char **s; crypto/stack/stack.c:171:9: Taking false branch 169. char **s; 170. 171. if (st == NULL) ^ 172. return 0; 173. if (st->num_alloc <= st->num + 1) { crypto/stack/stack.c:173:9: Taking false branch 171. if (st == NULL) 172. return 0; 173. if (st->num_alloc <= st->num + 1) { ^ 174. s = OPENSSL_realloc((char *)st->data, 175. (unsigned int)sizeof(char *) * st->num_alloc * 2); crypto/stack/stack.c:181:10: Taking true branch 179. st->num_alloc *= 2; 180. } 181. if ((loc >= (int)st->num) || (loc < 0)) ^ 182. st->data[st->num] = data; 183. else { crypto/stack/stack.c:182:9: 180. } 181. if ((loc >= (int)st->num) || (loc < 0)) 182. > st->data[st->num] = data; 183. else { 184. memmove(&(st->data[loc + 1]), crypto/stack/stack.c:188:5: 186. st->data[loc] = data; 187. } 188. > st->num++; 189. st->sorted = 0; 190. return (st->num); crypto/stack/stack.c:189:5: 187. } 188. st->num++; 189. > st->sorted = 0; 190. return (st->num); 191. } crypto/stack/stack.c:190:5: 188. st->num++; 189. st->sorted = 0; 190. > return (st->num); 191. } 192. crypto/stack/stack.c:191:1: return from a call to sk_insert 189. st->sorted = 0; 190. return (st->num); 191. > } 192. 193. void *sk_delete_ptr(_STACK *st, void *p) crypto/stack/stack.c:262:1: return from a call to sk_push 260. { 261. return (sk_insert(st, data, st->num)); 262. > } 263. 264. int sk_unshift(_STACK *st, void *data) crypto/async/async_locl.h:90:1: return from a call to sk_ASYNC_JOB_push 88. }; 89. 90. > DEFINE_STACK_OF(ASYNC_JOB) 91. 92. struct async_pool_st { crypto/async/async.c:389:9: 387. job->funcargs = NULL; 388. sk_ASYNC_JOB_push(pool->jobs, job); 389. > curr_size++; 390. } 391. pool->curr_size = curr_size; crypto/async/async.c:376:12: Loop condition is true. Entering loop body 374. 375. /* Pre-create jobs as required */ 376. while (init_size--) { ^ 377. ASYNC_JOB *job; 378. job = async_job_new(); crypto/async/async.c:378:9: 376. while (init_size--) { 377. ASYNC_JOB *job; 378. > job = async_job_new(); 379. if (job == NULL || !async_fibre_makecontext(&job->fibrectx)) { 380. /* crypto/async/async.c:112:1: start of procedure async_job_new() 110. } 111. 112. > static ASYNC_JOB *async_job_new(void) 113. { 114. ASYNC_JOB *job = NULL; crypto/async/async.c:114:5: 112. static ASYNC_JOB *async_job_new(void) 113. { 114. > ASYNC_JOB *job = NULL; 115. OSSL_ASYNC_FD pipefds[2]; 116. crypto/async/async.c:117:5: 115. OSSL_ASYNC_FD pipefds[2]; 116. 117. > job = OPENSSL_malloc(sizeof (ASYNC_JOB)); 118. if (job == NULL) { 119. ASYNCerr(ASYNC_F_ASYNC_JOB_NEW, 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/async/async.c:118:9: Taking false branch 116. 117. job = OPENSSL_malloc(sizeof (ASYNC_JOB)); 118. if (job == NULL) { ^ 119. ASYNCerr(ASYNC_F_ASYNC_JOB_NEW, ERR_R_MALLOC_FAILURE); 120. return NULL; crypto/async/async.c:123:10: 121. } 122. 123. > if (!async_pipe(pipefds)) { 124. OPENSSL_free(job); 125. ASYNCerr(ASYNC_F_ASYNC_JOB_NEW, ASYNC_R_CANNOT_CREATE_WAIT_PIPE); crypto/async/arch/async_posix.c:115:1: start of procedure async_pipe() 113. } 114. 115. > int async_pipe(OSSL_ASYNC_FD *pipefds) 116. { 117. if (pipe(pipefds) == 0) crypto/async/arch/async_posix.c:117:9: Taking true branch 115. int async_pipe(OSSL_ASYNC_FD *pipefds) 116. { 117. if (pipe(pipefds) == 0) ^ 118. return 1; 119. crypto/async/arch/async_posix.c:118:9: 116. { 117. if (pipe(pipefds) == 0) 118. > return 1; 119. 120. return 0; crypto/async/arch/async_posix.c:121:1: return from a call to async_pipe 119. 120. return 0; 121. > } 122. 123. int async_close_fd(OSSL_ASYNC_FD fd) crypto/async/async.c:123:10: Taking false branch 121. } 122. 123. if (!async_pipe(pipefds)) { ^ 124. OPENSSL_free(job); 125. ASYNCerr(ASYNC_F_ASYNC_JOB_NEW, ASYNC_R_CANNOT_CREATE_WAIT_PIPE); crypto/async/async.c:129:5: 127. } 128. 129. > job->wake_set = 0; 130. job->wait_fd = pipefds[0]; 131. job->wake_fd = pipefds[1]; crypto/async/async.c:130:5: 128. 129. job->wake_set = 0; 130. > job->wait_fd = pipefds[0]; 131. job->wake_fd = pipefds[1]; 132. crypto/async/async.c:131:5: 129. job->wake_set = 0; 130. job->wait_fd = pipefds[0]; 131. > job->wake_fd = pipefds[1]; 132. 133. job->status = ASYNC_JOB_RUNNING; crypto/async/async.c:133:5: 131. job->wake_fd = pipefds[1]; 132. 133. > job->status = ASYNC_JOB_RUNNING; 134. job->funcargs = NULL; 135. crypto/async/async.c:134:5: 132. 133. job->status = ASYNC_JOB_RUNNING; 134. > job->funcargs = NULL; 135. 136. return job; crypto/async/async.c:136:5: 134. job->funcargs = NULL; 135. 136. > return job; 137. } 138. crypto/async/async.c:137:1: return from a call to async_job_new 135. 136. return job; 137. > } 138. 139. static void async_job_free(ASYNC_JOB *job) crypto/async/async.c:379:13: Taking false branch 377. ASYNC_JOB *job; 378. job = async_job_new(); 379. if (job == NULL || !async_fibre_makecontext(&job->fibrectx)) { ^ 380. /* 381. * Not actually fatal because we already created the pool, just crypto/async/async.c:379:29: 377. ASYNC_JOB *job; 378. job = async_job_new(); 379. > if (job == NULL || !async_fibre_makecontext(&job->fibrectx)) { 380. /* 381. * Not actually fatal because we already created the pool, just crypto/async/arch/async_posix.c:92:1: start of procedure async_fibre_makecontext() 90. } 91. 92. > int async_fibre_makecontext(async_fibre *fibre) 93. { 94. fibre->env_init = 0; crypto/async/arch/async_posix.c:94:5: 92. int async_fibre_makecontext(async_fibre *fibre) 93. { 94. > fibre->env_init = 0; 95. if (getcontext(&fibre->fibre) == 0) { 96. fibre->fibre.uc_stack.ss_sp = OPENSSL_malloc(STACKSIZE); crypto/async/arch/async_posix.c:95:9: Taking true branch 93. { 94. fibre->env_init = 0; 95. if (getcontext(&fibre->fibre) == 0) { ^ 96. fibre->fibre.uc_stack.ss_sp = OPENSSL_malloc(STACKSIZE); 97. if (fibre->fibre.uc_stack.ss_sp != NULL) { crypto/async/arch/async_posix.c:96:9: 94. fibre->env_init = 0; 95. if (getcontext(&fibre->fibre) == 0) { 96. > fibre->fibre.uc_stack.ss_sp = OPENSSL_malloc(STACKSIZE); 97. if (fibre->fibre.uc_stack.ss_sp != NULL) { 98. fibre->fibre.uc_stack.ss_size = STACKSIZE; 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/async/arch/async_posix.c:97:13: Taking true branch 95. if (getcontext(&fibre->fibre) == 0) { 96. fibre->fibre.uc_stack.ss_sp = OPENSSL_malloc(STACKSIZE); 97. if (fibre->fibre.uc_stack.ss_sp != NULL) { ^ 98. fibre->fibre.uc_stack.ss_size = STACKSIZE; 99. fibre->fibre.uc_link = NULL; crypto/async/arch/async_posix.c:98:13: 96. fibre->fibre.uc_stack.ss_sp = OPENSSL_malloc(STACKSIZE); 97. if (fibre->fibre.uc_stack.ss_sp != NULL) { 98. > fibre->fibre.uc_stack.ss_size = STACKSIZE; 99. fibre->fibre.uc_link = NULL; 100. makecontext(&fibre->fibre, async_start_func, 0); crypto/async/arch/async_posix.c:99:13: 97. if (fibre->fibre.uc_stack.ss_sp != NULL) { 98. fibre->fibre.uc_stack.ss_size = STACKSIZE; 99. > fibre->fibre.uc_link = NULL; 100. makecontext(&fibre->fibre, async_start_func, 0); 101. return 1; crypto/async/arch/async_posix.c:100:13: Skipping makecontext(): method has no implementation 98. fibre->fibre.uc_stack.ss_size = STACKSIZE; 99. fibre->fibre.uc_link = NULL; 100. makecontext(&fibre->fibre, async_start_func, 0); ^ 101. return 1; 102. } crypto/async/arch/async_posix.c:101:13: 99. fibre->fibre.uc_link = NULL; 100. makecontext(&fibre->fibre, async_start_func, 0); 101. > return 1; 102. } 103. } else { crypto/async/arch/async_posix.c:107:1: return from a call to async_fibre_makecontext 105. } 106. return 0; 107. > } 108. 109. void async_fibre_free(async_fibre *fibre) crypto/async/async.c:379:29: Taking false branch 377. ASYNC_JOB *job; 378. job = async_job_new(); 379. if (job == NULL || !async_fibre_makecontext(&job->fibrectx)) { ^ 380. /* 381. * Not actually fatal because we already created the pool, just crypto/async/async.c:387:9: 385. break; 386. } 387. > job->funcargs = NULL; 388. sk_ASYNC_JOB_push(pool->jobs, job); 389. curr_size++; crypto/async/async.c:388:9: 386. } 387. job->funcargs = NULL; 388. > sk_ASYNC_JOB_push(pool->jobs, job); 389. curr_size++; 390. } crypto/async/async_locl.h:90:1: start of procedure sk_ASYNC_JOB_push() 88. }; 89. 90. > DEFINE_STACK_OF(ASYNC_JOB) 91. 92. struct async_pool_st { crypto/stack/stack.c:259:1: start of procedure sk_push() 257. } 258. 259. > int sk_push(_STACK *st, void *data) 260. { 261. return (sk_insert(st, data, st->num)); crypto/stack/stack.c:261:5: 259. int sk_push(_STACK *st, void *data) 260. { 261. > return (sk_insert(st, data, st->num)); 262. } 263. crypto/stack/stack.c:167:1: start of procedure sk_insert() 165. } 166. 167. > int sk_insert(_STACK *st, void *data, int loc) 168. { 169. char **s; crypto/stack/stack.c:171:9: Taking false branch 169. char **s; 170. 171. if (st == NULL) ^ 172. return 0; 173. if (st->num_alloc <= st->num + 1) { crypto/stack/stack.c:173:9: Taking false branch 171. if (st == NULL) 172. return 0; 173. if (st->num_alloc <= st->num + 1) { ^ 174. s = OPENSSL_realloc((char *)st->data, 175. (unsigned int)sizeof(char *) * st->num_alloc * 2); crypto/stack/stack.c:181:10: Taking true branch 179. st->num_alloc *= 2; 180. } 181. if ((loc >= (int)st->num) || (loc < 0)) ^ 182. st->data[st->num] = data; 183. else { crypto/stack/stack.c:182:9: 180. } 181. if ((loc >= (int)st->num) || (loc < 0)) 182. > st->data[st->num] = data; 183. else { 184. memmove(&(st->data[loc + 1]), crypto/stack/stack.c:188:5: 186. st->data[loc] = data; 187. } 188. > st->num++; 189. st->sorted = 0; 190. return (st->num); crypto/stack/stack.c:189:5: 187. } 188. st->num++; 189. > st->sorted = 0; 190. return (st->num); 191. } crypto/stack/stack.c:190:5: 188. st->num++; 189. st->sorted = 0; 190. > return (st->num); 191. } 192. crypto/stack/stack.c:191:1: return from a call to sk_insert 189. st->sorted = 0; 190. return (st->num); 191. > } 192. 193. void *sk_delete_ptr(_STACK *st, void *p) crypto/stack/stack.c:262:1: return from a call to sk_push 260. { 261. return (sk_insert(st, data, st->num)); 262. > } 263. 264. int sk_unshift(_STACK *st, void *data) crypto/async/async_locl.h:90:1: return from a call to sk_ASYNC_JOB_push 88. }; 89. 90. > DEFINE_STACK_OF(ASYNC_JOB) 91. 92. struct async_pool_st {
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/crypto/async/async.c/#L388
d2a_code_trace_data_44212
int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm) { char *v; int gmt = 0; int i; int y = 0, M = 0, d = 0, h = 0, m = 0, s = 0; char *f = NULL; int f_len = 0; i = tm->length; v = (char *)tm->data; if (i < 12) goto err; if (v[i - 1] == 'Z') gmt = 1; for (i = 0; i < 12; i++) if ((v[i] > '9') || (v[i] < '0')) goto err; y = (v[0] - '0') * 1000 + (v[1] - '0') * 100 + (v[2] - '0') * 10 + (v[3] - '0'); M = (v[4] - '0') * 10 + (v[5] - '0'); if ((M > 12) || (M < 1)) goto err; d = (v[6] - '0') * 10 + (v[7] - '0'); h = (v[8] - '0') * 10 + (v[9] - '0'); m = (v[10] - '0') * 10 + (v[11] - '0'); if (tm->length >= 14 && (v[12] >= '0') && (v[12] <= '9') && (v[13] >= '0') && (v[13] <= '9')) { s = (v[12] - '0') * 10 + (v[13] - '0'); if (tm->length >= 15 && v[14] == '.') { int l = tm->length; f = &v[14]; f_len = 1; while (14 + f_len < l && f[f_len] >= '0' && f[f_len] <= '9') ++f_len; } } if (BIO_printf(bp, "%s %2d %02d:%02d:%02d%.*s %d%s", _asn1_mon[M - 1], d, h, m, s, f_len, f, y, (gmt) ? " GMT" : "") <= 0) return (0); else return (1); err: BIO_write(bp, "Bad time value", 14); return (0); } crypto/ocsp/ocsp_prn.c:238: error: BUFFER_OVERRUN_L3 Offset: [-529, +oo] Size: 12 by call to `ASN1_GENERALIZEDTIME_print`. Showing all 11 steps of the trace crypto/ocsp/ocsp_prn.c:217:15: Call 215. 216. i = ASN1_STRING_length(rb->response); 217. if ((br = OCSP_response_get1_basic(o)) == NULL) ^ 218. goto err; 219. rd = &br->tbsResponseData; crypto/ocsp/ocsp_cl.c:204:1: Parameter `*resp->responseBytes->response->data` 202. */ 203. 204. > OCSP_BASICRESP *OCSP_response_get1_basic(OCSP_RESPONSE *resp) 205. { 206. OCSP_RESPBYTES *rb; crypto/ocsp/ocsp_prn.c:220:9: Call 218. goto err; 219. rd = &br->tbsResponseData; 220. l = ASN1_INTEGER_get(rd->version); ^ 221. if (BIO_printf(bp, "\n Version: %lu (0x%lx)\n", l + 1, l) <= 0) 222. goto err; crypto/asn1/a_int.c:608:1: Parameter `*a->data` 606. } 607. 608. > long ASN1_INTEGER_get(const ASN1_INTEGER *a) 609. { 610. int i; crypto/ocsp/ocsp_prn.c:238:10: Call 236. if (BIO_printf(bp, "\n Produced At: ") <= 0) 237. goto err; 238. if (!ASN1_GENERALIZEDTIME_print(bp, rd->producedAt)) ^ 239. goto err; 240. if (BIO_printf(bp, "\n Responses:\n") <= 0) crypto/asn1/a_gentm.c:266:1: <Offset trace> 264. }; 265. 266. > int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm) 267. { 268. char *v; crypto/asn1/a_gentm.c:266:1: Parameter `*tm->data` 264. }; 265. 266. > int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm) 267. { 268. char *v; crypto/asn1/a_gentm.c:287:5: Assignment 285. y = (v[0] - '0') * 1000 + (v[1] - '0') * 100 286. + (v[2] - '0') * 10 + (v[3] - '0'); 287. M = (v[4] - '0') * 10 + (v[5] - '0'); ^ 288. if ((M > 12) || (M < 1)) 289. goto err; crypto/asn1/a_gentm.c:261:1: <Length trace> 259. } 260. 261. > const char *_asn1_mon[12] = { 262. "Jan", "Feb", "Mar", "Apr", "May", "Jun", 263. "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" crypto/asn1/a_gentm.c:261:1: Array declaration 259. } 260. 261. > const char *_asn1_mon[12] = { 262. "Jan", "Feb", "Mar", "Apr", "May", "Jun", 263. "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" crypto/asn1/a_gentm.c:308:20: Array access: Offset: [-529, +oo] Size: 12 by call to `ASN1_GENERALIZEDTIME_print` 306. 307. if (BIO_printf(bp, "%s %2d %02d:%02d:%02d%.*s %d%s", 308. _asn1_mon[M - 1], d, h, m, s, f_len, f, y, ^ 309. (gmt) ? " GMT" : "") <= 0) 310. return (0);
https://github.com/openssl/openssl/blob/1dce6c3f9eef0da2866b82d816dc945883427060/crypto/asn1/a_gentm.c/#L308
d2a_code_trace_data_44213
static void load_module(const char *filename) { void *dll; void (*init_func)(void); dll = dlopen(filename, RTLD_NOW); if (!dll) { fprintf(stderr, "Could not load module '%s' - %s\n", filename, dlerror()); return; } init_func = dlsym(dll, "avserver_module_init"); if (!init_func) { fprintf(stderr, "%s: init function 'avserver_module_init()' not found\n", filename); dlclose(dll); } init_func(); } avserver.c:3931: error: Null Dereference pointer `init_func` last assigned on line 3923 could be null and is dereferenced at line 3931, column 5. avserver.c:3912:1: start of procedure load_module() 3910. 3911. #if HAVE_DLOPEN 3912. static void load_module(const char *filename) ^ 3913. { 3914. void *dll; avserver.c:3916:5: Skipping dlopen(): method has no implementation 3914. void *dll; 3915. void (*init_func)(void); 3916. dll = dlopen(filename, RTLD_NOW); ^ 3917. if (!dll) { 3918. fprintf(stderr, "Could not load module '%s' - %s\n", avserver.c:3917:10: Taking false branch 3915. void (*init_func)(void); 3916. dll = dlopen(filename, RTLD_NOW); 3917. if (!dll) { ^ 3918. fprintf(stderr, "Could not load module '%s' - %s\n", 3919. filename, dlerror()); avserver.c:3923:5: Skipping dlsym(): method has no implementation 3921. } 3922. 3923. init_func = dlsym(dll, "avserver_module_init"); ^ 3924. if (!init_func) { 3925. fprintf(stderr, avserver.c:3924:10: Taking true branch 3922. 3923. init_func = dlsym(dll, "avserver_module_init"); 3924. if (!init_func) { ^ 3925. fprintf(stderr, 3926. "%s: init function 'avserver_module_init()' not found\n", avserver.c:3925:9: 3923. init_func = dlsym(dll, "avserver_module_init"); 3924. if (!init_func) { 3925. fprintf(stderr, ^ 3926. "%s: init function 'avserver_module_init()' not found\n", 3927. filename); avserver.c:3928:9: Skipping dlclose(): method has no implementation 3926. "%s: init function 'avserver_module_init()' not found\n", 3927. filename); 3928. dlclose(dll); ^ 3929. } 3930. avserver.c:3931:5: 3929. } 3930. 3931. init_func(); ^ 3932. } 3933. #endif
https://github.com/libav/libav/blob/e3eb015ba47ace8aff8db18e80d20704e7306b66/avserver.c/#L3931
d2a_code_trace_data_44214
static int auth_suppdata_generate_cb(SSL *s, unsigned short supp_data_type, const unsigned char **out, unsigned short *outlen, void *arg) { if (c_auth && client_provided_client_authz && client_provided_server_authz) { if (!c_auth_require_reneg || (c_auth_require_reneg && SSL_num_renegotiations(s))) { generated_supp_data = OPENSSL_malloc(10); memcpy(generated_supp_data, "1234512345", 10); *out = generated_supp_data; *outlen = 10; return 1; } } return -1; } apps/s_server.c:3637: error: NULL_DEREFERENCE pointer `generated_supp_data` last assigned on line 3636 could be null and is dereferenced by call to `memcpy()` at line 3637, column 4. Showing all 20 steps of the trace apps/s_server.c:3625:1: start of procedure auth_suppdata_generate_cb() 3623. } 3624. 3625. > static int auth_suppdata_generate_cb(SSL *s, unsigned short supp_data_type, 3626. const unsigned char **out, 3627. unsigned short *outlen, void *arg) apps/s_server.c:3629:6: Taking true branch 3627. unsigned short *outlen, void *arg) 3628. { 3629. if (c_auth && client_provided_client_authz && client_provided_server_authz) ^ 3630. { 3631. /*if auth_require_reneg flag is set, only send supplemental data if apps/s_server.c:3629:16: Taking true branch 3627. unsigned short *outlen, void *arg) 3628. { 3629. if (c_auth && client_provided_client_authz && client_provided_server_authz) ^ 3630. { 3631. /*if auth_require_reneg flag is set, only send supplemental data if apps/s_server.c:3629:48: Taking true branch 3627. unsigned short *outlen, void *arg) 3628. { 3629. if (c_auth && client_provided_client_authz && client_provided_server_authz) ^ 3630. { 3631. /*if auth_require_reneg flag is set, only send supplemental data if apps/s_server.c:3633:8: Taking true branch 3631. /*if auth_require_reneg flag is set, only send supplemental data if 3632. renegotiation has occurred */ 3633. if (!c_auth_require_reneg ^ 3634. || (c_auth_require_reneg && SSL_num_renegotiations(s))) 3635. { apps/s_server.c:3636:4: 3634. || (c_auth_require_reneg && SSL_num_renegotiations(s))) 3635. { 3636. > generated_supp_data = OPENSSL_malloc(10); 3637. memcpy(generated_supp_data, "1234512345", 10); 3638. *out = generated_supp_data; crypto/mem.c:295:1: start of procedure CRYPTO_malloc() 293. } 294. 295. > void *CRYPTO_malloc(int num, const char *file, int line) 296. { 297. void *ret = NULL; crypto/mem.c:297:2: 295. void *CRYPTO_malloc(int num, const char *file, int line) 296. { 297. > void *ret = NULL; 298. 299. if (num <= 0) return NULL; crypto/mem.c:299:6: Taking false branch 297. void *ret = NULL; 298. 299. if (num <= 0) return NULL; ^ 300. 301. allow_customize = 0; crypto/mem.c:301:2: 299. if (num <= 0) return NULL; 300. 301. > allow_customize = 0; 302. if (malloc_debug_func != NULL) 303. { crypto/mem.c:302:6: Taking true branch 300. 301. allow_customize = 0; 302. if (malloc_debug_func != NULL) ^ 303. { 304. allow_customize_debug = 0; crypto/mem.c:304:3: 302. if (malloc_debug_func != NULL) 303. { 304. > allow_customize_debug = 0; 305. malloc_debug_func(NULL, num, file, line, 0); 306. } crypto/mem.c:305:3: Skipping __function_pointer__(): unresolved function pointer 303. { 304. allow_customize_debug = 0; 305. malloc_debug_func(NULL, num, file, line, 0); ^ 306. } 307. ret = malloc_ex_func(num,file,line); crypto/mem.c:307:2: Skipping __function_pointer__(): unresolved function pointer 305. malloc_debug_func(NULL, num, file, line, 0); 306. } 307. ret = malloc_ex_func(num,file,line); ^ 308. #ifdef LEVITTE_DEBUG_MEM 309. fprintf(stderr, "LEVITTE_DEBUG_MEM: > 0x%p (%d)\n", ret, num); crypto/mem.c:311:6: Taking true branch 309. fprintf(stderr, "LEVITTE_DEBUG_MEM: > 0x%p (%d)\n", ret, num); 310. #endif 311. if (malloc_debug_func != NULL) ^ 312. malloc_debug_func(ret, num, file, line, 1); 313. crypto/mem.c:312:3: Skipping __function_pointer__(): unresolved function pointer 310. #endif 311. if (malloc_debug_func != NULL) 312. malloc_debug_func(ret, num, file, line, 1); ^ 313. 314. #ifndef OPENSSL_CPUID_OBJ crypto/mem.c:318:12: Taking false branch 316. * sanitisation function can't be optimised out. NB: We only do 317. * this for >2Kb so the overhead doesn't bother us. */ 318. if(ret && (num > 2048)) ^ 319. { extern unsigned char cleanse_ctr; 320. ((unsigned char *)ret)[0] = cleanse_ctr; crypto/mem.c:324:2: 322. #endif 323. 324. > return ret; 325. } 326. char *CRYPTO_strdup(const char *str, const char *file, int line) crypto/mem.c:325:2: return from a call to CRYPTO_malloc 323. 324. return ret; 325. } ^ 326. char *CRYPTO_strdup(const char *str, const char *file, int line) 327. { apps/s_server.c:3637:4: 3635. { 3636. generated_supp_data = OPENSSL_malloc(10); 3637. > memcpy(generated_supp_data, "1234512345", 10); 3638. *out = generated_supp_data; 3639. *outlen = 10;
https://github.com/openssl/openssl/blob/99fb221280045f1ed930e4d9355013b461532913/apps/s_server.c/#L3637
d2a_code_trace_data_44215
static ngx_int_t ngx_parse_unix_domain_url(ngx_pool_t *pool, ngx_url_t *u) { #if (NGX_HAVE_UNIX_DOMAIN) u_char *path, *uri, *last; size_t len; struct sockaddr_un *saun; len = u->url.len; path = u->url.data; path += 5; len -= 5; if (u->uri_part) { last = path + len; uri = ngx_strlchr(path, last, ':'); if (uri) { len = uri - path; uri++; u->uri.len = last - uri; u->uri.data = uri; } } if (len == 0) { u->err = "no path in the unix domain socket"; return NGX_ERROR; } u->host.len = len++; u->host.data = path; if (len > sizeof(saun->sun_path)) { u->err = "too long path in the unix domain socket"; return NGX_ERROR; } u->socklen = sizeof(struct sockaddr_un); saun = (struct sockaddr_un *) &u->sockaddr; saun->sun_family = AF_UNIX; (void) ngx_cpystrn((u_char *) saun->sun_path, path, len); u->addrs = ngx_pcalloc(pool, sizeof(ngx_peer_addr_t)); if (u->addrs == NULL) { return NGX_ERROR; } saun = ngx_pcalloc(pool, sizeof(struct sockaddr_un)); if (saun == NULL) { return NGX_ERROR; } u->family = AF_UNIX; u->naddrs = 1; saun->sun_family = AF_UNIX; (void) ngx_cpystrn((u_char *) saun->sun_path, path, len); u->addrs[0].sockaddr = (struct sockaddr *) saun; u->addrs[0].socklen = sizeof(struct sockaddr_un); u->addrs[0].name.len = len + 4; u->addrs[0].name.data = u->url.data; return NGX_OK; #else u->err = "the unix domain sockets are not supported on this platform"; return NGX_ERROR; #endif } src/http/ngx_http_upstream.c:3674: error: Integer Overflow L2 ([0, +oo] - 5):unsigned64 by call to `ngx_http_upstream_add`. src/http/ngx_http_upstream.c:3674:12: Call 3672. u.no_resolve = 1; 3673. 3674. uscf = ngx_http_upstream_add(cf, &u, NGX_HTTP_UPSTREAM_CREATE ^ 3675. |NGX_HTTP_UPSTREAM_WEIGHT 3676. |NGX_HTTP_UPSTREAM_MAX_FAILS src/http/ngx_http_upstream.c:3902:1: Parameter `u->url.len` 3900. 3901. 3902. ngx_http_upstream_srv_conf_t * ^ 3903. ngx_http_upstream_add(ngx_conf_t *cf, ngx_url_t *u, ngx_uint_t flags) 3904. { src/http/ngx_http_upstream.c:3912:13: Call 3910. if (!(flags & NGX_HTTP_UPSTREAM_CREATE)) { 3911. 3912. if (ngx_parse_url(cf->pool, u) != NGX_OK) { ^ 3913. if (u->err) { 3914. ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, src/core/ngx_inet.c:285:1: Parameter `u->url.len` 283. 284. 285. ngx_int_t ^ 286. ngx_parse_url(ngx_pool_t *pool, ngx_url_t *u) 287. { src/core/ngx_inet.c:293:16: Call 291. 292. if (ngx_strncasecmp(p, (u_char *) "unix:", 5) == 0) { 293. return ngx_parse_unix_domain_url(pool, u); ^ 294. } 295. src/core/ngx_inet.c:309:1: <LHS trace> 307. 308. 309. static ngx_int_t ^ 310. ngx_parse_unix_domain_url(ngx_pool_t *pool, ngx_url_t *u) 311. { src/core/ngx_inet.c:309:1: Parameter `u->url.len` 307. 308. 309. static ngx_int_t ^ 310. ngx_parse_unix_domain_url(ngx_pool_t *pool, ngx_url_t *u) 311. { src/core/ngx_inet.c:317:5: Assignment 315. struct sockaddr_un *saun; 316. 317. len = u->url.len; ^ 318. path = u->url.data; 319. src/core/ngx_inet.c:321:5: Binary operation: ([0, +oo] - 5):unsigned64 by call to `ngx_http_upstream_add` 319. 320. path += 5; 321. len -= 5; ^ 322. 323. if (u->uri_part) {
https://github.com/nginx/nginx/blob/e4ecddfdb0d2ffc872658e36028971ad9a873726/src/core/ngx_inet.c/#L321
d2a_code_trace_data_44216
int RAND_poll(void) { int ret = 0; RAND_POOL *pool = NULL; const RAND_METHOD *meth = RAND_get_rand_method(); if (meth == RAND_OpenSSL()) { RAND_DRBG *drbg = RAND_DRBG_get0_master(); if (drbg == NULL) return 0; rand_drbg_lock(drbg); ret = rand_drbg_restart(drbg, NULL, 0, 0); rand_drbg_unlock(drbg); return ret; } else { pool = rand_pool_new(RAND_DRBG_STRENGTH, RAND_DRBG_STRENGTH / 8, RAND_POOL_MAX_LENGTH); if (pool == NULL) return 0; if (rand_pool_acquire_entropy(pool) == 0) goto err; if (meth->add == NULL || meth->add(rand_pool_buffer(pool), rand_pool_length(pool), (rand_pool_entropy(pool) / 8.0)) == 0) goto err; ret = 1; } err: rand_pool_free(pool); return ret; } crypto/rand/rand_lib.c:409: error: NULL_DEREFERENCE pointer `meth` last assigned on line 383 could be null and is dereferenced at line 409, column 13. Showing all 24 steps of the trace crypto/rand/rand_lib.c:377:1: start of procedure RAND_poll() 375. * configurable via the --with-rand-seed configure option. 376. */ 377. > int RAND_poll(void) 378. { 379. int ret = 0; crypto/rand/rand_lib.c:379:5: 377. int RAND_poll(void) 378. { 379. > int ret = 0; 380. 381. RAND_POOL *pool = NULL; crypto/rand/rand_lib.c:381:5: 379. int ret = 0; 380. 381. > RAND_POOL *pool = NULL; 382. 383. const RAND_METHOD *meth = RAND_get_rand_method(); crypto/rand/rand_lib.c:383:5: 381. RAND_POOL *pool = NULL; 382. 383. > const RAND_METHOD *meth = RAND_get_rand_method(); 384. 385. if (meth == RAND_OpenSSL()) { crypto/rand/rand_lib.c:733:1: start of procedure RAND_get_rand_method() 731. } 732. 733. > const RAND_METHOD *RAND_get_rand_method(void) 734. { 735. const RAND_METHOD *tmp_meth = NULL; crypto/rand/rand_lib.c:735:5: 733. const RAND_METHOD *RAND_get_rand_method(void) 734. { 735. > const RAND_METHOD *tmp_meth = NULL; 736. 737. if (!RUN_ONCE(&rand_init, do_rand_init)) crypto/rand/rand_lib.c:737:10: 735. const RAND_METHOD *tmp_meth = NULL; 736. 737. > if (!RUN_ONCE(&rand_init, do_rand_init)) 738. return NULL; 739. 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:737:10: Condition is false 735. const RAND_METHOD *tmp_meth = NULL; 736. 737. if (!RUN_ONCE(&rand_init, do_rand_init)) ^ 738. return NULL; 739. crypto/rand/rand_lib.c:737:10: Taking true branch 735. const RAND_METHOD *tmp_meth = NULL; 736. 737. if (!RUN_ONCE(&rand_init, do_rand_init)) ^ 738. return NULL; 739. crypto/rand/rand_lib.c:738:9: 736. 737. if (!RUN_ONCE(&rand_init, do_rand_init)) 738. > return NULL; 739. 740. CRYPTO_THREAD_write_lock(rand_meth_lock); crypto/rand/rand_lib.c:761:1: return from a call to RAND_get_rand_method 759. CRYPTO_THREAD_unlock(rand_meth_lock); 760. return tmp_meth; 761. > } 762. 763. #ifndef OPENSSL_NO_ENGINE crypto/rand/rand_lib.c:385:9: 383. const RAND_METHOD *meth = RAND_get_rand_method(); 384. 385. > if (meth == RAND_OpenSSL()) { 386. /* fill random pool and seed the master DRBG */ 387. RAND_DRBG *drbg = RAND_DRBG_get0_master(); crypto/rand/drbg_lib.c:1227:1: start of procedure RAND_OpenSSL() 1225. }; 1226. 1227. > RAND_METHOD *RAND_OpenSSL(void) 1228. { 1229. return &rand_meth; crypto/rand/drbg_lib.c:1229:5: 1227. RAND_METHOD *RAND_OpenSSL(void) 1228. { 1229. > return &rand_meth; 1230. } crypto/rand/drbg_lib.c:1230:1: return from a call to RAND_OpenSSL 1228. { 1229. return &rand_meth; 1230. > } crypto/rand/rand_lib.c:385:9: Taking false branch 383. const RAND_METHOD *meth = RAND_get_rand_method(); 384. 385. if (meth == RAND_OpenSSL()) { ^ 386. /* fill random pool and seed the master DRBG */ 387. RAND_DRBG *drbg = RAND_DRBG_get0_master(); crypto/rand/rand_lib.c:400:9: Skipping rand_pool_new(): empty list of specs 398. } else { 399. /* fill random pool and seed the current legacy RNG */ 400. pool = rand_pool_new(RAND_DRBG_STRENGTH, ^ 401. RAND_DRBG_STRENGTH / 8, 402. RAND_POOL_MAX_LENGTH); crypto/rand/rand_lib.c:403:13: Taking false branch 401. RAND_DRBG_STRENGTH / 8, 402. RAND_POOL_MAX_LENGTH); 403. if (pool == NULL) ^ 404. return 0; 405. crypto/rand/rand_lib.c:406:13: Taking false branch 404. return 0; 405. 406. if (rand_pool_acquire_entropy(pool) == 0) ^ 407. goto err; 408. crypto/rand/rand_lib.c:409:13: 407. goto err; 408. 409. > if (meth->add == NULL 410. || meth->add(rand_pool_buffer(pool), 411. rand_pool_length(pool),
https://github.com/openssl/openssl/blob/1901516a4ba909fff12e0e7815aa2d499f4d6d67/crypto/rand/rand_lib.c/#L409
d2a_code_trace_data_44217
static int parse_oct(const char *t[], PROPERTY_DEFINITION *res) { const char *s = *t; int64_t v = 0; if (*s == '9' || *s == '8' || !ossl_isdigit(*s)) return 0; do { v = (v << 3) + (*s - '0'); } while (ossl_isdigit(*++s) && *s != '9' && *s != '8'); if (!ossl_isspace(*s) && *s != '\0' && *s != ',') { PROPerr(PROP_F_PARSE_OCT, PROP_R_NOT_AN_OCTAL_DIGIT); return 0; } *t = skip_space(s); res->type = PROPERTY_TYPE_NUMBER; res->v.int_val = v; return 1; } test/property_test.c:299: error: BUFFER_OVERRUN_L3 Offset: [2, +oo] (⇐ [1, +oo] + 1) Size: [1, 37] by call to `ossl_method_store_add`. Showing all 23 steps of the trace test/property_test.c:265:9: Array declaration 263. char *impl; 264. } impls[] = { 265. { 1, "fast=no, colour=green", "a" }, ^ 266. { 1, "fast, colour=blue", "b" }, 267. { 1, "", "-" }, test/property_test.c:299:14: Call 297. 298. for (i = 0; i < OSSL_NELEM(impls); i++) 299. if (!TEST_true(ossl_method_store_add(store, impls[i].nid, impls[i].prop, ^ 300. impls[i].impl, NULL))) { 301. TEST_note("iteration %zd", i + 1); crypto/property/property.c:176:1: Parameter `*properties` 174. } 175. 176. > int ossl_method_store_add(OSSL_METHOD_STORE *store, 177. int nid, const char *properties, 178. void *method, void (*method_destruct)(void *)) crypto/property/property.c:205:28: Call 203. ossl_method_cache_flush(store, nid); 204. if ((impl->properties = ossl_prop_defn_get(store->ctx, properties)) == NULL) { 205. impl->properties = ossl_parse_property(store->ctx, properties); ^ 206. if (impl->properties == NULL) 207. goto err; crypto/property/property_parse.c:317:1: Parameter `*defn` 315. } 316. 317. > OSSL_PROPERTY_LIST *ossl_parse_property(OPENSSL_CTX *ctx, const char *defn) 318. { 319. PROPERTY_DEFINITION *prop = NULL; crypto/property/property_parse.c:322:5: Assignment 320. OSSL_PROPERTY_LIST *res = NULL; 321. STACK_OF(PROPERTY_DEFINITION) *sk; 322. const char *s = defn; ^ 323. int done; 324. crypto/property/property_parse.c:328:9: Call 326. return NULL; 327. 328. s = skip_space(s); ^ 329. done = *s == '\0'; 330. while (!done) { crypto/property/property_parse.c:50:1: Parameter `*s` 48. DEFINE_STACK_OF(PROPERTY_DEFINITION) 49. 50. > static const char *skip_space(const char *s) 51. { 52. while (ossl_isspace(*s)) crypto/property/property_parse.c:54:5: Assignment 52. while (ossl_isspace(*s)) 53. s++; 54. return s; ^ 55. } 56. crypto/property/property_parse.c:328:5: Assignment 326. return NULL; 327. 328. s = skip_space(s); ^ 329. done = *s == '\0'; 330. while (!done) { crypto/property/property_parse.c:335:14: Call 333. goto err; 334. memset(&prop->v, 0, sizeof(prop->v)); 335. if (!parse_name(ctx, &s, 1, &prop->name_idx)) ^ 336. goto err; 337. prop->oper = PROPERTY_OPER_EQ; crypto/property/property_parse.c:81:1: Parameter `**t` 79. } 80. 81. > static int parse_name(OPENSSL_CTX *ctx, const char *t[], int create, 82. OSSL_PROPERTY_IDX *idx) 83. { crypto/property/property_parse.c:342:13: Call 340. goto err; 341. } 342. if (match_ch(&s, '=')) { ^ 343. if (!parse_value(ctx, &s, prop, 1)) { 344. PROPerr(PROP_F_OSSL_PARSE_PROPERTY, PROP_R_NO_VALUE); crypto/property/property_parse.c:57:1: Parameter `**t` 55. } 56. 57. > static int match_ch(const char *t[], char m) 58. { 59. const char *s = *t; crypto/property/property_parse.c:343:18: Call 341. } 342. if (match_ch(&s, '=')) { 343. if (!parse_value(ctx, &s, prop, 1)) { ^ 344. PROPerr(PROP_F_OSSL_PARSE_PROPERTY, PROP_R_NO_VALUE); 345. goto err; crypto/property/property_parse.c:245:1: Parameter `**t` 243. } 244. 245. > static int parse_value(OPENSSL_CTX *ctx, const char *t[], 246. PROPERTY_DEFINITION *res, int create) 247. { crypto/property/property_parse.c:248:5: Assignment 246. PROPERTY_DEFINITION *res, int create) 247. { 248. const char *s = *t; ^ 249. int r = 0; 250. crypto/property/property_parse.c:265:9: Assignment 263. r = parse_hex(&s, res); 264. } else if (*s == '0' && ossl_isdigit(s[1])) { 265. s++; ^ 266. r = parse_oct(&s, res); 267. } else if (ossl_isdigit(*s)) { crypto/property/property_parse.c:266:13: Call 264. } else if (*s == '0' && ossl_isdigit(s[1])) { 265. s++; 266. r = parse_oct(&s, res); ^ 267. } else if (ossl_isdigit(*s)) { 268. return parse_number(t, res); crypto/property/property_parse.c:164:1: <Length trace> 162. } 163. 164. > static int parse_oct(const char *t[], PROPERTY_DEFINITION *res) 165. { 166. const char *s = *t; crypto/property/property_parse.c:164:1: Parameter `**t` 162. } 163. 164. > static int parse_oct(const char *t[], PROPERTY_DEFINITION *res) 165. { 166. const char *s = *t; crypto/property/property_parse.c:166:5: Assignment 164. static int parse_oct(const char *t[], PROPERTY_DEFINITION *res) 165. { 166. const char *s = *t; ^ 167. int64_t v = 0; 168. crypto/property/property_parse.c:173:14: Array access: Offset: [2, +oo] (⇐ [1, +oo] + 1) Size: [1, 37] by call to `ossl_method_store_add` 171. do { 172. v = (v << 3) + (*s - '0'); 173. } while (ossl_isdigit(*++s) && *s != '9' && *s != '8'); ^ 174. if (!ossl_isspace(*s) && *s != '\0' && *s != ',') { 175. PROPerr(PROP_F_PARSE_OCT, PROP_R_NOT_AN_OCTAL_DIGIT);
https://github.com/openssl/openssl/blob/260a16f33682a819414fcba6161708a5e6bdff50/crypto/property/property_parse.c/#L173
d2a_code_trace_data_44218
static void BN_POOL_release(BN_POOL *p, unsigned int num) { unsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE; p->used -= num; while (num--) { bn_check_top(p->current->vals + offset); if (offset == 0) { offset = BN_CTX_POOL_SIZE - 1; p->current = p->current->prev; } else offset--; } } crypto/bn/bn_rsa_fips186_4.c:283: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `BN_mod_inverse`. Showing all 41 steps of the trace crypto/bn/bn_rsa_fips186_4.c:280:16: Call 278. if (!(BN_lshift1(r1x2, r1) 279. /* (Step 1) GCD(2r1, r2) = 1 */ 280. && BN_gcd(tmp, r1x2, r2, ctx) ^ 281. && BN_is_one(tmp) 282. /* (Step 2) R = ((r2^-1 mod 2r1) * r2) - ((2r1^-1 mod r2)*2r1) */ crypto/bn/bn_gcd.c:49:5: Call 47. ret = 1; 48. err: 49. BN_CTX_end(ctx); ^ 50. bn_check_top(r); 51. return ret; crypto/bn/bn_ctx.c:185:1: Parameter `ctx->pool.used` 183. } 184. 185. > void BN_CTX_end(BN_CTX *ctx) 186. { 187. CTXDBG("ENTER BN_CTX_end()", ctx); crypto/bn/bn_rsa_fips186_4.c:283:16: Call 281. && BN_is_one(tmp) 282. /* (Step 2) R = ((r2^-1 mod 2r1) * r2) - ((2r1^-1 mod r2)*2r1) */ 283. && BN_mod_inverse(R, r2, r1x2, ctx) ^ 284. && BN_mul(R, R, r2, ctx) /* R = (r2^-1 mod 2r1) * r2 */ 285. && BN_mod_inverse(tmp, r1x2, r2, ctx) crypto/bn/bn_gcd.c:124:1: Parameter `ctx->pool.used` 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->pool.used` 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->pool.used` 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: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->pool.used` 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->pool.used` 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->pool.used` 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->pool.used` 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->pool.used` 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->pool.used` 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->pool.used` 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->pool.used` 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->pool.used` 207. * If 'dv' or 'rm' is NULL, the respective value is not returned. 208. */ 209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 210. BN_CTX *ctx) 211. { crypto/bn/bn_div.c:229:11: Call 227. } 228. 229. ret = bn_div_fixed_top(dv, rm, num, divisor, ctx); ^ 230. 231. if (ret) { crypto/bn/bn_div.c:264:1: Parameter `ctx->pool.used` 262. * divisor's length is considered public; 263. */ 264. > int bn_div_fixed_top(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, 265. const BIGNUM *divisor, BN_CTX *ctx) 266. { crypto/bn/bn_div.c:282:11: Call 280. BN_CTX_start(ctx); 281. res = (dv == NULL) ? BN_CTX_get(ctx) : dv; 282. tmp = BN_CTX_get(ctx); ^ 283. snum = BN_CTX_get(ctx); 284. sdiv = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->pool.used` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_div.c:283:12: Call 281. res = (dv == NULL) ? BN_CTX_get(ctx) : dv; 282. tmp = BN_CTX_get(ctx); 283. snum = BN_CTX_get(ctx); ^ 284. sdiv = BN_CTX_get(ctx); 285. if (sdiv == NULL) crypto/bn/bn_ctx.c:202:1: Parameter `ctx->pool.used` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_div.c:284:12: Call 282. tmp = BN_CTX_get(ctx); 283. snum = BN_CTX_get(ctx); 284. sdiv = BN_CTX_get(ctx); ^ 285. if (sdiv == NULL) 286. goto err; crypto/bn/bn_ctx.c:202:1: Parameter `ctx->pool.used` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; 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->pool.used` 183. } 184. 185. > void BN_CTX_end(BN_CTX *ctx) 186. { 187. CTXDBG("ENTER BN_CTX_end()", ctx); crypto/bn/bn_ctx.c:194:13: Call 192. /* Does this stack frame have anything to release? */ 193. if (fp < ctx->used) 194. BN_POOL_release(&ctx->pool, ctx->used - fp); ^ 195. ctx->used = fp; 196. /* Unjam "too_many" in case "get" had failed */ crypto/bn/bn_ctx.c:338:1: <LHS trace> 336. } 337. 338. > static void BN_POOL_release(BN_POOL *p, unsigned int num) 339. { 340. unsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE; crypto/bn/bn_ctx.c:338:1: Parameter `p->used` 336. } 337. 338. > static void BN_POOL_release(BN_POOL *p, unsigned int num) 339. { 340. unsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE; crypto/bn/bn_ctx.c:340:5: Binary operation: ([0, +oo] - 1):unsigned32 by call to `BN_mod_inverse` 338. static void BN_POOL_release(BN_POOL *p, unsigned int num) 339. { 340. unsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE; ^ 341. 342. p->used -= num;
https://github.com/openssl/openssl/blob/fff684168c7923aa85e6b4381d71d933396e32b0/crypto/bn/bn_ctx.c/#L340
d2a_code_trace_data_44219
X509_STORE *setup_verify(BIO *bp, char *CAfile, char *CApath) { X509_STORE *store; X509_LOOKUP *lookup; if(!(store = X509_STORE_new())) goto end; lookup=X509_STORE_add_lookup(store,X509_LOOKUP_file()); if (lookup == NULL) goto end; if (CAfile) { if(!X509_LOOKUP_load_file(lookup,CAfile,X509_FILETYPE_PEM)) { BIO_printf(bp, "Error loading file %s\n", CAfile); goto end; } } else X509_LOOKUP_load_file(lookup,NULL,X509_FILETYPE_DEFAULT); lookup=X509_STORE_add_lookup(store,X509_LOOKUP_hash_dir()); if (lookup == NULL) goto end; if (CApath) { if(!X509_LOOKUP_add_dir(lookup,CApath,X509_FILETYPE_PEM)) { BIO_printf(bp, "Error loading directory %s\n", CApath); goto end; } } else X509_LOOKUP_add_dir(lookup,NULL,X509_FILETYPE_DEFAULT); ERR_clear_error(); return store; end: X509_STORE_free(store); return NULL; } apps/apps.c:1452: error: NULL_DEREFERENCE pointer `store` last assigned on line 1430 could be null and is dereferenced by call to `X509_STORE_free()` at line 1452, column 2. Showing all 20 steps of the trace apps/apps.c:1426:1: start of procedure setup_verify() 1424. } 1425. 1426. > X509_STORE *setup_verify(BIO *bp, char *CAfile, char *CApath) 1427. { 1428. X509_STORE *store; apps/apps.c:1430:7: 1428. X509_STORE *store; 1429. X509_LOOKUP *lookup; 1430. > if(!(store = X509_STORE_new())) goto end; 1431. lookup=X509_STORE_add_lookup(store,X509_LOOKUP_file()); 1432. if (lookup == NULL) goto end; crypto/x509/x509_lu.c:178:1: start of procedure X509_STORE_new() 176. } 177. 178. > X509_STORE *X509_STORE_new(void) 179. { 180. X509_STORE *ret; crypto/x509/x509_lu.c:182:6: 180. X509_STORE *ret; 181. 182. > if ((ret=(X509_STORE *)OPENSSL_malloc(sizeof(X509_STORE))) == NULL) 183. return NULL; 184. ret->objs = sk_X509_OBJECT_new(x509_object_cmp); crypto/mem.c:295:1: start of procedure CRYPTO_malloc() 293. } 294. 295. > void *CRYPTO_malloc(int num, const char *file, int line) 296. { 297. void *ret = NULL; crypto/mem.c:297:2: 295. void *CRYPTO_malloc(int num, const char *file, int line) 296. { 297. > void *ret = NULL; 298. 299. if (num <= 0) return NULL; crypto/mem.c:299:6: Taking false branch 297. void *ret = NULL; 298. 299. if (num <= 0) return NULL; ^ 300. 301. allow_customize = 0; crypto/mem.c:301:2: 299. if (num <= 0) return NULL; 300. 301. > allow_customize = 0; 302. if (malloc_debug_func != NULL) 303. { crypto/mem.c:302:6: Taking false branch 300. 301. allow_customize = 0; 302. if (malloc_debug_func != NULL) ^ 303. { 304. allow_customize_debug = 0; crypto/mem.c:307:2: Skipping __function_pointer__(): unresolved function pointer 305. malloc_debug_func(NULL, num, file, line, 0); 306. } 307. ret = malloc_ex_func(num,file,line); ^ 308. #ifdef LEVITTE_DEBUG_MEM 309. fprintf(stderr, "LEVITTE_DEBUG_MEM: > 0x%p (%d)\n", ret, num); crypto/mem.c:311:6: Taking false branch 309. fprintf(stderr, "LEVITTE_DEBUG_MEM: > 0x%p (%d)\n", ret, num); 310. #endif 311. if (malloc_debug_func != NULL) ^ 312. malloc_debug_func(ret, num, file, line, 1); 313. crypto/mem.c:318:12: Taking false branch 316. * sanitisation function can't be optimised out. NB: We only do 317. * this for >2Kb so the overhead doesn't bother us. */ 318. if(ret && (num > 2048)) ^ 319. { extern unsigned char cleanse_ctr; 320. ((unsigned char *)ret)[0] = cleanse_ctr; crypto/mem.c:324:2: 322. #endif 323. 324. > return ret; 325. } 326. char *CRYPTO_strdup(const char *str, const char *file, int line) crypto/mem.c:325:2: return from a call to CRYPTO_malloc 323. 324. return ret; 325. } ^ 326. char *CRYPTO_strdup(const char *str, const char *file, int line) 327. { crypto/x509/x509_lu.c:182:6: Taking true branch 180. X509_STORE *ret; 181. 182. if ((ret=(X509_STORE *)OPENSSL_malloc(sizeof(X509_STORE))) == NULL) ^ 183. return NULL; 184. ret->objs = sk_X509_OBJECT_new(x509_object_cmp); crypto/x509/x509_lu.c:183:3: 181. 182. if ((ret=(X509_STORE *)OPENSSL_malloc(sizeof(X509_STORE))) == NULL) 183. > return NULL; 184. ret->objs = sk_X509_OBJECT_new(x509_object_cmp); 185. ret->cache=1; crypto/x509/x509_lu.c:212:2: return from a call to X509_STORE_new 210. ret->references=1; 211. return ret; 212. } ^ 213. 214. static void cleanup(X509_OBJECT *a) apps/apps.c:1430:7: Taking true branch 1428. X509_STORE *store; 1429. X509_LOOKUP *lookup; 1430. if(!(store = X509_STORE_new())) goto end; ^ 1431. lookup=X509_STORE_add_lookup(store,X509_LOOKUP_file()); 1432. if (lookup == NULL) goto end; apps/apps.c:1451:2: 1449. ERR_clear_error(); 1450. return store; 1451. > end: 1452. X509_STORE_free(store); 1453. return NULL; apps/apps.c:1452:2: 1450. return store; 1451. end: 1452. > X509_STORE_free(store); 1453. return NULL; 1454. }
https://github.com/openssl/openssl/blob/ec4a50b3c3f2f50caccfd52e939857a5d6f02fd1/apps/apps.c/#L1452
d2a_code_trace_data_44220
EVP_KEYEXCH *EVP_KEYEXCH_fetch(OPENSSL_CTX *ctx, const char *algorithm, const char *properties) { EVP_KEYEXCH *keyexch = evp_generic_fetch(ctx, OSSL_OP_KEYEXCH, algorithm, properties, evp_keyexch_from_dispatch, (int (*)(void *))EVP_KEYEXCH_up_ref, (void (*)(void *))EVP_KEYEXCH_free); if (keyexch->keymgmt == NULL) { EVP_KEYMGMT *keymgmt = EVP_KEYMGMT_fetch(ctx, algorithm, properties); if (keymgmt == NULL || (EVP_KEYEXCH_provider(keyexch) != EVP_KEYMGMT_provider(keymgmt))) { EVP_KEYEXCH_free(keyexch); EVP_KEYMGMT_free(keymgmt); EVPerr(EVP_F_EVP_KEYEXCH_FETCH, EVP_R_NO_KEYMGMT_PRESENT); return NULL; } keyexch->keymgmt = keymgmt; } return keyexch; } crypto/evp/exchange.c:151: error: NULL_DEREFERENCE pointer `keyexch` last assigned on line 144 could be null and is dereferenced at line 151, column 9. Showing all 36 steps of the trace crypto/evp/exchange.c:137:1: start of procedure EVP_KEYEXCH_fetch() 135. } 136. 137. > EVP_KEYEXCH *EVP_KEYEXCH_fetch(OPENSSL_CTX *ctx, const char *algorithm, 138. const char *properties) 139. { crypto/evp/exchange.c:144:5: 142. * from the same provider to manage its keys. 143. */ 144. > EVP_KEYEXCH *keyexch = 145. evp_generic_fetch(ctx, OSSL_OP_KEYEXCH, algorithm, properties, 146. evp_keyexch_from_dispatch, crypto/evp/evp_fetch.c:155:1: start of procedure evp_generic_fetch() 153. } 154. 155. > void *evp_generic_fetch(OPENSSL_CTX *libctx, int operation_id, 156. const char *name, const char *properties, 157. void *(*new_method)(const char *name, crypto/evp/evp_fetch.c:163:5: 161. void (*free_method)(void *)) 162. { 163. > OSSL_METHOD_STORE *store = get_default_method_store(libctx); 164. OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx); 165. int nameid = 0; crypto/evp/evp_fetch.c:63:1: start of procedure get_default_method_store() 61. } 62. 63. > static OSSL_METHOD_STORE *get_default_method_store(OPENSSL_CTX *libctx) 64. { 65. return openssl_ctx_get_data(libctx, OPENSSL_CTX_DEFAULT_METHOD_STORE_INDEX, crypto/evp/evp_fetch.c:65:5: 63. static OSSL_METHOD_STORE *get_default_method_store(OPENSSL_CTX *libctx) 64. { 65. > return openssl_ctx_get_data(libctx, OPENSSL_CTX_DEFAULT_METHOD_STORE_INDEX, 66. &default_method_store_method); 67. } crypto/context.c:207:1: start of procedure openssl_ctx_get_data() 205. } 206. 207. > void *openssl_ctx_get_data(OPENSSL_CTX *ctx, int index, 208. const OPENSSL_CTX_METHOD *meth) 209. { crypto/context.c:210:5: 208. const OPENSSL_CTX_METHOD *meth) 209. { 210. > void *data = NULL; 211. int dynidx; 212. crypto/context.c:213:5: 211. int dynidx; 212. 213. > ctx = openssl_ctx_get_concrete(ctx); 214. if (ctx == NULL) 215. return NULL; crypto/context.c:155:1: start of procedure openssl_ctx_get_concrete() 153. } 154. 155. > OPENSSL_CTX *openssl_ctx_get_concrete(OPENSSL_CTX *ctx) 156. { 157. #ifndef FIPS_MODE crypto/context.c:164:5: 162. } 163. #endif 164. > return ctx; 165. } 166. crypto/context.c:165:1: return from a call to openssl_ctx_get_concrete 163. #endif 164. return ctx; 165. > } 166. 167. static void openssl_ctx_generic_new(void *parent_ign, void *ptr_ign, crypto/context.c:214:9: Taking true branch 212. 213. ctx = openssl_ctx_get_concrete(ctx); 214. if (ctx == NULL) ^ 215. return NULL; 216. crypto/context.c:215:9: 213. ctx = openssl_ctx_get_concrete(ctx); 214. if (ctx == NULL) 215. > return NULL; 216. 217. CRYPTO_THREAD_read_lock(ctx->lock); crypto/context.c:255:1: return from a call to openssl_ctx_get_data 253. 254. return data; 255. > } 256. 257. OSSL_EX_DATA_GLOBAL *openssl_ctx_get_ex_data_global(OPENSSL_CTX *ctx) crypto/evp/evp_fetch.c:67:1: return from a call to get_default_method_store 65. return openssl_ctx_get_data(libctx, OPENSSL_CTX_DEFAULT_METHOD_STORE_INDEX, 66. &default_method_store_method); 67. > } 68. 69. /* crypto/evp/evp_fetch.c:164:5: 162. { 163. OSSL_METHOD_STORE *store = get_default_method_store(libctx); 164. > OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx); 165. int nameid = 0; 166. uint32_t methid = 0; crypto/core_namemap.c:90:1: start of procedure ossl_namemap_stored() 88. */ 89. 90. > OSSL_NAMEMAP *ossl_namemap_stored(OPENSSL_CTX *libctx) 91. { 92. return openssl_ctx_get_data(libctx, OPENSSL_CTX_NAMEMAP_INDEX, crypto/core_namemap.c:92:5: 90. OSSL_NAMEMAP *ossl_namemap_stored(OPENSSL_CTX *libctx) 91. { 92. > return openssl_ctx_get_data(libctx, OPENSSL_CTX_NAMEMAP_INDEX, 93. &stored_namemap_method); 94. } crypto/context.c:207:1: start of procedure openssl_ctx_get_data() 205. } 206. 207. > void *openssl_ctx_get_data(OPENSSL_CTX *ctx, int index, 208. const OPENSSL_CTX_METHOD *meth) 209. { crypto/context.c:210:5: 208. const OPENSSL_CTX_METHOD *meth) 209. { 210. > void *data = NULL; 211. int dynidx; 212. crypto/context.c:213:5: 211. int dynidx; 212. 213. > ctx = openssl_ctx_get_concrete(ctx); 214. if (ctx == NULL) 215. return NULL; crypto/context.c:155:1: start of procedure openssl_ctx_get_concrete() 153. } 154. 155. > OPENSSL_CTX *openssl_ctx_get_concrete(OPENSSL_CTX *ctx) 156. { 157. #ifndef FIPS_MODE crypto/context.c:164:5: 162. } 163. #endif 164. > return ctx; 165. } 166. crypto/context.c:165:1: return from a call to openssl_ctx_get_concrete 163. #endif 164. return ctx; 165. > } 166. 167. static void openssl_ctx_generic_new(void *parent_ign, void *ptr_ign, crypto/context.c:214:9: Taking true branch 212. 213. ctx = openssl_ctx_get_concrete(ctx); 214. if (ctx == NULL) ^ 215. return NULL; 216. crypto/context.c:215:9: 213. ctx = openssl_ctx_get_concrete(ctx); 214. if (ctx == NULL) 215. > return NULL; 216. 217. CRYPTO_THREAD_read_lock(ctx->lock); crypto/context.c:255:1: return from a call to openssl_ctx_get_data 253. 254. return data; 255. > } 256. 257. OSSL_EX_DATA_GLOBAL *openssl_ctx_get_ex_data_global(OPENSSL_CTX *ctx) crypto/core_namemap.c:94:1: return from a call to ossl_namemap_stored 92. return openssl_ctx_get_data(libctx, OPENSSL_CTX_NAMEMAP_INDEX, 93. &stored_namemap_method); 94. > } 95. 96. OSSL_NAMEMAP *ossl_namemap_new(void) crypto/evp/evp_fetch.c:165:5: 163. OSSL_METHOD_STORE *store = get_default_method_store(libctx); 164. OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx); 165. > int nameid = 0; 166. uint32_t methid = 0; 167. void *method = NULL; crypto/evp/evp_fetch.c:166:5: 164. OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx); 165. int nameid = 0; 166. > uint32_t methid = 0; 167. void *method = NULL; 168. crypto/evp/evp_fetch.c:167:5: 165. int nameid = 0; 166. uint32_t methid = 0; 167. > void *method = NULL; 168. 169. if (store == NULL || namemap == NULL) crypto/evp/evp_fetch.c:169:9: Taking true branch 167. void *method = NULL; 168. 169. if (store == NULL || namemap == NULL) ^ 170. return NULL; 171. crypto/evp/evp_fetch.c:170:9: 168. 169. if (store == NULL || namemap == NULL) 170. > return NULL; 171. 172. /* crypto/evp/evp_fetch.c:226:1: return from a call to evp_generic_fetch 224. 225. return method; 226. > } 227. 228. int EVP_set_default_properties(OPENSSL_CTX *libctx, const char *propq) crypto/evp/exchange.c:151:9: 149. 150. /* If the method is newly created, there's no keymgmt attached */ 151. > if (keyexch->keymgmt == NULL) { 152. EVP_KEYMGMT *keymgmt = EVP_KEYMGMT_fetch(ctx, algorithm, properties); 153.
https://github.com/openssl/openssl/blob/7964e3709af59675795ab1f4f69a935980379a66/crypto/evp/exchange.c/#L151
d2a_code_trace_data_44221
static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) { BN_ULONG *a = NULL; bn_check_top(b); if (words > (INT_MAX / (4 * BN_BITS2))) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_BIGNUM_TOO_LONG); return NULL; } if (BN_get_flags(b, BN_FLG_STATIC_DATA)) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA); return (NULL); } if (BN_get_flags(b, BN_FLG_SECURE)) a = OPENSSL_secure_zalloc(words * sizeof(*a)); else a = OPENSSL_zalloc(words * sizeof(*a)); if (a == NULL) { BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE); return (NULL); } assert(b->top <= words); if (b->top > 0) memcpy(a, b->d, sizeof(*a) * b->top); return a; } crypto/dsa/dsa_gen.c:533: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_MONT_CTX_set`. Showing all 17 steps of the trace crypto/dsa/dsa_gen.c:413:17: Call 411. 412. /* step 4 */ 413. r = BN_is_prime_fasttest_ex(q, DSS_prime_checks, ctx, ^ 414. seed_in ? 1 : 0, cb); 415. if (r > 0) crypto/bn/bn_prime.c:217:10: Call 215. if (mont == NULL) 216. goto err; 217. if (!BN_MONT_CTX_set(mont, a, ctx)) ^ 218. goto err; 219. crypto/bn/bn_mont.c:247:1: Parameter `*mont->N.d` 245. } 246. 247. > int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) 248. { 249. int ret = 0; crypto/dsa/dsa_gen.c:533:10: Call 531. } else 532. h = 1; 533. if (!BN_MONT_CTX_set(mont, p, ctx)) ^ 534. goto err; 535. crypto/bn/bn_mont.c:247:1: Parameter `*mont->N.d` 245. } 246. 247. > int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) 248. { 249. int ret = 0; crypto/bn/bn_mont.c:259:10: Call 257. goto err; 258. R = &(mont->RR); /* grab RR as a temp */ 259. if (!BN_copy(&(mont->N), mod)) ^ 260. goto err; /* Set N */ 261. mont->N.neg = 0; crypto/bn/bn_lib.c:323:1: Parameter `*a->d` 321. } 322. 323. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 324. { 325. bn_check_top(b); crypto/bn/bn_lib.c:329:9: Call 327. if (a == b) 328. return a; 329. if (bn_wexpand(a, b->top) == NULL) ^ 330. return NULL; 331. crypto/bn/bn_lib.c:948:1: Parameter `*a->d` 946. } 947. 948. > BIGNUM *bn_wexpand(BIGNUM *a, int words) 949. { 950. return (words <= a->dmax) ? a : bn_expand2(a, words); crypto/bn/bn_lib.c:950:37: Call 948. BIGNUM *bn_wexpand(BIGNUM *a, int words) 949. { 950. return (words <= a->dmax) ? a : bn_expand2(a, words); ^ 951. } 952. crypto/bn/bn_lib.c:284:1: Parameter `*b->d` 282. */ 283. 284. > BIGNUM *bn_expand2(BIGNUM *b, int words) 285. { 286. bn_check_top(b); crypto/bn/bn_lib.c:289:23: Call 287. 288. if (words > b->dmax) { 289. BN_ULONG *a = bn_expand_internal(b, words); ^ 290. if (!a) 291. return NULL; crypto/bn/bn_lib.c:246:1: <Offset trace> 244. /* This is used by bn_expand2() */ 245. /* The caller MUST check that words > b->dmax before calling this */ 246. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 247. { 248. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:246:1: Parameter `b->top` 244. /* This is used by bn_expand2() */ 245. /* The caller MUST check that words > b->dmax before calling this */ 246. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 247. { 248. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:246:1: <Length trace> 244. /* This is used by bn_expand2() */ 245. /* The caller MUST check that words > b->dmax before calling this */ 246. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 247. { 248. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:246:1: Parameter `*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 = NULL; crypto/bn/bn_lib.c:271:9: Array access: Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_MONT_CTX_set` 269. assert(b->top <= words); 270. if (b->top > 0) 271. memcpy(a, b->d, sizeof(*a) * b->top); ^ 272. 273. return a;
https://github.com/openssl/openssl/blob/757264207ad8650a89ea903d48ad89f61d56ea9c/crypto/bn/bn_lib.c/#L271
d2a_code_trace_data_44222
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/bn/bn_sqrt.c:148: error: INTEGER_OVERFLOW_L2 ([0, 6+max(0, `ctx->stack.depth`)] - 1):unsigned32 by call to `BN_mod_exp`. Showing all 37 steps of the trace crypto/bn/bn_sqrt.c:63:1: Parameter `ctx->stack.depth` 61. #include "bn_lcl.h" 62. 63. > BIGNUM *BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) 64. /* 65. * Returns 'ret' such that ret^2 == a (mod p), using the Tonelli/Shanks crypto/bn/bn_sqrt.c:109:5: Call 107. } 108. 109. BN_CTX_start(ctx); ^ 110. A = BN_CTX_get(ctx); 111. 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_sqrt.c:125:10: Call 123. 124. /* A = a mod p */ 125. if (!BN_nnmod(A, a, p, ctx)) ^ 126. goto end; 127. 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_sqrt.c:148:14: Call 146. if (!BN_add_word(q, 1)) 147. goto end; 148. if (!BN_mod_exp(ret, A, q, p, ctx)) ^ 149. goto end; 150. err = 0; crypto/bn/bn_exp.c:191:1: Parameter `ctx->stack.depth` 189. } 190. 191. > int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, 192. BN_CTX *ctx) 193. { crypto/bn/bn_exp.c:248:19: Call 246. && (BN_get_flags(p, BN_FLG_CONSTTIME) == 0)) { 247. BN_ULONG A = a->d[0]; 248. ret = BN_mod_exp_mont_word(r, A, p, m, ctx, NULL); ^ 249. } else 250. # endif crypto/bn/bn_exp.c:1135:1: Parameter `ctx->stack.depth` 1133. } 1134. 1135. > int BN_mod_exp_mont_word(BIGNUM *rr, BN_ULONG a, const BIGNUM *p, 1136. const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont) 1137. { crypto/bn/bn_exp.c:1193:5: Call 1191. } 1192. 1193. BN_CTX_start(ctx); ^ 1194. d = BN_CTX_get(ctx); 1195. 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_exp.c:1205:14: Call 1203. if ((mont = BN_MONT_CTX_new()) == NULL) 1204. goto err; 1205. if (!BN_MONT_CTX_set(mont, m, ctx)) ^ 1206. goto err; 1207. } 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, 6+max(0, ctx->stack.depth)] - 1):unsigned32 by call to `BN_mod_exp` 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_44223
void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) { unsigned long hash; OPENSSL_LH_NODE *nn, **rn; void *ret; lh->error = 0; rn = getrn(lh, data, &hash); if (*rn == NULL) { lh->num_no_delete++; return (NULL); } else { nn = *rn; *rn = nn->next; ret = nn->data; OPENSSL_free(nn); lh->num_delete++; } lh->num_items--; if ((lh->num_nodes > MIN_NODES) && (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes))) contract(lh); return (ret); } test/sslcorrupttest.c:243: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned64 by call to `SSL_free`. Showing all 17 steps of the trace test/sslcorrupttest.c:222:10: Call 220. 221. /* BIO is freed by create_ssl_connection on error */ 222. if (!TEST_true(create_ssl_objects(sctx, cctx, &server, &client, NULL, ^ 223. c_to_s_fbio))) 224. goto end; test/ssltestlib.c:559:15: Call 557. if (*sssl != NULL) 558. serverssl = *sssl; 559. else if (!TEST_ptr(serverssl = SSL_new(serverctx))) ^ 560. goto error; 561. if (*cssl != NULL) ssl/ssl_lib.c:522:1: Parameter `ctx->sessions->num_items` 520. } 521. 522. > SSL *SSL_new(SSL_CTX *ctx) 523. { 524. SSL *s; test/sslcorrupttest.c:243:5: Call 241. testresult = 1; 242. end: 243. SSL_free(server); ^ 244. SSL_free(client); 245. SSL_CTX_free(sctx); ssl/ssl_lib.c:968:1: Parameter `s->session_ctx->sessions->num_items` 966. } 967. 968. > void SSL_free(SSL *s) 969. { 970. int i; ssl/ssl_lib.c:999:9: Call 997. /* Make the next call work :-) */ 998. if (s->session != NULL) { 999. ssl_clear_bad_session(s); ^ 1000. SSL_SESSION_free(s->session); 1001. } ssl/ssl_sess.c:1049:1: Parameter `s->session_ctx->sessions->num_items` 1047. } 1048. 1049. > int ssl_clear_bad_session(SSL *s) 1050. { 1051. if ((s->session != NULL) && ssl/ssl_sess.c:1054:9: Call 1052. !(s->shutdown & SSL_SENT_SHUTDOWN) && 1053. !(SSL_in_init(s) || SSL_in_before(s))) { 1054. SSL_CTX_remove_session(s->session_ctx, s->session); ^ 1055. return (1); 1056. } else ssl/ssl_sess.c:725:1: Parameter `ctx->sessions->num_items` 723. } 724. 725. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 726. { 727. return remove_session_lock(ctx, c, 1); ssl/ssl_sess.c:727:12: Call 725. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 726. { 727. return remove_session_lock(ctx, c, 1); ^ 728. } 729. ssl/ssl_sess.c:730:1: Parameter `ctx->sessions->num_items` 728. } 729. 730. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck) 731. { 732. SSL_SESSION *r; ssl/ssl_sess.c:740:17: Call 738. if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) == c) { 739. ret = 1; 740. r = lh_SSL_SESSION_delete(ctx->sessions, c); ^ 741. SSL_SESSION_list_remove(ctx, c); 742. } ssl/ssl_locl.h:721:1: Parameter `lh->num_items` 719. } TLSEXT_INDEX; 720. 721. > DEFINE_LHASH_OF(SSL_SESSION); 722. /* Needed in ssl_cert.c */ 723. DEFINE_LHASH_OF(X509_NAME); ssl/ssl_locl.h:721:1: Call 719. } TLSEXT_INDEX; 720. 721. > DEFINE_LHASH_OF(SSL_SESSION); 722. /* Needed in ssl_cert.c */ 723. DEFINE_LHASH_OF(X509_NAME); crypto/lhash/lhash.c:103:1: <LHS trace> 101. } 102. 103. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) 104. { 105. unsigned long hash; crypto/lhash/lhash.c:103:1: Parameter `lh->num_items` 101. } 102. 103. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) 104. { 105. unsigned long hash; crypto/lhash/lhash.c:123:5: Binary operation: ([0, +oo] - 1):unsigned64 by call to `SSL_free` 121. } 122. 123. lh->num_items--; ^ 124. if ((lh->num_nodes > MIN_NODES) && 125. (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
https://github.com/openssl/openssl/blob/7f7eb90b8ac55997c5c825bb3ebcfe28611e06f5/crypto/lhash/lhash.c/#L123
d2a_code_trace_data_44224
static int vc1_decode_p_mb(VC1Context *v) { MpegEncContext *s = &v->s; GetBitContext *gb = &s->gb; int i, j; int mb_pos = s->mb_x + s->mb_y * s->mb_stride; int cbp; int mqdiff, mquant; int ttmb = v->ttfrm; int status; static const int size_table[6] = { 0, 2, 3, 4, 5, 8 }, offset_table[6] = { 0, 1, 3, 7, 15, 31 }; int mb_has_coeffs = 1; int dmv_x, dmv_y; int index, index1; int val, sign; int first_block = 1; int dst_idx, off; int skipped, fourmv; mquant = v->pq; if (v->mv_type_is_raw) fourmv = get_bits1(gb); else fourmv = v->mv_type_mb_plane[mb_pos]; if (v->skip_is_raw) skipped = get_bits1(gb); else skipped = v->s.mbskip_table[mb_pos]; s->dsp.clear_blocks(s->block[0]); if (!fourmv) { if (!skipped) { GET_MVDATA(dmv_x, dmv_y); if (s->mb_intra) { s->current_picture.motion_val[1][s->block_index[0]][0] = 0; s->current_picture.motion_val[1][s->block_index[0]][1] = 0; } s->current_picture.mb_type[mb_pos] = s->mb_intra ? MB_TYPE_INTRA : MB_TYPE_16x16; vc1_pred_mv(s, 0, dmv_x, dmv_y, 1, v->range_x, v->range_y, v->mb_type[0]); if (s->mb_intra && !mb_has_coeffs) { GET_MQUANT(); s->ac_pred = get_bits1(gb); cbp = 0; } else if (mb_has_coeffs) { if (s->mb_intra) s->ac_pred = get_bits1(gb); cbp = get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_CBPCY_P_VLC_BITS, 2); GET_MQUANT(); } else { mquant = v->pq; cbp = 0; } s->current_picture.qscale_table[mb_pos] = mquant; if (!v->ttmbf && !s->mb_intra && mb_has_coeffs) ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index].table, VC1_TTMB_VLC_BITS, 2); if(!s->mb_intra) vc1_mc_1mv(v, 0); dst_idx = 0; for (i=0; i<6; i++) { s->dc_val[0][s->block_index[i]] = 0; dst_idx += i >> 2; val = ((cbp >> (5 - i)) & 1); off = (i & 4) ? 0 : ((i & 1) * 8 + (i & 2) * 4 * s->linesize); v->mb_type[0][s->block_index[i]] = s->mb_intra; if(s->mb_intra) { v->a_avail = v->c_avail = 0; if(i == 2 || i == 3 || !s->first_slice_line) v->a_avail = v->mb_type[0][s->block_index[i] - s->block_wrap[i]]; if(i == 1 || i == 3 || s->mb_x) v->c_avail = v->mb_type[0][s->block_index[i] - 1]; vc1_decode_intra_block(v, s->block[i], i, val, mquant, (i&4)?v->codingset2:v->codingset); if((i>3) && (s->flags & CODEC_FLAG_GRAY)) continue; s->dsp.vc1_inv_trans_8x8(s->block[i]); if(v->rangeredfrm) for(j = 0; j < 64; j++) s->block[i][j] <<= 1; s->dsp.put_signed_pixels_clamped(s->block[i], s->dest[dst_idx] + off, s->linesize >> ((i & 4) >> 2)); if(v->pq >= 9 && v->overlap) { if(v->c_avail) s->dsp.vc1_h_overlap(s->dest[dst_idx] + off, s->linesize >> ((i & 4) >> 2)); if(v->a_avail) s->dsp.vc1_v_overlap(s->dest[dst_idx] + off, s->linesize >> ((i & 4) >> 2)); } } else if(val) { vc1_decode_p_block(v, s->block[i], i, mquant, ttmb, first_block, s->dest[dst_idx] + off, (i&4)?s->uvlinesize:s->linesize, (i&4) && (s->flags & CODEC_FLAG_GRAY)); if(!v->ttmbf && ttmb < 8) ttmb = -1; first_block = 0; } } } else { s->mb_intra = 0; for(i = 0; i < 6; i++) { v->mb_type[0][s->block_index[i]] = 0; s->dc_val[0][s->block_index[i]] = 0; } s->current_picture.mb_type[mb_pos] = MB_TYPE_SKIP; s->current_picture.qscale_table[mb_pos] = 0; vc1_pred_mv(s, 0, 0, 0, 1, v->range_x, v->range_y, v->mb_type[0]); vc1_mc_1mv(v, 0); return 0; } } else { if (!skipped ) { int intra_count = 0, coded_inter = 0; int is_intra[6], is_coded[6]; cbp = get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_CBPCY_P_VLC_BITS, 2); for (i=0; i<6; i++) { val = ((cbp >> (5 - i)) & 1); s->dc_val[0][s->block_index[i]] = 0; s->mb_intra = 0; if(i < 4) { dmv_x = dmv_y = 0; s->mb_intra = 0; mb_has_coeffs = 0; if(val) { GET_MVDATA(dmv_x, dmv_y); } vc1_pred_mv(s, i, dmv_x, dmv_y, 0, v->range_x, v->range_y, v->mb_type[0]); if(!s->mb_intra) vc1_mc_4mv_luma(v, i); intra_count += s->mb_intra; is_intra[i] = s->mb_intra; is_coded[i] = mb_has_coeffs; } if(i&4){ is_intra[i] = (intra_count >= 3); is_coded[i] = val; } if(i == 4) vc1_mc_4mv_chroma(v); v->mb_type[0][s->block_index[i]] = is_intra[i]; if(!coded_inter) coded_inter = !is_intra[i] & is_coded[i]; } if(!intra_count && !coded_inter) return 0; dst_idx = 0; GET_MQUANT(); s->current_picture.qscale_table[mb_pos] = mquant; { int intrapred = 0; for(i=0; i<6; i++) if(is_intra[i]) { if(((!s->first_slice_line || (i==2 || i==3)) && v->mb_type[0][s->block_index[i] - s->block_wrap[i]]) || ((s->mb_x || (i==1 || i==3)) && v->mb_type[0][s->block_index[i] - 1])) { intrapred = 1; break; } } if(intrapred)s->ac_pred = get_bits1(gb); else s->ac_pred = 0; } if (!v->ttmbf && coded_inter) ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index].table, VC1_TTMB_VLC_BITS, 2); for (i=0; i<6; i++) { dst_idx += i >> 2; off = (i & 4) ? 0 : ((i & 1) * 8 + (i & 2) * 4 * s->linesize); s->mb_intra = is_intra[i]; if (is_intra[i]) { v->a_avail = v->c_avail = 0; if(i == 2 || i == 3 || !s->first_slice_line) v->a_avail = v->mb_type[0][s->block_index[i] - s->block_wrap[i]]; if(i == 1 || i == 3 || s->mb_x) v->c_avail = v->mb_type[0][s->block_index[i] - 1]; vc1_decode_intra_block(v, s->block[i], i, is_coded[i], mquant, (i&4)?v->codingset2:v->codingset); if((i>3) && (s->flags & CODEC_FLAG_GRAY)) continue; s->dsp.vc1_inv_trans_8x8(s->block[i]); if(v->rangeredfrm) for(j = 0; j < 64; j++) s->block[i][j] <<= 1; s->dsp.put_signed_pixels_clamped(s->block[i], s->dest[dst_idx] + off, (i&4)?s->uvlinesize:s->linesize); if(v->pq >= 9 && v->overlap) { if(v->c_avail) s->dsp.vc1_h_overlap(s->dest[dst_idx] + off, s->linesize >> ((i & 4) >> 2)); if(v->a_avail) s->dsp.vc1_v_overlap(s->dest[dst_idx] + off, s->linesize >> ((i & 4) >> 2)); } } else if(is_coded[i]) { status = vc1_decode_p_block(v, s->block[i], i, mquant, ttmb, first_block, s->dest[dst_idx] + off, (i&4)?s->uvlinesize:s->linesize, (i&4) && (s->flags & CODEC_FLAG_GRAY)); if(!v->ttmbf && ttmb < 8) ttmb = -1; first_block = 0; } } return status; } else { s->mb_intra = 0; s->current_picture.qscale_table[mb_pos] = 0; for (i=0; i<6; i++) { v->mb_type[0][s->block_index[i]] = 0; s->dc_val[0][s->block_index[i]] = 0; } for (i=0; i<4; i++) { vc1_pred_mv(s, i, 0, 0, 0, v->range_x, v->range_y, v->mb_type[0]); vc1_mc_4mv_luma(v, i); } vc1_mc_4mv_chroma(v); s->current_picture.qscale_table[mb_pos] = 0; return 0; } } return -1; } libavcodec/vc1.c:3209: error: Uninitialized Value The value read from status was never initialized. libavcodec/vc1.c:3209:13: 3207. } 3208. } 3209. return status; ^ 3210. } 3211. else //Skipped MB
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/vc1.c/#L3209
d2a_code_trace_data_44225
tsize_t t2p_write_pdf(T2P* t2p, TIFF* input, TIFF* output){ tsize_t written=0; ttile_t i2=0; tsize_t streamlen=0; uint16 i=0; t2p_read_tiff_init(t2p, input); if(t2p->t2p_error!=T2P_ERR_OK){return(0);} t2p->pdf_xrefoffsets= (uint32*) _TIFFmalloc(TIFFSafeMultiply(tmsize_t,t2p->pdf_xrefcount,sizeof(uint32)) ); if(t2p->pdf_xrefoffsets==NULL){ TIFFError( TIFF2PDF_MODULE, "Can't allocate %u bytes of memory for t2p_write_pdf", (unsigned int) (t2p->pdf_xrefcount * sizeof(uint32)) ); t2p->t2p_error = T2P_ERR_ERROR; return(written); } t2p->pdf_xrefcount=0; t2p->pdf_catalog=1; t2p->pdf_info=2; t2p->pdf_pages=3; written += t2p_write_pdf_header(t2p, output); t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written; t2p->pdf_catalog=t2p->pdf_xrefcount; written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output); written += t2p_write_pdf_catalog(t2p, output); written += t2p_write_pdf_obj_end(output); t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written; t2p->pdf_info=t2p->pdf_xrefcount; written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output); written += t2p_write_pdf_info(t2p, input, output); written += t2p_write_pdf_obj_end(output); t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written; t2p->pdf_pages=t2p->pdf_xrefcount; written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output); written += t2p_write_pdf_pages(t2p, output); written += t2p_write_pdf_obj_end(output); for(t2p->pdf_page=0;t2p->pdf_page<t2p->tiff_pagecount;t2p->pdf_page++){ t2p_read_tiff_data(t2p, input); if(t2p->t2p_error!=T2P_ERR_OK){return(0);} t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written; written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output); written += t2p_write_pdf_page(t2p->pdf_xrefcount, t2p, output); written += t2p_write_pdf_obj_end(output); t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written; written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output); written += t2p_write_pdf_stream_dict_start(output); written += t2p_write_pdf_stream_dict(0, t2p->pdf_xrefcount+1, output); written += t2p_write_pdf_stream_dict_end(output); written += t2p_write_pdf_stream_start(output); streamlen=written; written += t2p_write_pdf_page_content_stream(t2p, output); streamlen=written-streamlen; written += t2p_write_pdf_stream_end(output); written += t2p_write_pdf_obj_end(output); t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written; written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output); written += t2p_write_pdf_stream_length(streamlen, output); written += t2p_write_pdf_obj_end(output); if(t2p->tiff_transferfunctioncount != 0){ t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written; written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output); written += t2p_write_pdf_transfer(t2p, output); written += t2p_write_pdf_obj_end(output); for(i=0; i < t2p->tiff_transferfunctioncount; i++){ t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written; written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output); written += t2p_write_pdf_stream_dict_start(output); written += t2p_write_pdf_transfer_dict(t2p, output, i); written += t2p_write_pdf_stream_dict_end(output); written += t2p_write_pdf_stream_start(output); written += t2p_write_pdf_transfer_stream(t2p, output, i); written += t2p_write_pdf_stream_end(output); written += t2p_write_pdf_obj_end(output); } } if( (t2p->pdf_colorspace & T2P_CS_PALETTE) != 0){ t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written; t2p->pdf_palettecs=t2p->pdf_xrefcount; written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output); written += t2p_write_pdf_stream_dict_start(output); written += t2p_write_pdf_stream_dict(t2p->pdf_palettesize, 0, output); written += t2p_write_pdf_stream_dict_end(output); written += t2p_write_pdf_stream_start(output); written += t2p_write_pdf_xobject_palettecs_stream(t2p, output); written += t2p_write_pdf_stream_end(output); written += t2p_write_pdf_obj_end(output); } if( (t2p->pdf_colorspace & T2P_CS_ICCBASED) != 0){ t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written; t2p->pdf_icccs=t2p->pdf_xrefcount; written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output); written += t2p_write_pdf_stream_dict_start(output); written += t2p_write_pdf_xobject_icccs_dict(t2p, output); written += t2p_write_pdf_stream_dict_end(output); written += t2p_write_pdf_stream_start(output); written += t2p_write_pdf_xobject_icccs_stream(t2p, output); written += t2p_write_pdf_stream_end(output); written += t2p_write_pdf_obj_end(output); } if(t2p->tiff_tiles[t2p->pdf_page].tiles_tilecount !=0){ for(i2=0;i2<t2p->tiff_tiles[t2p->pdf_page].tiles_tilecount;i2++){ t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written; written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output); written += t2p_write_pdf_stream_dict_start(output); written += t2p_write_pdf_xobject_stream_dict( i2+1, t2p, output); written += t2p_write_pdf_stream_dict_end(output); written += t2p_write_pdf_stream_start(output); streamlen=written; t2p_read_tiff_size_tile(t2p, input, i2); written += t2p_readwrite_pdf_image_tile(t2p, input, output, i2); t2p_write_advance_directory(t2p, output); if(t2p->t2p_error!=T2P_ERR_OK){return(0);} streamlen=written-streamlen; written += t2p_write_pdf_stream_end(output); written += t2p_write_pdf_obj_end(output); t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written; written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output); written += t2p_write_pdf_stream_length(streamlen, output); written += t2p_write_pdf_obj_end(output); } } else { t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written; written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output); written += t2p_write_pdf_stream_dict_start(output); written += t2p_write_pdf_xobject_stream_dict( 0, t2p, output); written += t2p_write_pdf_stream_dict_end(output); written += t2p_write_pdf_stream_start(output); streamlen=written; t2p_read_tiff_size(t2p, input); written += t2p_readwrite_pdf_image(t2p, input, output); t2p_write_advance_directory(t2p, output); if(t2p->t2p_error!=T2P_ERR_OK){return(0);} streamlen=written-streamlen; written += t2p_write_pdf_stream_end(output); written += t2p_write_pdf_obj_end(output); t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written; written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output); written += t2p_write_pdf_stream_length(streamlen, output); written += t2p_write_pdf_obj_end(output); } } t2p->pdf_startxref = written; written += t2p_write_pdf_xreftable(t2p, output); written += t2p_write_pdf_trailer(t2p, output); t2p_disable(output); return(written); } tools/tiff2pdf.c:5451: error: Memory Leak memory dynamically allocated by call to `_TIFFmalloc()` at line 5429, column 34 is not reachable after line 5451, column 13. tools/tiff2pdf.c:5420:1: start of procedure t2p_write_pdf() 5418. */ 5419. 5420. tsize_t t2p_write_pdf(T2P* t2p, TIFF* input, TIFF* output){ ^ 5421. 5422. tsize_t written=0; tools/tiff2pdf.c:5422:2: 5420. tsize_t t2p_write_pdf(T2P* t2p, TIFF* input, TIFF* output){ 5421. 5422. tsize_t written=0; ^ 5423. ttile_t i2=0; 5424. tsize_t streamlen=0; tools/tiff2pdf.c:5423:2: 5421. 5422. tsize_t written=0; 5423. ttile_t i2=0; ^ 5424. tsize_t streamlen=0; 5425. uint16 i=0; tools/tiff2pdf.c:5424:2: 5422. tsize_t written=0; 5423. ttile_t i2=0; 5424. tsize_t streamlen=0; ^ 5425. uint16 i=0; 5426. tools/tiff2pdf.c:5425:2: 5423. ttile_t i2=0; 5424. tsize_t streamlen=0; 5425. uint16 i=0; ^ 5426. 5427. t2p_read_tiff_init(t2p, input); tools/tiff2pdf.c:5427:2: Skipping t2p_read_tiff_init(): empty list of specs 5425. uint16 i=0; 5426. 5427. t2p_read_tiff_init(t2p, input); ^ 5428. if(t2p->t2p_error!=T2P_ERR_OK){return(0);} 5429. t2p->pdf_xrefoffsets= (uint32*) _TIFFmalloc(TIFFSafeMultiply(tmsize_t,t2p->pdf_xrefcount,sizeof(uint32)) ); tools/tiff2pdf.c:5428:5: Taking false branch 5426. 5427. t2p_read_tiff_init(t2p, input); 5428. if(t2p->t2p_error!=T2P_ERR_OK){return(0);} ^ 5429. t2p->pdf_xrefoffsets= (uint32*) _TIFFmalloc(TIFFSafeMultiply(tmsize_t,t2p->pdf_xrefcount,sizeof(uint32)) ); 5430. if(t2p->pdf_xrefoffsets==NULL){ tools/tiff2pdf.c:5429:46: Condition is true 5427. t2p_read_tiff_init(t2p, input); 5428. if(t2p->t2p_error!=T2P_ERR_OK){return(0);} 5429. t2p->pdf_xrefoffsets= (uint32*) _TIFFmalloc(TIFFSafeMultiply(tmsize_t,t2p->pdf_xrefcount,sizeof(uint32)) ); ^ 5430. if(t2p->pdf_xrefoffsets==NULL){ 5431. TIFFError( tools/tiff2pdf.c:5429:46: Condition is true 5427. t2p_read_tiff_init(t2p, input); 5428. if(t2p->t2p_error!=T2P_ERR_OK){return(0);} 5429. t2p->pdf_xrefoffsets= (uint32*) _TIFFmalloc(TIFFSafeMultiply(tmsize_t,t2p->pdf_xrefcount,sizeof(uint32)) ); ^ 5430. if(t2p->pdf_xrefoffsets==NULL){ 5431. TIFFError( tools/tiff2pdf.c:5429:2: 5427. t2p_read_tiff_init(t2p, input); 5428. if(t2p->t2p_error!=T2P_ERR_OK){return(0);} 5429. t2p->pdf_xrefoffsets= (uint32*) _TIFFmalloc(TIFFSafeMultiply(tmsize_t,t2p->pdf_xrefcount,sizeof(uint32)) ); ^ 5430. if(t2p->pdf_xrefoffsets==NULL){ 5431. TIFFError( libtiff/tif_unix.c:310:1: start of procedure _TIFFmalloc() 308. #endif 309. 310. void* ^ 311. _TIFFmalloc(tmsize_t s) 312. { libtiff/tif_unix.c:313:13: Taking false branch 311. _TIFFmalloc(tmsize_t s) 312. { 313. if (s == 0) ^ 314. return ((void *) NULL); 315. libtiff/tif_unix.c:316:2: 314. return ((void *) NULL); 315. 316. return (malloc((size_t) s)); ^ 317. } 318. libtiff/tif_unix.c:317:1: return from a call to _TIFFmalloc 315. 316. return (malloc((size_t) s)); 317. } ^ 318. 319. void* _TIFFcalloc(tmsize_t nmemb, tmsize_t siz) tools/tiff2pdf.c:5430:5: Taking false branch 5428. if(t2p->t2p_error!=T2P_ERR_OK){return(0);} 5429. t2p->pdf_xrefoffsets= (uint32*) _TIFFmalloc(TIFFSafeMultiply(tmsize_t,t2p->pdf_xrefcount,sizeof(uint32)) ); 5430. if(t2p->pdf_xrefoffsets==NULL){ ^ 5431. TIFFError( 5432. TIFF2PDF_MODULE, tools/tiff2pdf.c:5438:2: 5436. return(written); 5437. } 5438. t2p->pdf_xrefcount=0; ^ 5439. t2p->pdf_catalog=1; 5440. t2p->pdf_info=2; tools/tiff2pdf.c:5439:2: 5437. } 5438. t2p->pdf_xrefcount=0; 5439. t2p->pdf_catalog=1; ^ 5440. t2p->pdf_info=2; 5441. t2p->pdf_pages=3; tools/tiff2pdf.c:5440:2: 5438. t2p->pdf_xrefcount=0; 5439. t2p->pdf_catalog=1; 5440. t2p->pdf_info=2; ^ 5441. t2p->pdf_pages=3; 5442. written += t2p_write_pdf_header(t2p, output); tools/tiff2pdf.c:5441:2: 5439. t2p->pdf_catalog=1; 5440. t2p->pdf_info=2; 5441. t2p->pdf_pages=3; ^ 5442. written += t2p_write_pdf_header(t2p, output); 5443. t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written; tools/tiff2pdf.c:5442:2: 5440. t2p->pdf_info=2; 5441. t2p->pdf_pages=3; 5442. written += t2p_write_pdf_header(t2p, output); ^ 5443. t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written; 5444. t2p->pdf_catalog=t2p->pdf_xrefcount; tools/tiff2pdf.c:3778:1: start of procedure t2p_write_pdf_header() 3776. */ 3777. 3778. tsize_t t2p_write_pdf_header(T2P* t2p, TIFF* output){ ^ 3779. 3780. tsize_t written=0; tools/tiff2pdf.c:3780:2: 3778. tsize_t t2p_write_pdf_header(T2P* t2p, TIFF* output){ 3779. 3780. tsize_t written=0; ^ 3781. char buffer[16]; 3782. int buflen=0; tools/tiff2pdf.c:3782:2: 3780. tsize_t written=0; 3781. char buffer[16]; 3782. int buflen=0; ^ 3783. 3784. buflen = snprintf(buffer, sizeof(buffer), "%%PDF-%u.%u ", tools/tiff2pdf.c:3784:2: 3782. int buflen=0; 3783. 3784. buflen = snprintf(buffer, sizeof(buffer), "%%PDF-%u.%u ", ^ 3785. t2p->pdf_majorversion&0xff, 3786. t2p->pdf_minorversion&0xff); tools/tiff2pdf.c:3787:2: Taking false branch 3785. t2p->pdf_majorversion&0xff, 3786. t2p->pdf_minorversion&0xff); 3787. check_snprintf_ret(t2p, buflen, buffer); ^ 3788. written += t2pWriteFile(output, (tdata_t) buffer, buflen); 3789. written += t2pWriteFile(output, (tdata_t)"\n%\342\343\317\323\n", 7); tools/tiff2pdf.c:3787:2: Taking false branch 3785. t2p->pdf_majorversion&0xff, 3786. t2p->pdf_minorversion&0xff); 3787. check_snprintf_ret(t2p, buflen, buffer); ^ 3788. written += t2pWriteFile(output, (tdata_t) buffer, buflen); 3789. written += t2pWriteFile(output, (tdata_t)"\n%\342\343\317\323\n", 7); tools/tiff2pdf.c:3788:2: 3786. t2p->pdf_minorversion&0xff); 3787. check_snprintf_ret(t2p, buflen, buffer); 3788. written += t2pWriteFile(output, (tdata_t) buffer, buflen); ^ 3789. written += t2pWriteFile(output, (tdata_t)"\n%\342\343\317\323\n", 7); 3790. tools/tiff2pdf.c:373:1: start of procedure t2pWriteFile() 371. #endif /* OJPEG_SUPPORT */ 372. 373. static tmsize_t ^ 374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size) 375. { tools/tiff2pdf.c:376:2: 374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size) 375. { 376. thandle_t client = TIFFClientdata(tif); ^ 377. TIFFReadWriteProc proc = TIFFGetWriteProc(tif); 378. if (proc) libtiff/tif_open.c:536:1: start of procedure TIFFClientdata() 534. * Return open file's clientdata. 535. */ 536. thandle_t ^ 537. TIFFClientdata(TIFF* tif) 538. { libtiff/tif_open.c:539:2: 537. TIFFClientdata(TIFF* tif) 538. { 539. return (tif->tif_clientdata); ^ 540. } 541. libtiff/tif_open.c:540:1: return from a call to TIFFClientdata 538. { 539. return (tif->tif_clientdata); 540. } ^ 541. 542. /* tools/tiff2pdf.c:377:2: 375. { 376. thandle_t client = TIFFClientdata(tif); 377. TIFFReadWriteProc proc = TIFFGetWriteProc(tif); ^ 378. if (proc) 379. return proc(client, data, size); libtiff/tif_open.c:667:1: start of procedure TIFFGetWriteProc() 665. * Return pointer to file write method. 666. */ 667. TIFFReadWriteProc ^ 668. TIFFGetWriteProc(TIFF* tif) 669. { libtiff/tif_open.c:670:2: 668. TIFFGetWriteProc(TIFF* tif) 669. { 670. return (tif->tif_writeproc); ^ 671. } 672. libtiff/tif_open.c:671:1: return from a call to TIFFGetWriteProc 669. { 670. return (tif->tif_writeproc); 671. } ^ 672. 673. /* tools/tiff2pdf.c:378:6: Taking false branch 376. thandle_t client = TIFFClientdata(tif); 377. TIFFReadWriteProc proc = TIFFGetWriteProc(tif); 378. if (proc) ^ 379. return proc(client, data, size); 380. return -1; tools/tiff2pdf.c:380:2: 378. if (proc) 379. return proc(client, data, size); 380. return -1; ^ 381. } 382. tools/tiff2pdf.c:381:1: return from a call to t2pWriteFile 379. return proc(client, data, size); 380. return -1; 381. } ^ 382. 383. static uint64 tools/tiff2pdf.c:3789:2: 3787. check_snprintf_ret(t2p, buflen, buffer); 3788. written += t2pWriteFile(output, (tdata_t) buffer, buflen); 3789. written += t2pWriteFile(output, (tdata_t)"\n%\342\343\317\323\n", 7); ^ 3790. 3791. return(written); tools/tiff2pdf.c:373:1: start of procedure t2pWriteFile() 371. #endif /* OJPEG_SUPPORT */ 372. 373. static tmsize_t ^ 374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size) 375. { tools/tiff2pdf.c:376:2: 374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size) 375. { 376. thandle_t client = TIFFClientdata(tif); ^ 377. TIFFReadWriteProc proc = TIFFGetWriteProc(tif); 378. if (proc) libtiff/tif_open.c:536:1: start of procedure TIFFClientdata() 534. * Return open file's clientdata. 535. */ 536. thandle_t ^ 537. TIFFClientdata(TIFF* tif) 538. { libtiff/tif_open.c:539:2: 537. TIFFClientdata(TIFF* tif) 538. { 539. return (tif->tif_clientdata); ^ 540. } 541. libtiff/tif_open.c:540:1: return from a call to TIFFClientdata 538. { 539. return (tif->tif_clientdata); 540. } ^ 541. 542. /* tools/tiff2pdf.c:377:2: 375. { 376. thandle_t client = TIFFClientdata(tif); 377. TIFFReadWriteProc proc = TIFFGetWriteProc(tif); ^ 378. if (proc) 379. return proc(client, data, size); libtiff/tif_open.c:667:1: start of procedure TIFFGetWriteProc() 665. * Return pointer to file write method. 666. */ 667. TIFFReadWriteProc ^ 668. TIFFGetWriteProc(TIFF* tif) 669. { libtiff/tif_open.c:670:2: 668. TIFFGetWriteProc(TIFF* tif) 669. { 670. return (tif->tif_writeproc); ^ 671. } 672. libtiff/tif_open.c:671:1: return from a call to TIFFGetWriteProc 669. { 670. return (tif->tif_writeproc); 671. } ^ 672. 673. /* tools/tiff2pdf.c:378:6: Taking false branch 376. thandle_t client = TIFFClientdata(tif); 377. TIFFReadWriteProc proc = TIFFGetWriteProc(tif); 378. if (proc) ^ 379. return proc(client, data, size); 380. return -1; tools/tiff2pdf.c:380:2: 378. if (proc) 379. return proc(client, data, size); 380. return -1; ^ 381. } 382. tools/tiff2pdf.c:381:1: return from a call to t2pWriteFile 379. return proc(client, data, size); 380. return -1; 381. } ^ 382. 383. static uint64 tools/tiff2pdf.c:3791:2: 3789. written += t2pWriteFile(output, (tdata_t)"\n%\342\343\317\323\n", 7); 3790. 3791. return(written); ^ 3792. } 3793. tools/tiff2pdf.c:3792:1: return from a call to t2p_write_pdf_header 3790. 3791. return(written); 3792. } ^ 3793. 3794. /* tools/tiff2pdf.c:5443:2: 5441. t2p->pdf_pages=3; 5442. written += t2p_write_pdf_header(t2p, output); 5443. t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written; ^ 5444. t2p->pdf_catalog=t2p->pdf_xrefcount; 5445. written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output); tools/tiff2pdf.c:5444:2: 5442. written += t2p_write_pdf_header(t2p, output); 5443. t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written; 5444. t2p->pdf_catalog=t2p->pdf_xrefcount; ^ 5445. written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output); 5446. written += t2p_write_pdf_catalog(t2p, output); tools/tiff2pdf.c:5445:2: 5443. t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written; 5444. t2p->pdf_catalog=t2p->pdf_xrefcount; 5445. written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output); ^ 5446. written += t2p_write_pdf_catalog(t2p, output); 5447. written += t2p_write_pdf_obj_end(output); tools/tiff2pdf.c:3798:1: start of procedure t2p_write_pdf_obj_start() 3796. */ 3797. 3798. tsize_t t2p_write_pdf_obj_start(uint32 number, TIFF* output){ ^ 3799. 3800. tsize_t written=0; tools/tiff2pdf.c:3800:2: 3798. tsize_t t2p_write_pdf_obj_start(uint32 number, TIFF* output){ 3799. 3800. tsize_t written=0; ^ 3801. char buffer[32]; 3802. int buflen=0; tools/tiff2pdf.c:3802:2: 3800. tsize_t written=0; 3801. char buffer[32]; 3802. int buflen=0; ^ 3803. 3804. buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number); tools/tiff2pdf.c:3804:2: 3802. int buflen=0; 3803. 3804. buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number); ^ 3805. check_snprintf_ret((T2P*)NULL, buflen, buffer); 3806. written += t2pWriteFile(output, (tdata_t) buffer, buflen ); tools/tiff2pdf.c:3805:2: Taking false branch 3803. 3804. buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number); 3805. check_snprintf_ret((T2P*)NULL, buflen, buffer); ^ 3806. written += t2pWriteFile(output, (tdata_t) buffer, buflen ); 3807. written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7); tools/tiff2pdf.c:3805:2: Taking false branch 3803. 3804. buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number); 3805. check_snprintf_ret((T2P*)NULL, buflen, buffer); ^ 3806. written += t2pWriteFile(output, (tdata_t) buffer, buflen ); 3807. written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7); tools/tiff2pdf.c:3806:2: 3804. buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number); 3805. check_snprintf_ret((T2P*)NULL, buflen, buffer); 3806. written += t2pWriteFile(output, (tdata_t) buffer, buflen ); ^ 3807. written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7); 3808. tools/tiff2pdf.c:373:1: start of procedure t2pWriteFile() 371. #endif /* OJPEG_SUPPORT */ 372. 373. static tmsize_t ^ 374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size) 375. { tools/tiff2pdf.c:376:2: 374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size) 375. { 376. thandle_t client = TIFFClientdata(tif); ^ 377. TIFFReadWriteProc proc = TIFFGetWriteProc(tif); 378. if (proc) libtiff/tif_open.c:536:1: start of procedure TIFFClientdata() 534. * Return open file's clientdata. 535. */ 536. thandle_t ^ 537. TIFFClientdata(TIFF* tif) 538. { libtiff/tif_open.c:539:2: 537. TIFFClientdata(TIFF* tif) 538. { 539. return (tif->tif_clientdata); ^ 540. } 541. libtiff/tif_open.c:540:1: return from a call to TIFFClientdata 538. { 539. return (tif->tif_clientdata); 540. } ^ 541. 542. /* tools/tiff2pdf.c:377:2: 375. { 376. thandle_t client = TIFFClientdata(tif); 377. TIFFReadWriteProc proc = TIFFGetWriteProc(tif); ^ 378. if (proc) 379. return proc(client, data, size); libtiff/tif_open.c:667:1: start of procedure TIFFGetWriteProc() 665. * Return pointer to file write method. 666. */ 667. TIFFReadWriteProc ^ 668. TIFFGetWriteProc(TIFF* tif) 669. { libtiff/tif_open.c:670:2: 668. TIFFGetWriteProc(TIFF* tif) 669. { 670. return (tif->tif_writeproc); ^ 671. } 672. libtiff/tif_open.c:671:1: return from a call to TIFFGetWriteProc 669. { 670. return (tif->tif_writeproc); 671. } ^ 672. 673. /* tools/tiff2pdf.c:378:6: Taking false branch 376. thandle_t client = TIFFClientdata(tif); 377. TIFFReadWriteProc proc = TIFFGetWriteProc(tif); 378. if (proc) ^ 379. return proc(client, data, size); 380. return -1; tools/tiff2pdf.c:380:2: 378. if (proc) 379. return proc(client, data, size); 380. return -1; ^ 381. } 382. tools/tiff2pdf.c:381:1: return from a call to t2pWriteFile 379. return proc(client, data, size); 380. return -1; 381. } ^ 382. 383. static uint64 tools/tiff2pdf.c:3807:2: 3805. check_snprintf_ret((T2P*)NULL, buflen, buffer); 3806. written += t2pWriteFile(output, (tdata_t) buffer, buflen ); 3807. written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7); ^ 3808. 3809. return(written); tools/tiff2pdf.c:373:1: start of procedure t2pWriteFile() 371. #endif /* OJPEG_SUPPORT */ 372. 373. static tmsize_t ^ 374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size) 375. { tools/tiff2pdf.c:376:2: 374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size) 375. { 376. thandle_t client = TIFFClientdata(tif); ^ 377. TIFFReadWriteProc proc = TIFFGetWriteProc(tif); 378. if (proc) libtiff/tif_open.c:536:1: start of procedure TIFFClientdata() 534. * Return open file's clientdata. 535. */ 536. thandle_t ^ 537. TIFFClientdata(TIFF* tif) 538. { libtiff/tif_open.c:539:2: 537. TIFFClientdata(TIFF* tif) 538. { 539. return (tif->tif_clientdata); ^ 540. } 541. libtiff/tif_open.c:540:1: return from a call to TIFFClientdata 538. { 539. return (tif->tif_clientdata); 540. } ^ 541. 542. /* tools/tiff2pdf.c:377:2: 375. { 376. thandle_t client = TIFFClientdata(tif); 377. TIFFReadWriteProc proc = TIFFGetWriteProc(tif); ^ 378. if (proc) 379. return proc(client, data, size); libtiff/tif_open.c:667:1: start of procedure TIFFGetWriteProc() 665. * Return pointer to file write method. 666. */ 667. TIFFReadWriteProc ^ 668. TIFFGetWriteProc(TIFF* tif) 669. { libtiff/tif_open.c:670:2: 668. TIFFGetWriteProc(TIFF* tif) 669. { 670. return (tif->tif_writeproc); ^ 671. } 672. libtiff/tif_open.c:671:1: return from a call to TIFFGetWriteProc 669. { 670. return (tif->tif_writeproc); 671. } ^ 672. 673. /* tools/tiff2pdf.c:378:6: Taking false branch 376. thandle_t client = TIFFClientdata(tif); 377. TIFFReadWriteProc proc = TIFFGetWriteProc(tif); 378. if (proc) ^ 379. return proc(client, data, size); 380. return -1; tools/tiff2pdf.c:380:2: 378. if (proc) 379. return proc(client, data, size); 380. return -1; ^ 381. } 382. tools/tiff2pdf.c:381:1: return from a call to t2pWriteFile 379. return proc(client, data, size); 380. return -1; 381. } ^ 382. 383. static uint64 tools/tiff2pdf.c:3809:2: 3807. written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7); 3808. 3809. return(written); ^ 3810. } 3811. tools/tiff2pdf.c:3810:1: return from a call to t2p_write_pdf_obj_start 3808. 3809. return(written); 3810. } ^ 3811. 3812. /* tools/tiff2pdf.c:5446:2: 5444. t2p->pdf_catalog=t2p->pdf_xrefcount; 5445. written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output); 5446. written += t2p_write_pdf_catalog(t2p, output); ^ 5447. written += t2p_write_pdf_obj_end(output); 5448. t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written; tools/tiff2pdf.c:4087:1: start of procedure t2p_write_pdf_catalog() 4085. */ 4086. 4087. tsize_t t2p_write_pdf_catalog(T2P* t2p, TIFF* output) ^ 4088. { 4089. tsize_t written = 0; tools/tiff2pdf.c:4089:2: 4087. tsize_t t2p_write_pdf_catalog(T2P* t2p, TIFF* output) 4088. { 4089. tsize_t written = 0; ^ 4090. char buffer[32]; 4091. int buflen = 0; tools/tiff2pdf.c:4091:2: 4089. tsize_t written = 0; 4090. char buffer[32]; 4091. int buflen = 0; ^ 4092. 4093. written += t2pWriteFile(output, tools/tiff2pdf.c:4093:2: 4091. int buflen = 0; 4092. 4093. written += t2pWriteFile(output, ^ 4094. (tdata_t)"<< \n/Type /Catalog \n/Pages ", 4095. 27); tools/tiff2pdf.c:373:1: start of procedure t2pWriteFile() 371. #endif /* OJPEG_SUPPORT */ 372. 373. static tmsize_t ^ 374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size) 375. { tools/tiff2pdf.c:376:2: 374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size) 375. { 376. thandle_t client = TIFFClientdata(tif); ^ 377. TIFFReadWriteProc proc = TIFFGetWriteProc(tif); 378. if (proc) libtiff/tif_open.c:536:1: start of procedure TIFFClientdata() 534. * Return open file's clientdata. 535. */ 536. thandle_t ^ 537. TIFFClientdata(TIFF* tif) 538. { libtiff/tif_open.c:539:2: 537. TIFFClientdata(TIFF* tif) 538. { 539. return (tif->tif_clientdata); ^ 540. } 541. libtiff/tif_open.c:540:1: return from a call to TIFFClientdata 538. { 539. return (tif->tif_clientdata); 540. } ^ 541. 542. /* tools/tiff2pdf.c:377:2: 375. { 376. thandle_t client = TIFFClientdata(tif); 377. TIFFReadWriteProc proc = TIFFGetWriteProc(tif); ^ 378. if (proc) 379. return proc(client, data, size); libtiff/tif_open.c:667:1: start of procedure TIFFGetWriteProc() 665. * Return pointer to file write method. 666. */ 667. TIFFReadWriteProc ^ 668. TIFFGetWriteProc(TIFF* tif) 669. { libtiff/tif_open.c:670:2: 668. TIFFGetWriteProc(TIFF* tif) 669. { 670. return (tif->tif_writeproc); ^ 671. } 672. libtiff/tif_open.c:671:1: return from a call to TIFFGetWriteProc 669. { 670. return (tif->tif_writeproc); 671. } ^ 672. 673. /* tools/tiff2pdf.c:378:6: Taking false branch 376. thandle_t client = TIFFClientdata(tif); 377. TIFFReadWriteProc proc = TIFFGetWriteProc(tif); 378. if (proc) ^ 379. return proc(client, data, size); 380. return -1; tools/tiff2pdf.c:380:2: 378. if (proc) 379. return proc(client, data, size); 380. return -1; ^ 381. } 382. tools/tiff2pdf.c:381:1: return from a call to t2pWriteFile 379. return proc(client, data, size); 380. return -1; 381. } ^ 382. 383. static uint64 tools/tiff2pdf.c:4096:2: 4094. (tdata_t)"<< \n/Type /Catalog \n/Pages ", 4095. 27); 4096. buflen = snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_pages); ^ 4097. check_snprintf_ret(t2p, buflen, buffer); 4098. written += t2pWriteFile(output, (tdata_t) buffer, tools/tiff2pdf.c:4097:2: Taking false branch 4095. 27); 4096. buflen = snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_pages); 4097. check_snprintf_ret(t2p, buflen, buffer); ^ 4098. written += t2pWriteFile(output, (tdata_t) buffer, 4099. TIFFmin((size_t)buflen, sizeof(buffer) - 1)); tools/tiff2pdf.c:4097:2: Taking false branch 4095. 27); 4096. buflen = snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_pages); 4097. check_snprintf_ret(t2p, buflen, buffer); ^ 4098. written += t2pWriteFile(output, (tdata_t) buffer, 4099. TIFFmin((size_t)buflen, sizeof(buffer) - 1)); tools/tiff2pdf.c:4099:5: Condition is false 4097. check_snprintf_ret(t2p, buflen, buffer); 4098. written += t2pWriteFile(output, (tdata_t) buffer, 4099. TIFFmin((size_t)buflen, sizeof(buffer) - 1)); ^ 4100. written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6); 4101. if(t2p->pdf_fitwindow){ tools/tiff2pdf.c:4098:2: 4096. buflen = snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_pages); 4097. check_snprintf_ret(t2p, buflen, buffer); 4098. written += t2pWriteFile(output, (tdata_t) buffer, ^ 4099. TIFFmin((size_t)buflen, sizeof(buffer) - 1)); 4100. written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6); tools/tiff2pdf.c:373:1: start of procedure t2pWriteFile() 371. #endif /* OJPEG_SUPPORT */ 372. 373. static tmsize_t ^ 374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size) 375. { tools/tiff2pdf.c:376:2: 374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size) 375. { 376. thandle_t client = TIFFClientdata(tif); ^ 377. TIFFReadWriteProc proc = TIFFGetWriteProc(tif); 378. if (proc) libtiff/tif_open.c:536:1: start of procedure TIFFClientdata() 534. * Return open file's clientdata. 535. */ 536. thandle_t ^ 537. TIFFClientdata(TIFF* tif) 538. { libtiff/tif_open.c:539:2: 537. TIFFClientdata(TIFF* tif) 538. { 539. return (tif->tif_clientdata); ^ 540. } 541. libtiff/tif_open.c:540:1: return from a call to TIFFClientdata 538. { 539. return (tif->tif_clientdata); 540. } ^ 541. 542. /* tools/tiff2pdf.c:377:2: 375. { 376. thandle_t client = TIFFClientdata(tif); 377. TIFFReadWriteProc proc = TIFFGetWriteProc(tif); ^ 378. if (proc) 379. return proc(client, data, size); libtiff/tif_open.c:667:1: start of procedure TIFFGetWriteProc() 665. * Return pointer to file write method. 666. */ 667. TIFFReadWriteProc ^ 668. TIFFGetWriteProc(TIFF* tif) 669. { libtiff/tif_open.c:670:2: 668. TIFFGetWriteProc(TIFF* tif) 669. { 670. return (tif->tif_writeproc); ^ 671. } 672. libtiff/tif_open.c:671:1: return from a call to TIFFGetWriteProc 669. { 670. return (tif->tif_writeproc); 671. } ^ 672. 673. /* tools/tiff2pdf.c:378:6: Taking false branch 376. thandle_t client = TIFFClientdata(tif); 377. TIFFReadWriteProc proc = TIFFGetWriteProc(tif); 378. if (proc) ^ 379. return proc(client, data, size); 380. return -1; tools/tiff2pdf.c:380:2: 378. if (proc) 379. return proc(client, data, size); 380. return -1; ^ 381. } 382. tools/tiff2pdf.c:381:1: return from a call to t2pWriteFile 379. return proc(client, data, size); 380. return -1; 381. } ^ 382. 383. static uint64 tools/tiff2pdf.c:4100:2: 4098. written += t2pWriteFile(output, (tdata_t) buffer, 4099. TIFFmin((size_t)buflen, sizeof(buffer) - 1)); 4100. written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6); ^ 4101. if(t2p->pdf_fitwindow){ 4102. written += t2pWriteFile(output, tools/tiff2pdf.c:373:1: start of procedure t2pWriteFile() 371. #endif /* OJPEG_SUPPORT */ 372. 373. static tmsize_t ^ 374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size) 375. { tools/tiff2pdf.c:376:2: 374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size) 375. { 376. thandle_t client = TIFFClientdata(tif); ^ 377. TIFFReadWriteProc proc = TIFFGetWriteProc(tif); 378. if (proc) libtiff/tif_open.c:536:1: start of procedure TIFFClientdata() 534. * Return open file's clientdata. 535. */ 536. thandle_t ^ 537. TIFFClientdata(TIFF* tif) 538. { libtiff/tif_open.c:539:2: 537. TIFFClientdata(TIFF* tif) 538. { 539. return (tif->tif_clientdata); ^ 540. } 541. libtiff/tif_open.c:540:1: return from a call to TIFFClientdata 538. { 539. return (tif->tif_clientdata); 540. } ^ 541. 542. /* tools/tiff2pdf.c:377:2: 375. { 376. thandle_t client = TIFFClientdata(tif); 377. TIFFReadWriteProc proc = TIFFGetWriteProc(tif); ^ 378. if (proc) 379. return proc(client, data, size); libtiff/tif_open.c:667:1: start of procedure TIFFGetWriteProc() 665. * Return pointer to file write method. 666. */ 667. TIFFReadWriteProc ^ 668. TIFFGetWriteProc(TIFF* tif) 669. { libtiff/tif_open.c:670:2: 668. TIFFGetWriteProc(TIFF* tif) 669. { 670. return (tif->tif_writeproc); ^ 671. } 672. libtiff/tif_open.c:671:1: return from a call to TIFFGetWriteProc 669. { 670. return (tif->tif_writeproc); 671. } ^ 672. 673. /* tools/tiff2pdf.c:378:6: Taking false branch 376. thandle_t client = TIFFClientdata(tif); 377. TIFFReadWriteProc proc = TIFFGetWriteProc(tif); 378. if (proc) ^ 379. return proc(client, data, size); 380. return -1; tools/tiff2pdf.c:380:2: 378. if (proc) 379. return proc(client, data, size); 380. return -1; ^ 381. } 382. tools/tiff2pdf.c:381:1: return from a call to t2pWriteFile 379. return proc(client, data, size); 380. return -1; 381. } ^ 382. 383. static uint64 tools/tiff2pdf.c:4101:5: Taking true branch 4099. TIFFmin((size_t)buflen, sizeof(buffer) - 1)); 4100. written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6); 4101. if(t2p->pdf_fitwindow){ ^ 4102. written += t2pWriteFile(output, 4103. (tdata_t) "/ViewerPreferences <</FitWindow true>>\n", tools/tiff2pdf.c:4102:3: 4100. written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6); 4101. if(t2p->pdf_fitwindow){ 4102. written += t2pWriteFile(output, ^ 4103. (tdata_t) "/ViewerPreferences <</FitWindow true>>\n", 4104. 39); tools/tiff2pdf.c:373:1: start of procedure t2pWriteFile() 371. #endif /* OJPEG_SUPPORT */ 372. 373. static tmsize_t ^ 374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size) 375. { tools/tiff2pdf.c:376:2: 374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size) 375. { 376. thandle_t client = TIFFClientdata(tif); ^ 377. TIFFReadWriteProc proc = TIFFGetWriteProc(tif); 378. if (proc) libtiff/tif_open.c:536:1: start of procedure TIFFClientdata() 534. * Return open file's clientdata. 535. */ 536. thandle_t ^ 537. TIFFClientdata(TIFF* tif) 538. { libtiff/tif_open.c:539:2: 537. TIFFClientdata(TIFF* tif) 538. { 539. return (tif->tif_clientdata); ^ 540. } 541. libtiff/tif_open.c:540:1: return from a call to TIFFClientdata 538. { 539. return (tif->tif_clientdata); 540. } ^ 541. 542. /* tools/tiff2pdf.c:377:2: 375. { 376. thandle_t client = TIFFClientdata(tif); 377. TIFFReadWriteProc proc = TIFFGetWriteProc(tif); ^ 378. if (proc) 379. return proc(client, data, size); libtiff/tif_open.c:667:1: start of procedure TIFFGetWriteProc() 665. * Return pointer to file write method. 666. */ 667. TIFFReadWriteProc ^ 668. TIFFGetWriteProc(TIFF* tif) 669. { libtiff/tif_open.c:670:2: 668. TIFFGetWriteProc(TIFF* tif) 669. { 670. return (tif->tif_writeproc); ^ 671. } 672. libtiff/tif_open.c:671:1: return from a call to TIFFGetWriteProc 669. { 670. return (tif->tif_writeproc); 671. } ^ 672. 673. /* tools/tiff2pdf.c:378:6: Taking false branch 376. thandle_t client = TIFFClientdata(tif); 377. TIFFReadWriteProc proc = TIFFGetWriteProc(tif); 378. if (proc) ^ 379. return proc(client, data, size); 380. return -1; tools/tiff2pdf.c:380:2: 378. if (proc) 379. return proc(client, data, size); 380. return -1; ^ 381. } 382. tools/tiff2pdf.c:381:1: return from a call to t2pWriteFile 379. return proc(client, data, size); 380. return -1; 381. } ^ 382. 383. static uint64 tools/tiff2pdf.c:4106:2: 4104. 39); 4105. } 4106. written += t2pWriteFile(output, (tdata_t)">>\n", 3); ^ 4107. 4108. return(written); tools/tiff2pdf.c:373:1: start of procedure t2pWriteFile() 371. #endif /* OJPEG_SUPPORT */ 372. 373. static tmsize_t ^ 374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size) 375. { tools/tiff2pdf.c:376:2: 374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size) 375. { 376. thandle_t client = TIFFClientdata(tif); ^ 377. TIFFReadWriteProc proc = TIFFGetWriteProc(tif); 378. if (proc) libtiff/tif_open.c:536:1: start of procedure TIFFClientdata() 534. * Return open file's clientdata. 535. */ 536. thandle_t ^ 537. TIFFClientdata(TIFF* tif) 538. { libtiff/tif_open.c:539:2: 537. TIFFClientdata(TIFF* tif) 538. { 539. return (tif->tif_clientdata); ^ 540. } 541. libtiff/tif_open.c:540:1: return from a call to TIFFClientdata 538. { 539. return (tif->tif_clientdata); 540. } ^ 541. 542. /* tools/tiff2pdf.c:377:2: 375. { 376. thandle_t client = TIFFClientdata(tif); 377. TIFFReadWriteProc proc = TIFFGetWriteProc(tif); ^ 378. if (proc) 379. return proc(client, data, size); libtiff/tif_open.c:667:1: start of procedure TIFFGetWriteProc() 665. * Return pointer to file write method. 666. */ 667. TIFFReadWriteProc ^ 668. TIFFGetWriteProc(TIFF* tif) 669. { libtiff/tif_open.c:670:2: 668. TIFFGetWriteProc(TIFF* tif) 669. { 670. return (tif->tif_writeproc); ^ 671. } 672. libtiff/tif_open.c:671:1: return from a call to TIFFGetWriteProc 669. { 670. return (tif->tif_writeproc); 671. } ^ 672. 673. /* tools/tiff2pdf.c:378:6: Taking false branch 376. thandle_t client = TIFFClientdata(tif); 377. TIFFReadWriteProc proc = TIFFGetWriteProc(tif); 378. if (proc) ^ 379. return proc(client, data, size); 380. return -1; tools/tiff2pdf.c:380:2: 378. if (proc) 379. return proc(client, data, size); 380. return -1; ^ 381. } 382. tools/tiff2pdf.c:381:1: return from a call to t2pWriteFile 379. return proc(client, data, size); 380. return -1; 381. } ^ 382. 383. static uint64 tools/tiff2pdf.c:4108:2: 4106. written += t2pWriteFile(output, (tdata_t)">>\n", 3); 4107. 4108. return(written); ^ 4109. } 4110. tools/tiff2pdf.c:4109:1: return from a call to t2p_write_pdf_catalog 4107. 4108. return(written); 4109. } ^ 4110. 4111. /* tools/tiff2pdf.c:5447:2: 5445. written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output); 5446. written += t2p_write_pdf_catalog(t2p, output); 5447. written += t2p_write_pdf_obj_end(output); ^ 5448. t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written; 5449. t2p->pdf_info=t2p->pdf_xrefcount; tools/tiff2pdf.c:3816:1: start of procedure t2p_write_pdf_obj_end() 3814. */ 3815. 3816. tsize_t t2p_write_pdf_obj_end(TIFF* output){ ^ 3817. 3818. tsize_t written=0; tools/tiff2pdf.c:3818:2: 3816. tsize_t t2p_write_pdf_obj_end(TIFF* output){ 3817. 3818. tsize_t written=0; ^ 3819. 3820. written += t2pWriteFile(output, (tdata_t) "endobj\n", 7); tools/tiff2pdf.c:3820:2: 3818. tsize_t written=0; 3819. 3820. written += t2pWriteFile(output, (tdata_t) "endobj\n", 7); ^ 3821. 3822. return(written); tools/tiff2pdf.c:373:1: start of procedure t2pWriteFile() 371. #endif /* OJPEG_SUPPORT */ 372. 373. static tmsize_t ^ 374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size) 375. { tools/tiff2pdf.c:376:2: 374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size) 375. { 376. thandle_t client = TIFFClientdata(tif); ^ 377. TIFFReadWriteProc proc = TIFFGetWriteProc(tif); 378. if (proc) libtiff/tif_open.c:536:1: start of procedure TIFFClientdata() 534. * Return open file's clientdata. 535. */ 536. thandle_t ^ 537. TIFFClientdata(TIFF* tif) 538. { libtiff/tif_open.c:539:2: 537. TIFFClientdata(TIFF* tif) 538. { 539. return (tif->tif_clientdata); ^ 540. } 541. libtiff/tif_open.c:540:1: return from a call to TIFFClientdata 538. { 539. return (tif->tif_clientdata); 540. } ^ 541. 542. /* tools/tiff2pdf.c:377:2: 375. { 376. thandle_t client = TIFFClientdata(tif); 377. TIFFReadWriteProc proc = TIFFGetWriteProc(tif); ^ 378. if (proc) 379. return proc(client, data, size); libtiff/tif_open.c:667:1: start of procedure TIFFGetWriteProc() 665. * Return pointer to file write method. 666. */ 667. TIFFReadWriteProc ^ 668. TIFFGetWriteProc(TIFF* tif) 669. { libtiff/tif_open.c:670:2: 668. TIFFGetWriteProc(TIFF* tif) 669. { 670. return (tif->tif_writeproc); ^ 671. } 672. libtiff/tif_open.c:671:1: return from a call to TIFFGetWriteProc 669. { 670. return (tif->tif_writeproc); 671. } ^ 672. 673. /* tools/tiff2pdf.c:378:6: Taking false branch 376. thandle_t client = TIFFClientdata(tif); 377. TIFFReadWriteProc proc = TIFFGetWriteProc(tif); 378. if (proc) ^ 379. return proc(client, data, size); 380. return -1; tools/tiff2pdf.c:380:2: 378. if (proc) 379. return proc(client, data, size); 380. return -1; ^ 381. } 382. tools/tiff2pdf.c:381:1: return from a call to t2pWriteFile 379. return proc(client, data, size); 380. return -1; 381. } ^ 382. 383. static uint64 tools/tiff2pdf.c:3822:2: 3820. written += t2pWriteFile(output, (tdata_t) "endobj\n", 7); 3821. 3822. return(written); ^ 3823. } 3824. tools/tiff2pdf.c:3823:1: return from a call to t2p_write_pdf_obj_end 3821. 3822. return(written); 3823. } ^ 3824. 3825. /* tools/tiff2pdf.c:5448:2: 5446. written += t2p_write_pdf_catalog(t2p, output); 5447. written += t2p_write_pdf_obj_end(output); 5448. t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written; ^ 5449. t2p->pdf_info=t2p->pdf_xrefcount; 5450. written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output); tools/tiff2pdf.c:5449:2: 5447. written += t2p_write_pdf_obj_end(output); 5448. t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written; 5449. t2p->pdf_info=t2p->pdf_xrefcount; ^ 5450. written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output); 5451. written += t2p_write_pdf_info(t2p, input, output); tools/tiff2pdf.c:5450:2: 5448. t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written; 5449. t2p->pdf_info=t2p->pdf_xrefcount; 5450. written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output); ^ 5451. written += t2p_write_pdf_info(t2p, input, output); 5452. written += t2p_write_pdf_obj_end(output); tools/tiff2pdf.c:3798:1: start of procedure t2p_write_pdf_obj_start() 3796. */ 3797. 3798. tsize_t t2p_write_pdf_obj_start(uint32 number, TIFF* output){ ^ 3799. 3800. tsize_t written=0; tools/tiff2pdf.c:3800:2: 3798. tsize_t t2p_write_pdf_obj_start(uint32 number, TIFF* output){ 3799. 3800. tsize_t written=0; ^ 3801. char buffer[32]; 3802. int buflen=0; tools/tiff2pdf.c:3802:2: 3800. tsize_t written=0; 3801. char buffer[32]; 3802. int buflen=0; ^ 3803. 3804. buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number); tools/tiff2pdf.c:3804:2: 3802. int buflen=0; 3803. 3804. buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number); ^ 3805. check_snprintf_ret((T2P*)NULL, buflen, buffer); 3806. written += t2pWriteFile(output, (tdata_t) buffer, buflen ); tools/tiff2pdf.c:3805:2: Taking false branch 3803. 3804. buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number); 3805. check_snprintf_ret((T2P*)NULL, buflen, buffer); ^ 3806. written += t2pWriteFile(output, (tdata_t) buffer, buflen ); 3807. written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7); tools/tiff2pdf.c:3805:2: Taking false branch 3803. 3804. buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number); 3805. check_snprintf_ret((T2P*)NULL, buflen, buffer); ^ 3806. written += t2pWriteFile(output, (tdata_t) buffer, buflen ); 3807. written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7); tools/tiff2pdf.c:3806:2: 3804. buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number); 3805. check_snprintf_ret((T2P*)NULL, buflen, buffer); 3806. written += t2pWriteFile(output, (tdata_t) buffer, buflen ); ^ 3807. written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7); 3808. tools/tiff2pdf.c:373:1: start of procedure t2pWriteFile() 371. #endif /* OJPEG_SUPPORT */ 372. 373. static tmsize_t ^ 374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size) 375. { tools/tiff2pdf.c:376:2: 374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size) 375. { 376. thandle_t client = TIFFClientdata(tif); ^ 377. TIFFReadWriteProc proc = TIFFGetWriteProc(tif); 378. if (proc) libtiff/tif_open.c:536:1: start of procedure TIFFClientdata() 534. * Return open file's clientdata. 535. */ 536. thandle_t ^ 537. TIFFClientdata(TIFF* tif) 538. { libtiff/tif_open.c:539:2: 537. TIFFClientdata(TIFF* tif) 538. { 539. return (tif->tif_clientdata); ^ 540. } 541. libtiff/tif_open.c:540:1: return from a call to TIFFClientdata 538. { 539. return (tif->tif_clientdata); 540. } ^ 541. 542. /* tools/tiff2pdf.c:377:2: 375. { 376. thandle_t client = TIFFClientdata(tif); 377. TIFFReadWriteProc proc = TIFFGetWriteProc(tif); ^ 378. if (proc) 379. return proc(client, data, size); libtiff/tif_open.c:667:1: start of procedure TIFFGetWriteProc() 665. * Return pointer to file write method. 666. */ 667. TIFFReadWriteProc ^ 668. TIFFGetWriteProc(TIFF* tif) 669. { libtiff/tif_open.c:670:2: 668. TIFFGetWriteProc(TIFF* tif) 669. { 670. return (tif->tif_writeproc); ^ 671. } 672. libtiff/tif_open.c:671:1: return from a call to TIFFGetWriteProc 669. { 670. return (tif->tif_writeproc); 671. } ^ 672. 673. /* tools/tiff2pdf.c:378:6: Taking false branch 376. thandle_t client = TIFFClientdata(tif); 377. TIFFReadWriteProc proc = TIFFGetWriteProc(tif); 378. if (proc) ^ 379. return proc(client, data, size); 380. return -1; tools/tiff2pdf.c:380:2: 378. if (proc) 379. return proc(client, data, size); 380. return -1; ^ 381. } 382. tools/tiff2pdf.c:381:1: return from a call to t2pWriteFile 379. return proc(client, data, size); 380. return -1; 381. } ^ 382. 383. static uint64 tools/tiff2pdf.c:3807:2: 3805. check_snprintf_ret((T2P*)NULL, buflen, buffer); 3806. written += t2pWriteFile(output, (tdata_t) buffer, buflen ); 3807. written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7); ^ 3808. 3809. return(written); tools/tiff2pdf.c:373:1: start of procedure t2pWriteFile() 371. #endif /* OJPEG_SUPPORT */ 372. 373. static tmsize_t ^ 374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size) 375. { tools/tiff2pdf.c:376:2: 374. t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size) 375. { 376. thandle_t client = TIFFClientdata(tif); ^ 377. TIFFReadWriteProc proc = TIFFGetWriteProc(tif); 378. if (proc) libtiff/tif_open.c:536:1: start of procedure TIFFClientdata() 534. * Return open file's clientdata. 535. */ 536. thandle_t ^ 537. TIFFClientdata(TIFF* tif) 538. { libtiff/tif_open.c:539:2: 537. TIFFClientdata(TIFF* tif) 538. { 539. return (tif->tif_clientdata); ^ 540. } 541. libtiff/tif_open.c:540:1: return from a call to TIFFClientdata 538. { 539. return (tif->tif_clientdata); 540. } ^ 541. 542. /* tools/tiff2pdf.c:377:2: 375. { 376. thandle_t client = TIFFClientdata(tif); 377. TIFFReadWriteProc proc = TIFFGetWriteProc(tif); ^ 378. if (proc) 379. return proc(client, data, size); libtiff/tif_open.c:667:1: start of procedure TIFFGetWriteProc() 665. * Return pointer to file write method. 666. */ 667. TIFFReadWriteProc ^ 668. TIFFGetWriteProc(TIFF* tif) 669. { libtiff/tif_open.c:670:2: 668. TIFFGetWriteProc(TIFF* tif) 669. { 670. return (tif->tif_writeproc); ^ 671. } 672. libtiff/tif_open.c:671:1: return from a call to TIFFGetWriteProc 669. { 670. return (tif->tif_writeproc); 671. } ^ 672. 673. /* tools/tiff2pdf.c:378:6: Taking false branch 376. thandle_t client = TIFFClientdata(tif); 377. TIFFReadWriteProc proc = TIFFGetWriteProc(tif); 378. if (proc) ^ 379. return proc(client, data, size); 380. return -1; tools/tiff2pdf.c:380:2: 378. if (proc) 379. return proc(client, data, size); 380. return -1; ^ 381. } 382. tools/tiff2pdf.c:381:1: return from a call to t2pWriteFile 379. return proc(client, data, size); 380. return -1; 381. } ^ 382. 383. static uint64 tools/tiff2pdf.c:3809:2: 3807. written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7); 3808. 3809. return(written); ^ 3810. } 3811. tools/tiff2pdf.c:3810:1: return from a call to t2p_write_pdf_obj_start 3808. 3809. return(written); 3810. } ^ 3811. 3812. /* tools/tiff2pdf.c:5451:2: Skipping t2p_write_pdf_info(): empty list of specs 5449. t2p->pdf_info=t2p->pdf_xrefcount; 5450. written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output); 5451. written += t2p_write_pdf_info(t2p, input, output); ^ 5452. written += t2p_write_pdf_obj_end(output); 5453. t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written;
https://gitlab.com/libtiff/libtiff/blob/6dac309a9701d15ac52d895d566ddae2ed49db9b/tools/tiff2pdf.c/#L5451
d2a_code_trace_data_44226
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/bn/bntest.c:1326: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `BN_GF2m_mod_inv`. Showing all 11 steps of the trace crypto/bn/bntest.c:1305:1: Parameter `ctx->stack.depth` 1303. } 1304. 1305. > int test_gf2m_mod_inv(BIO *bp,BN_CTX *ctx) 1306. { 1307. BIGNUM *a,*b[2],*c,*d; crypto/bn/bntest.c:1326:4: Call 1324. for (j=0; j < 2; j++) 1325. { 1326. BN_GF2m_mod_inv(c, a, b[j], ctx); ^ 1327. BN_GF2m_mod_mul(d, a, c, b[j], ctx); 1328. #if 0 /* make test uses ouput in bc but bc can't handle GF(2^m) arithmetic */ crypto/bn/bn_gf2m.c:525:1: Parameter `ctx->stack.depth` 523. * of Elliptic Curve Cryptography Over Binary Fields". 524. */ 525. > int BN_GF2m_mod_inv(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) 526. { 527. BIGNUM *b, *c, *u, *v, *tmp; crypto/bn/bn_gf2m.c:533:2: Call 531. bn_check_top(p); 532. 533. BN_CTX_start(ctx); ^ 534. 535. if ((b = BN_CTX_get(ctx))==NULL) goto err; crypto/bn/bn_ctx.c:257:1: Parameter `ctx->stack.depth` 255. } 256. 257. > void BN_CTX_start(BN_CTX *ctx) 258. { 259. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_gf2m.c:645:4: Call 643. 644. err: 645. BN_CTX_end(ctx); ^ 646. return ret; 647. } crypto/bn/bn_ctx.c:272:1: Parameter `ctx->stack.depth` 270. } 271. 272. > void BN_CTX_end(BN_CTX *ctx) 273. { 274. CTXDBG_ENTRY("BN_CTX_end", ctx); crypto/bn/bn_ctx.c:279:21: Call 277. else 278. { 279. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 280. /* Does this stack frame have anything to release? */ 281. if(fp < ctx->used) crypto/bn/bn_ctx.c:353:1: <LHS trace> 351. } 352. 353. > static unsigned int BN_STACK_pop(BN_STACK *st) 354. { 355. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:353:1: Parameter `st->depth` 351. } 352. 353. > static unsigned int BN_STACK_pop(BN_STACK *st) 354. { 355. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:355:9: Binary operation: ([0, +oo] - 1):unsigned32 by call to `BN_GF2m_mod_inv` 353. static unsigned int BN_STACK_pop(BN_STACK *st) 354. { 355. return st->indexes[--(st->depth)]; ^ 356. } 357.
https://github.com/openssl/openssl/blob/0b59755f434eca1ed621974ae9f95663dcdcac35/crypto/bn/bn_ctx.c/#L355
d2a_code_trace_data_44227
void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) { int i, j, max; const BN_ULONG *ap; BN_ULONG *rp; max = n * 2; ap = a; rp = r; rp[0] = rp[max - 1] = 0; rp++; j = n; if (--j > 0) { ap++; rp[j] = bn_mul_words(rp, ap, j, ap[-1]); rp += 2; } for (i = n - 2; i > 0; i--) { j--; ap++; rp[j] = bn_mul_add_words(rp, ap, j, ap[-1]); rp += 2; } bn_add_words(r, r, r, max); bn_sqr_words(tmp, a, n); bn_add_words(r, r, tmp, max); } crypto/ec/ecdsa_ossl.c:243: error: BUFFER_OVERRUN_L3 Offset: [31, +oo] Size: [0, 8388607] by call to `bn_to_mont_fixed_top`. Showing all 17 steps of the trace crypto/ec/ecdsa_ossl.c:212:10: Call 210. if (8 * dgst_len > i) 211. dgst_len = (i + 7) / 8; 212. if (!BN_bin2bn(dgst, dgst_len, m)) { ^ 213. ECerr(EC_F_OSSL_ECDSA_SIGN_SIG, ERR_R_BN_LIB); 214. goto err; crypto/bn/bn_lib.c:372:1: Parameter `ret->top` 370. } 371. 372. > BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret) 373. { 374. unsigned int i, m; crypto/ec/ecdsa_ossl.c:243:14: Call 241. * below, returns user-visible value with removed zero padding. 242. */ 243. if (!bn_to_mont_fixed_top(s, ret->r, group->mont_data, ctx) ^ 244. || !bn_mul_mont_fixed_top(s, s, priv_key, group->mont_data, ctx)) { 245. ECerr(EC_F_OSSL_ECDSA_SIGN_SIG, ERR_R_BN_LIB); crypto/bn/bn_mont.c:210:1: Parameter `a->top` 208. } 209. 210. > int bn_to_mont_fixed_top(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont, 211. BN_CTX *ctx) 212. { crypto/bn/bn_mont.c:213:12: Call 211. BN_CTX *ctx) 212. { 213. return bn_mul_mont_fixed_top(r, a, &(mont->RR), mont, ctx); ^ 214. } 215. crypto/bn/bn_mont.c:37:1: Parameter `b->top` 35. } 36. 37. > int bn_mul_mont_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, 38. BN_MONT_CTX *mont, BN_CTX *ctx) 39. { crypto/bn/bn_mont.c:67:14: Call 65. bn_check_top(tmp); 66. if (a == b) { 67. if (!BN_sqr(tmp, a, ctx)) ^ 68. goto err; 69. } else { crypto/bn/bn_sqr.c:17:1: Parameter `a->top` 15. * I've just gone over this and it is now %20 faster on x86 - eay - 27 Jun 96 16. */ 17. > int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) 18. { 19. int max, al; crypto/bn/bn_sqr.c:25:5: Assignment 23. bn_check_top(a); 24. 25. al = a->top; ^ 26. if (al <= 0) { 27. r->top = 0; crypto/bn/bn_sqr.c:74:17: Call 72. if (bn_wexpand(tmp, max) == NULL) 73. goto err; 74. bn_sqr_normal(rr->d, a->d, al, tmp->d); ^ 75. } 76. } crypto/bn/bn_sqr.c:99:1: <Offset trace> 97. 98. /* tmp must have 2*n words */ 99. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 100. { 101. int i, j, max; crypto/bn/bn_sqr.c:99:1: Parameter `n` 97. 98. /* tmp must have 2*n words */ 99. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 100. { 101. int i, j, max; crypto/bn/bn_sqr.c:105:5: Assignment 103. BN_ULONG *rp; 104. 105. max = n * 2; ^ 106. ap = a; 107. rp = r; crypto/bn/bn_sqr.c:99:1: <Length trace> 97. 98. /* tmp must have 2*n words */ 99. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 100. { 101. int i, j, max; crypto/bn/bn_sqr.c:99:1: Parameter `*r` 97. 98. /* tmp must have 2*n words */ 99. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 100. { 101. int i, j, max; crypto/bn/bn_sqr.c:107:5: Assignment 105. max = n * 2; 106. ap = a; 107. rp = r; ^ 108. rp[0] = rp[max - 1] = 0; 109. rp++; crypto/bn/bn_sqr.c:108:13: Array access: Offset: [31, +oo] Size: [0, 8388607] by call to `bn_to_mont_fixed_top` 106. ap = a; 107. rp = r; 108. rp[0] = rp[max - 1] = 0; ^ 109. rp++; 110. j = n;
https://github.com/openssl/openssl/blob/4cc968df403ed9321d0df722aba33323ae575ce0/crypto/bn/bn_sqr.c/#L108
d2a_code_trace_data_44228
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:1044: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [`pkt->written`, `pkt->written` + 6]):unsigned64 by call to `WPACKET_sub_memcpy__`. Showing all 14 steps of the trace ssl/t1_lib.c:1043:21: Call 1041. if (s->renegotiate) { 1042. if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_renegotiate) 1043. || !WPACKET_start_sub_packet_u16(pkt) ^ 1044. || !WPACKET_sub_memcpy_u8(pkt, s->s3->previous_client_finished, 1045. s->s3->previous_client_finished_len) 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/t1_lib.c:1044:21: Call 1042. if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_renegotiate) 1043. || !WPACKET_start_sub_packet_u16(pkt) 1044. || !WPACKET_sub_memcpy_u8(pkt, s->s3->previous_client_finished, ^ 1045. s->s3->previous_client_finished_len) 1046. || !WPACKET_close(pkt)) { ssl/packet.c:317:1: Parameter `pkt->written` 315. } 316. 317. > int WPACKET_sub_memcpy__(WPACKET *pkt, const void *src, size_t len, 318. size_t lenbytes) 319. { 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->written` 222. } 223. 224. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes) 225. { 226. WPACKET_SUB *sub; ssl/packet.c:248:10: Call 246. } 247. 248. if (!WPACKET_allocate_bytes(pkt, lenbytes, &lenchars)) ^ 249. return 0; 250. /* 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:36:1: <LHS trace> 34. } 35. 36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 37. { 38. /* Internal API, so should not fail */ ssl/packet.c:36:1: Parameter `pkt->buf->length` 34. } 35. 36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 37. { 38. /* Internal API, so should not fail */ ssl/packet.c:36:1: <RHS trace> 34. } 35. 36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 37. { 38. /* Internal API, so should not fail */ ssl/packet.c:36:1: Parameter `len` 34. } 35. 36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 37. { 38. /* Internal API, so should not fail */ ssl/packet.c:46:9: Binary operation: ([0, +oo] - [pkt->written, pkt->written + 6]):unsigned64 by call to `WPACKET_sub_memcpy__` 44. return 0; 45. 46. if (pkt->buf->length - pkt->written < len) { ^ 47. size_t newlen; 48. size_t reflen;
https://github.com/openssl/openssl/blob/e4e1aa903e624044d3319622fc50222f1b2c7328/ssl/packet.c/#L46
d2a_code_trace_data_44229
static int opt_streamid(const char *opt, const char *arg) { int idx; char *p; char idx_str[16]; av_strlcpy(idx_str, arg, sizeof(idx_str)); p = strchr(idx_str, ':'); if (!p) { fprintf(stderr, "Invalid value '%s' for option '%s', required syntax is 'index:value'\n", arg, opt); ffmpeg_exit(1); } *p++ = '\0'; idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1); streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1); streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX); return 0; } ffmpeg.c:3712: error: Null Dereference pointer `p` last assigned on line 3712 could be null and is dereferenced at line 3712, column 5. ffmpeg.c:3698:1: start of procedure opt_streamid() 3696. 3697. /* arg format is "output-stream-index:streamid-value". */ 3698. static int opt_streamid(const char *opt, const char *arg) ^ 3699. { 3700. int idx; ffmpeg.c:3704:5: 3702. char idx_str[16]; 3703. 3704. av_strlcpy(idx_str, arg, sizeof(idx_str)); ^ 3705. p = strchr(idx_str, ':'); 3706. if (!p) { libavutil/avstring.c:64:1: start of procedure av_strlcpy() 62. } 63. 64. size_t av_strlcpy(char *dst, const char *src, size_t size) ^ 65. { 66. size_t len = 0; libavutil/avstring.c:66:5: 64. size_t av_strlcpy(char *dst, const char *src, size_t size) 65. { 66. size_t len = 0; ^ 67. while (++len < size && *src) 68. *dst++ = *src++; libavutil/avstring.c:67:12: Loop condition is true. Entering loop body 65. { 66. size_t len = 0; 67. while (++len < size && *src) ^ 68. *dst++ = *src++; 69. if (len <= size) libavutil/avstring.c:67:28: Loop condition is false. Leaving loop 65. { 66. size_t len = 0; 67. while (++len < size && *src) ^ 68. *dst++ = *src++; 69. if (len <= size) libavutil/avstring.c:69:9: Taking true branch 67. while (++len < size && *src) 68. *dst++ = *src++; 69. if (len <= size) ^ 70. *dst = 0; 71. return len + strlen(src) - 1; libavutil/avstring.c:70:9: 68. *dst++ = *src++; 69. if (len <= size) 70. *dst = 0; ^ 71. return len + strlen(src) - 1; 72. } libavutil/avstring.c:71:5: 69. if (len <= size) 70. *dst = 0; 71. return len + strlen(src) - 1; ^ 72. } 73. libavutil/avstring.c:72:1: return from a call to av_strlcpy 70. *dst = 0; 71. return len + strlen(src) - 1; 72. } ^ 73. 74. size_t av_strlcat(char *dst, const char *src, size_t size) ffmpeg.c:3705:5: 3703. 3704. av_strlcpy(idx_str, arg, sizeof(idx_str)); 3705. p = strchr(idx_str, ':'); ^ 3706. if (!p) { 3707. fprintf(stderr, ffmpeg.c:3706:10: Taking true branch 3704. av_strlcpy(idx_str, arg, sizeof(idx_str)); 3705. p = strchr(idx_str, ':'); 3706. if (!p) { ^ 3707. fprintf(stderr, 3708. "Invalid value '%s' for option '%s', required syntax is 'index:value'\n", ffmpeg.c:3707:9: 3705. p = strchr(idx_str, ':'); 3706. if (!p) { 3707. fprintf(stderr, ^ 3708. "Invalid value '%s' for option '%s', required syntax is 'index:value'\n", 3709. arg, opt); ffmpeg.c:3710:9: Skipping ffmpeg_exit(): empty list of specs 3708. "Invalid value '%s' for option '%s', required syntax is 'index:value'\n", 3709. arg, opt); 3710. ffmpeg_exit(1); ^ 3711. } 3712. *p++ = '\0'; ffmpeg.c:3712:5: 3710. ffmpeg_exit(1); 3711. } 3712. *p++ = '\0'; ^ 3713. idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1); 3714. streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1);
https://github.com/libav/libav/blob/b568d6d94bda607e4ebb35be68181a8c2a9f5c50/ffmpeg.c/#L3712
d2a_code_trace_data_44230
int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) { if (!ossl_assert(pkt->subs != NULL && len != 0)) return 0; if (pkt->maxsize - pkt->written < len) return 0; if (pkt->staticbuf == NULL && (pkt->buf->length - pkt->written < len)) { size_t newlen; size_t reflen; reflen = (len > pkt->buf->length) ? len : pkt->buf->length; if (reflen > SIZE_MAX / 2) { newlen = SIZE_MAX; } else { newlen = reflen * 2; if (newlen < DEFAULT_BUF_SIZE) newlen = DEFAULT_BUF_SIZE; } if (BUF_MEM_grow(pkt->buf, newlen) == 0) return 0; } if (allocbytes != NULL) *allocbytes = WPACKET_get_curr(pkt); return 1; } ssl/statem/extensions_srvr.c:1052: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [`pkt->written`, `pkt->written` + 14]):unsigned64 by call to `WPACKET_put_bytes__`. Showing all 12 steps of the trace ssl/statem/extensions_srvr.c:1051:17: Call 1049. || !WPACKET_start_sub_packet_u16(pkt) 1050. || !WPACKET_put_bytes_u16(pkt, 2) 1051. || !WPACKET_put_bytes_u16(pkt, s->srtp_profile->id) ^ 1052. || !WPACKET_put_bytes_u8(pkt, 0) 1053. || !WPACKET_close(pkt)) { ssl/packet.c:306:1: Parameter `pkt->buf->length` 304. } 305. 306. > int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size) 307. { 308. unsigned char *data; ssl/statem/extensions_srvr.c:1052:17: Call 1050. || !WPACKET_put_bytes_u16(pkt, 2) 1051. || !WPACKET_put_bytes_u16(pkt, s->srtp_profile->id) 1052. || !WPACKET_put_bytes_u8(pkt, 0) ^ 1053. || !WPACKET_close(pkt)) { 1054. SSLerr(SSL_F_TLS_CONSTRUCT_STOC_USE_SRTP, ERR_R_INTERNAL_ERROR); ssl/packet.c:306:1: Parameter `pkt->written` 304. } 305. 306. > int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size) 307. { 308. unsigned char *data; ssl/packet.c:312:17: Call 310. /* Internal API, so should not fail */ 311. if (!ossl_assert(size <= sizeof(unsigned int)) 312. || !WPACKET_allocate_bytes(pkt, size, &data) ^ 313. || !put_value(data, val, size)) 314. return 0; ssl/packet.c:15:1: Parameter `pkt->written` 13. #define DEFAULT_BUF_SIZE 256 14. 15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes)) ssl/packet.c:17:10: Call 15. int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes)) ^ 18. return 0; 19. ssl/packet.c:39:1: <LHS trace> 37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data) 38. 39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 40. { 41. /* Internal API, so should not fail */ ssl/packet.c:39:1: Parameter `pkt->buf->length` 37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data) 38. 39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 40. { 41. /* Internal API, so should not fail */ ssl/packet.c:39:1: <RHS trace> 37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data) 38. 39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 40. { 41. /* Internal API, so should not fail */ ssl/packet.c:39:1: Parameter `len` 37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data) 38. 39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 40. { 41. /* Internal API, so should not fail */ ssl/packet.c:48:36: Binary operation: ([0, +oo] - [pkt->written, pkt->written + 14]):unsigned64 by call to `WPACKET_put_bytes__` 46. return 0; 47. 48. if (pkt->staticbuf == NULL && (pkt->buf->length - pkt->written < len)) { ^ 49. size_t newlen; 50. size_t reflen;
https://github.com/openssl/openssl/blob/7f7eb90b8ac55997c5c825bb3ebcfe28611e06f5/ssl/packet.c/#L48
d2a_code_trace_data_44231
static int frame_header_is_valid(AVCodecContext *avctx, const uint8_t *buf, FLACFrameInfo *fi) { GetBitContext gb; init_get_bits(&gb, buf, MAX_FRAME_HEADER_SIZE * 8); return !ff_flac_decode_frame_header(avctx, &gb, fi, 127); } libavcodec/flac_parser.c:97: error: Null Dereference pointer `&gb->buffer` last assigned on line 96 could be null and is dereferenced by call to `ff_flac_decode_frame_header()` at line 97, column 13. libavcodec/flac_parser.c:92:1: start of procedure frame_header_is_valid() 90. } FLACParseContext; 91. 92. static int frame_header_is_valid(AVCodecContext *avctx, const uint8_t *buf, ^ 93. FLACFrameInfo *fi) 94. { libavcodec/flac_parser.c:96:5: 94. { 95. GetBitContext gb; 96. init_get_bits(&gb, buf, MAX_FRAME_HEADER_SIZE * 8); ^ 97. return !ff_flac_decode_frame_header(avctx, &gb, fi, 127); 98. } 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 false 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:382:35: Taking false 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:382:52: 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/flac_parser.c:97:13: 95. GetBitContext gb; 96. init_get_bits(&gb, buf, MAX_FRAME_HEADER_SIZE * 8); 97. return !ff_flac_decode_frame_header(avctx, &gb, fi, 127); ^ 98. } 99. 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 false 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:73:16: Taking true branch 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; 75. fi->ch_mode -= FLAC_MAX_CHANNELS - 1; libavcodec/flac.c:74:9: 72. fi->ch_mode = FLAC_CHMODE_INDEPENDENT; 73. } else if (fi->ch_mode < FLAC_MAX_CHANNELS + FLAC_CHMODE_MID_SIDE) { 74. fi->channels = 2; ^ 75. fi->ch_mode -= FLAC_MAX_CHANNELS - 1; 76. } else { libavcodec/flac.c:75:9: 73. } else if (fi->ch_mode < FLAC_MAX_CHANNELS + FLAC_CHMODE_MID_SIDE) { 74. fi->channels = 2; 75. fi->ch_mode -= FLAC_MAX_CHANNELS - 1; ^ 76. } else { 77. av_log(avctx, AV_LOG_ERROR + log_level_offset, 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/flac_parser.c/#L97
d2a_code_trace_data_44232
int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) { int i, nw, lb, rb; BN_ULONG *t, *f; BN_ULONG l; bn_check_top(r); bn_check_top(a); if (n < 0) { BNerr(BN_F_BN_LSHIFT, BN_R_INVALID_SHIFT); return 0; } r->neg = a->neg; nw = n / BN_BITS2; if (bn_wexpand(r, a->top + nw + 1) == NULL) return (0); lb = n % BN_BITS2; rb = BN_BITS2 - lb; f = a->d; t = r->d; t[a->top + nw] = 0; if (lb == 0) for (i = a->top - 1; i >= 0; i--) t[nw + i] = f[i]; else for (i = a->top - 1; i >= 0; i--) { l = f[i]; t[nw + i + 1] |= (l >> rb) & BN_MASK2; t[nw + i] = (l << lb) & BN_MASK2; } memset(t, 0, sizeof(*t) * nw); r->top = a->top + nw + 1; bn_correct_top(r); bn_check_top(r); return (1); } test/bntest.c:1938: error: BUFFER_OVERRUN_L3 Offset added: [0, 800] Size: [0, 67108856] by call to `BN_lshift`. Showing all 11 steps of the trace test/bntest.c:52:1: Assignment 50. #include "../crypto/bn/bn_lcl.h" 51. 52. > static const int num0 = 100; /* number of tests */ 53. static const int num1 = 50; /* additional tests for some functions */ 54. static const int num2 = 5; /* number of tests for slow functions */ test/bntest.c:1938:9: Call 1936. } 1937. for (i = 0; i < num0; i++) { 1938. BN_lshift(b, a, i + 1); ^ 1939. BN_add(c, c, c); 1940. if (bp != NULL) { crypto/bn/bn_shift.c:81:1: <Offset trace> 79. } 80. 81. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 82. { 83. int i, nw, lb, rb; crypto/bn/bn_shift.c:81:1: Parameter `n` 79. } 80. 81. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 82. { 83. int i, nw, lb, rb; crypto/bn/bn_shift.c:96:5: Assignment 94. 95. r->neg = a->neg; 96. nw = n / BN_BITS2; ^ 97. if (bn_wexpand(r, a->top + nw + 1) == NULL) 98. return (0); crypto/bn/bn_shift.c:81:1: <Length trace> 79. } 80. 81. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 82. { 83. int i, nw, lb, rb; crypto/bn/bn_shift.c:81:1: Parameter `*r->d` 79. } 80. 81. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 82. { 83. int i, nw, lb, rb; crypto/bn/bn_shift.c:97:9: Call 95. r->neg = a->neg; 96. nw = n / BN_BITS2; 97. if (bn_wexpand(r, a->top + nw + 1) == NULL) ^ 98. return (0); 99. lb = n % BN_BITS2; crypto/bn/bn_lib.c:1016:1: Parameter `*a->d` 1014. } 1015. 1016. > BIGNUM *bn_wexpand(BIGNUM *a, int words) 1017. { 1018. return (words <= a->dmax) ? a : bn_expand2(a, words); crypto/bn/bn_shift.c:102:5: Assignment 100. rb = BN_BITS2 - lb; 101. f = a->d; 102. t = r->d; ^ 103. t[a->top + nw] = 0; 104. if (lb == 0) crypto/bn/bn_shift.c:113:5: Array access: Offset added: [0, 800] Size: [0, 67108856] by call to `BN_lshift` 111. t[nw + i] = (l << lb) & BN_MASK2; 112. } 113. memset(t, 0, sizeof(*t) * nw); ^ 114. r->top = a->top + nw + 1; 115. bn_correct_top(r);
https://github.com/openssl/openssl/blob/b3618f44a7b8504bfb0a64e8a33e6b8e56d4d516/crypto/bn/bn_shift.c/#L113
d2a_code_trace_data_44233
static inline uint64_t get_val(BitstreamContext *bc, unsigned n) { #ifdef BITSTREAM_READER_LE uint64_t ret = bc->bits & ((UINT64_C(1) << n) - 1); bc->bits >>= n; #else uint64_t ret = bc->bits >> (64 - n); bc->bits <<= n; #endif bc->bits_left -= n; return ret; } libavcodec/mpc8.c:135: error: Integer Overflow L2 ([0, +oo] - 1):unsigned32 by call to `bitstream_read_bit`. libavcodec/mpc8.c:130:19: Call 128. bitstream_skip(&bc, 3); // sample rate 129. c->maxbands = bitstream_read(&bc, 5) + 1; 130. channels = bitstream_read(&bc, 4) + 1; ^ 131. if (channels > 2) { 132. avpriv_request_sample(avctx, "Multichannel MPC SV8"); libavcodec/bitstream.h:183:1: Parameter `bc->bits_left` 181. 182. /* Return n bits from the buffer. n has to be in the 0-32 range. */ 183. static inline uint32_t bitstream_read(BitstreamContext *bc, unsigned n) ^ 184. { 185. if (!n) libavcodec/mpc8.c:135:17: Call 133. return AVERROR_PATCHWELCOME; 134. } 135. c->MSS = bitstream_read_bit(&bc); ^ 136. c->frames = 1 << (bitstream_read(&bc, 3) * 2); 137. libavcodec/bitstream.h:145:1: Parameter `bc->bits_left` 143. 144. /* Return one bit from the buffer. */ 145. static inline unsigned bitstream_read_bit(BitstreamContext *bc) ^ 146. { 147. if (!bc->bits_left) libavcodec/bitstream.h:150:12: Call 148. refill_64(bc); 149. 150. return get_val(bc, 1); ^ 151. } 152. libavcodec/bitstream.h:130:1: <LHS trace> 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:130:1: Parameter `bc->bits_left` 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:130:1: <RHS trace> 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:130:1: Parameter `n` 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:139:5: Binary operation: ([0, +oo] - 1):unsigned32 by call to `bitstream_read_bit` 137. bc->bits <<= n; 138. #endif 139. bc->bits_left -= n; ^ 140. 141. return ret;
https://github.com/libav/libav/blob/562ef82d6a7f96f6b9da1219a5aaf7d9d7056f1b/libavcodec/bitstream.h/#L139
d2a_code_trace_data_44234
static void doapr_outch(char **sbuffer, char **buffer, size_t *currlen, size_t *maxlen, int c) { assert(*sbuffer != NULL || buffer != NULL); if (buffer) { while (*currlen >= *maxlen) { if (*buffer == NULL) { if (*maxlen == 0) *maxlen = 1024; *buffer = OPENSSL_malloc(*maxlen); if(!*buffer) { return; } if (*currlen > 0) { assert(*sbuffer != NULL); memcpy(*buffer, *sbuffer, *currlen); } *sbuffer = NULL; } else { *maxlen += 1024; *buffer = OPENSSL_realloc(*buffer, *maxlen); if(!*buffer) { return; } } } assert(*sbuffer != NULL || *buffer != NULL); } if (*currlen < *maxlen) { if (*sbuffer) (*sbuffer)[(*currlen)++] = (char)c; else (*buffer)[(*currlen)++] = (char)c; } return; } crypto/bio/bio_cb.c:110: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] (⇐ [-1, 2147483647] + [0, +oo]) Size: 256 by call to `BIO_snprintf`. Showing all 14 steps of the trace crypto/bio/bio_cb.c:66:1: Array declaration 64. #include <openssl/err.h> 65. 66. > long BIO_debug_callback(BIO *bio, int cmd, const char *argp, 67. int argi, long argl, long ret) 68. { crypto/bio/bio_cb.c:81:5: Assignment 79. len = BIO_snprintf(buf,sizeof buf,"BIO[%p]: ",(void *)bio); 80. 81. p = buf + len; ^ 82. p_maxlen = sizeof(buf) - len; 83. crypto/bio/bio_cb.c:110:9: Call 108. break; 109. case BIO_CB_GETS: 110. BIO_snprintf(p, p_maxlen, "gets(%lu) - %s\n", (unsigned long)argi, ^ 111. bio->method->name); 112. break; crypto/bio/b_print.c:794:1: Parameter `*buf` 792. * function should be renamed, but to what?) 793. */ 794. > int BIO_snprintf(char *buf, size_t n, const char *format, ...) 795. { 796. va_list args; crypto/bio/b_print.c:801:11: Call 799. va_start(args, format); 800. 801. ret = BIO_vsnprintf(buf, n, format, args); ^ 802. 803. va_end(args); crypto/bio/b_print.c:807:1: Parameter `*buf` 805. } 806. 807. > int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args) 808. { 809. size_t retlen; crypto/bio/b_print.c:812:5: Call 810. int truncated; 811. 812. _dopr(&buf, NULL, &n, &retlen, &truncated, format, args); ^ 813. 814. if (truncated) crypto/bio/b_print.c:168:1: Parameter `*maxlen` 166. #define OSSL_MAX(p,q) ((p >= q) ? p : q) 167. 168. > static void 169. _dopr(char **sbuffer, 170. char **buffer, crypto/bio/b_print.c:199:17: Call 197. state = DP_S_FLAGS; 198. else 199. doapr_outch(sbuffer, buffer, &currlen, maxlen, ch); ^ 200. ch = *format++; 201. break; crypto/bio/b_print.c:703:1: <Offset trace> 701. } 702. 703. > static void 704. doapr_outch(char **sbuffer, 705. char **buffer, size_t *currlen, size_t *maxlen, int c) crypto/bio/b_print.c:703:1: Parameter `*maxlen` 701. } 702. 703. > static void 704. doapr_outch(char **sbuffer, 705. char **buffer, size_t *currlen, size_t *maxlen, int c) crypto/bio/b_print.c:703:1: <Length trace> 701. } 702. 703. > static void 704. doapr_outch(char **sbuffer, 705. char **buffer, size_t *currlen, size_t *maxlen, int c) crypto/bio/b_print.c:703:1: Parameter `**sbuffer` 701. } 702. 703. > static void 704. doapr_outch(char **sbuffer, 705. char **buffer, size_t *currlen, size_t *maxlen, int c) crypto/bio/b_print.c:740:13: Array access: Offset: [-1, +oo] (⇐ [-1, 2147483647] + [0, +oo]) Size: 256 by call to `BIO_snprintf` 738. if (*currlen < *maxlen) { 739. if (*sbuffer) 740. (*sbuffer)[(*currlen)++] = (char)c; ^ 741. else 742. (*buffer)[(*currlen)++] = (char)c;
https://github.com/openssl/openssl/blob/ac5a110621ca48f0bebd5b4d76d081de403da29e/crypto/bio/b_print.c/#L740
d2a_code_trace_data_44235
static void doapr_outch(char **sbuffer, char **buffer, size_t *currlen, size_t *maxlen, int c) { assert(*sbuffer != NULL || buffer != NULL); if (buffer) { while (*currlen >= *maxlen) { if (*buffer == NULL) { if (*maxlen == 0) *maxlen = 1024; *buffer = OPENSSL_malloc(*maxlen); if(!*buffer) { return; } if (*currlen > 0) { assert(*sbuffer != NULL); memcpy(*buffer, *sbuffer, *currlen); } *sbuffer = NULL; } else { *maxlen += 1024; *buffer = OPENSSL_realloc(*buffer, *maxlen); if(!*buffer) { return; } } } assert(*sbuffer != NULL || *buffer != NULL); } if (*currlen < *maxlen) { if (*sbuffer) (*sbuffer)[(*currlen)++] = (char)c; else (*buffer)[(*currlen)++] = (char)c; } return; } crypto/bio/bio_cb.c:114: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] (⇐ [-1, 2147483647] + [0, +oo]) Size: 256 by call to `BIO_snprintf`. Showing all 14 steps of the trace crypto/bio/bio_cb.c:66:1: Array declaration 64. #include <openssl/err.h> 65. 66. > long BIO_debug_callback(BIO *bio, int cmd, const char *argp, 67. int argi, long argl, long ret) 68. { crypto/bio/bio_cb.c:81:5: Assignment 79. len = BIO_snprintf(buf,sizeof buf,"BIO[%p]: ",(void *)bio); 80. 81. p = buf + len; ^ 82. p_maxlen = sizeof(buf) - len; 83. crypto/bio/bio_cb.c:114:9: Call 112. break; 113. case BIO_CB_CTRL: 114. BIO_snprintf(p, p_maxlen, "ctrl(%lu) - %s\n", (unsigned long)argi, ^ 115. bio->method->name); 116. break; crypto/bio/b_print.c:794:1: Parameter `*buf` 792. * function should be renamed, but to what?) 793. */ 794. > int BIO_snprintf(char *buf, size_t n, const char *format, ...) 795. { 796. va_list args; crypto/bio/b_print.c:801:11: Call 799. va_start(args, format); 800. 801. ret = BIO_vsnprintf(buf, n, format, args); ^ 802. 803. va_end(args); crypto/bio/b_print.c:807:1: Parameter `*buf` 805. } 806. 807. > int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args) 808. { 809. size_t retlen; crypto/bio/b_print.c:812:5: Call 810. int truncated; 811. 812. _dopr(&buf, NULL, &n, &retlen, &truncated, format, args); ^ 813. 814. if (truncated) crypto/bio/b_print.c:168:1: Parameter `*maxlen` 166. #define OSSL_MAX(p,q) ((p >= q) ? p : q) 167. 168. > static void 169. _dopr(char **sbuffer, 170. char **buffer, crypto/bio/b_print.c:199:17: Call 197. state = DP_S_FLAGS; 198. else 199. doapr_outch(sbuffer, buffer, &currlen, maxlen, ch); ^ 200. ch = *format++; 201. break; crypto/bio/b_print.c:703:1: <Offset trace> 701. } 702. 703. > static void 704. doapr_outch(char **sbuffer, 705. char **buffer, size_t *currlen, size_t *maxlen, int c) crypto/bio/b_print.c:703:1: Parameter `*maxlen` 701. } 702. 703. > static void 704. doapr_outch(char **sbuffer, 705. char **buffer, size_t *currlen, size_t *maxlen, int c) crypto/bio/b_print.c:703:1: <Length trace> 701. } 702. 703. > static void 704. doapr_outch(char **sbuffer, 705. char **buffer, size_t *currlen, size_t *maxlen, int c) crypto/bio/b_print.c:703:1: Parameter `**sbuffer` 701. } 702. 703. > static void 704. doapr_outch(char **sbuffer, 705. char **buffer, size_t *currlen, size_t *maxlen, int c) crypto/bio/b_print.c:740:13: Array access: Offset: [-1, +oo] (⇐ [-1, 2147483647] + [0, +oo]) Size: 256 by call to `BIO_snprintf` 738. if (*currlen < *maxlen) { 739. if (*sbuffer) 740. (*sbuffer)[(*currlen)++] = (char)c; ^ 741. else 742. (*buffer)[(*currlen)++] = (char)c;
https://github.com/openssl/openssl/blob/ac5a110621ca48f0bebd5b4d76d081de403da29e/crypto/bio/b_print.c/#L740
d2a_code_trace_data_44236
static int do_multi(int multi, int size_num) { int n; int fd[2]; int *fds; static char sep[] = ":"; fds = app_malloc(sizeof(*fds) * multi, "fd buffer for do_multi"); for (n = 0; n < multi; ++n) { if (pipe(fd) == -1) { BIO_printf(bio_err, "pipe failure\n"); exit(1); } fflush(stdout); (void)BIO_flush(bio_err); if (fork()) { close(fd[1]); fds[n] = fd[0]; } else { close(fd[0]); close(1); if (dup(fd[1]) == -1) { BIO_printf(bio_err, "dup failed\n"); exit(1); } close(fd[1]); mr = 1; usertime = 0; OPENSSL_free(fds); return 0; } printf("Forked child %d\n", n); } for (n = 0; n < multi; ++n) { FILE *f; char buf[1024]; char *p; f = fdopen(fds[n], "r"); while (fgets(buf, sizeof(buf), f)) { p = strchr(buf, '\n'); if (p) *p = '\0'; if (buf[0] != '+') { BIO_printf(bio_err, "Don't understand line '%s' from child %d\n", buf, n); continue; } printf("Got: %s from %d\n", buf, n); if (strncmp(buf, "+F:", 3) == 0) { int alg; int j; p = buf + 3; alg = atoi(sstrsep(&p, sep)); sstrsep(&p, sep); for (j = 0; j < size_num; ++j) results[alg][j] += atof(sstrsep(&p, sep)); } else if (strncmp(buf, "+F2:", 4) == 0) { int k; double d; p = buf + 4; k = atoi(sstrsep(&p, sep)); sstrsep(&p, sep); d = atof(sstrsep(&p, sep)); rsa_results[k][0] += d; d = atof(sstrsep(&p, sep)); rsa_results[k][1] += d; } # ifndef OPENSSL_NO_DSA else if (strncmp(buf, "+F3:", 4) == 0) { int k; double d; p = buf + 4; k = atoi(sstrsep(&p, sep)); sstrsep(&p, sep); d = atof(sstrsep(&p, sep)); dsa_results[k][0] += d; d = atof(sstrsep(&p, sep)); dsa_results[k][1] += d; } # endif # ifndef OPENSSL_NO_EC else if (strncmp(buf, "+F4:", 4) == 0) { int k; double d; p = buf + 4; k = atoi(sstrsep(&p, sep)); sstrsep(&p, sep); d = atof(sstrsep(&p, sep)); ecdsa_results[k][0] += d; d = atof(sstrsep(&p, sep)); ecdsa_results[k][1] += d; } else if (strncmp(buf, "+F5:", 4) == 0) { int k; double d; p = buf + 4; k = atoi(sstrsep(&p, sep)); sstrsep(&p, sep); d = atof(sstrsep(&p, sep)); ecdh_results[k][0] += d; } else if (strncmp(buf, "+F6:", 4) == 0) { int k; double d; p = buf + 4; k = atoi(sstrsep(&p, sep)); sstrsep(&p, sep); d = atof(sstrsep(&p, sep)); eddsa_results[k][0] += d; d = atof(sstrsep(&p, sep)); eddsa_results[k][1] += d; } # endif else if (strncmp(buf, "+H:", 3) == 0) { ; } else BIO_printf(bio_err, "Unknown type '%s' from child %d\n", buf, n); } fclose(f); } OPENSSL_free(fds); return 1; } apps/speed.c:3654: error: NULL_DEREFERENCE pointer `f` last assigned on line 3653 could be null and is dereferenced by call to `fgets()` at line 3654, column 16. Showing all 30 steps of the trace apps/speed.c:3613:1: start of procedure do_multi() 3611. } 3612. 3613. > static int do_multi(int multi, int size_num) 3614. { 3615. int n; apps/speed.c:3618:5: 3616. int fd[2]; 3617. int *fds; 3618. > static char sep[] = ":"; 3619. 3620. fds = app_malloc(sizeof(*fds) * multi, "fd buffer for do_multi"); apps/speed.c:3620:5: 3618. static char sep[] = ":"; 3619. 3620. > fds = app_malloc(sizeof(*fds) * multi, "fd buffer for do_multi"); 3621. for (n = 0; n < multi; ++n) { 3622. if (pipe(fd) == -1) { test/testutil/apps_mem.c:14:1: start of procedure app_malloc() 12. /* shim that avoids sucking in too much from apps/apps.c */ 13. 14. > void* app_malloc(int sz, const char *what) 15. { 16. void *vp = OPENSSL_malloc(sz); test/testutil/apps_mem.c:16:5: 14. void* app_malloc(int sz, const char *what) 15. { 16. > void *vp = OPENSSL_malloc(sz); 17. 18. return vp; providers/fips/fipsprov.c:564:1: start of procedure CRYPTO_malloc() 562. } 563. 564. > void *CRYPTO_malloc(size_t num, const char *file, int line) 565. { 566. return c_CRYPTO_malloc(num, file, line); providers/fips/fipsprov.c:566:5: Skipping __function_pointer__(): unresolved function pointer 564. void *CRYPTO_malloc(size_t num, const char *file, int line) 565. { 566. return c_CRYPTO_malloc(num, file, line); ^ 567. } 568. providers/fips/fipsprov.c:567:1: return from a call to CRYPTO_malloc 565. { 566. return c_CRYPTO_malloc(num, file, line); 567. > } 568. 569. void *CRYPTO_zalloc(size_t num, const char *file, int line) test/testutil/apps_mem.c:18:5: 16. void *vp = OPENSSL_malloc(sz); 17. 18. > return vp; 19. } test/testutil/apps_mem.c:19:1: return from a call to app_malloc 17. 18. return vp; 19. > } apps/speed.c:3621:10: 3619. 3620. fds = app_malloc(sizeof(*fds) * multi, "fd buffer for do_multi"); 3621. > for (n = 0; n < multi; ++n) { 3622. if (pipe(fd) == -1) { 3623. BIO_printf(bio_err, "pipe failure\n"); apps/speed.c:3621:17: Loop condition is true. Entering loop body 3619. 3620. fds = app_malloc(sizeof(*fds) * multi, "fd buffer for do_multi"); 3621. for (n = 0; n < multi; ++n) { ^ 3622. if (pipe(fd) == -1) { 3623. BIO_printf(bio_err, "pipe failure\n"); apps/speed.c:3622:13: Taking false branch 3620. fds = app_malloc(sizeof(*fds) * multi, "fd buffer for do_multi"); 3621. for (n = 0; n < multi; ++n) { 3622. if (pipe(fd) == -1) { ^ 3623. BIO_printf(bio_err, "pipe failure\n"); 3624. exit(1); apps/speed.c:3626:9: 3624. exit(1); 3625. } 3626. > fflush(stdout); 3627. (void)BIO_flush(bio_err); 3628. if (fork()) { apps/speed.c:3627:15: 3625. } 3626. fflush(stdout); 3627. > (void)BIO_flush(bio_err); 3628. if (fork()) { 3629. close(fd[1]); crypto/bio/bio_lib.c:510:1: start of procedure BIO_ctrl() 508. } 509. 510. > long BIO_ctrl(BIO *b, int cmd, long larg, void *parg) 511. { 512. long ret; crypto/bio/bio_lib.c:514:9: Taking true branch 512. long ret; 513. 514. if (b == NULL) ^ 515. return 0; 516. crypto/bio/bio_lib.c:515:9: 513. 514. if (b == NULL) 515. > return 0; 516. 517. if ((b->method == NULL) || (b->method->ctrl == NULL)) { crypto/bio/bio_lib.c:535:1: return from a call to BIO_ctrl 533. 534. return ret; 535. > } 536. 537. long BIO_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp) apps/speed.c:3627:9: 3625. } 3626. fflush(stdout); 3627. > (void)BIO_flush(bio_err); 3628. if (fork()) { 3629. close(fd[1]); apps/speed.c:3628:13: Taking true branch 3626. fflush(stdout); 3627. (void)BIO_flush(bio_err); 3628. if (fork()) { ^ 3629. close(fd[1]); 3630. fds[n] = fd[0]; apps/speed.c:3629:13: 3627. (void)BIO_flush(bio_err); 3628. if (fork()) { 3629. > close(fd[1]); 3630. fds[n] = fd[0]; 3631. } else { apps/speed.c:3630:13: 3628. if (fork()) { 3629. close(fd[1]); 3630. > fds[n] = fd[0]; 3631. } else { 3632. close(fd[0]); apps/speed.c:3644:9: 3642. return 0; 3643. } 3644. > printf("Forked child %d\n", n); 3645. } 3646. apps/speed.c:3621:28: 3619. 3620. fds = app_malloc(sizeof(*fds) * multi, "fd buffer for do_multi"); 3621. > for (n = 0; n < multi; ++n) { 3622. if (pipe(fd) == -1) { 3623. BIO_printf(bio_err, "pipe failure\n"); apps/speed.c:3621:17: Loop condition is false. Leaving loop 3619. 3620. fds = app_malloc(sizeof(*fds) * multi, "fd buffer for do_multi"); 3621. for (n = 0; n < multi; ++n) { ^ 3622. if (pipe(fd) == -1) { 3623. BIO_printf(bio_err, "pipe failure\n"); apps/speed.c:3648:10: 3646. 3647. /* for now, assume the pipe is long enough to take all the output */ 3648. > for (n = 0; n < multi; ++n) { 3649. FILE *f; 3650. char buf[1024]; apps/speed.c:3648:17: Loop condition is true. Entering loop body 3646. 3647. /* for now, assume the pipe is long enough to take all the output */ 3648. for (n = 0; n < multi; ++n) { ^ 3649. FILE *f; 3650. char buf[1024]; apps/speed.c:3653:9: 3651. char *p; 3652. 3653. > f = fdopen(fds[n], "r"); 3654. while (fgets(buf, sizeof(buf), f)) { 3655. p = strchr(buf, '\n'); apps/speed.c:3654:16: 3652. 3653. f = fdopen(fds[n], "r"); 3654. > while (fgets(buf, sizeof(buf), f)) { 3655. p = strchr(buf, '\n'); 3656. if (p)
https://github.com/openssl/openssl/blob/363e941ed43c648adf4d6d0874077ddd80041e1f/apps/speed.c/#L3654
d2a_code_trace_data_44237
int BN_set_bit(BIGNUM *a, int n) { int i, j, k; if (n < 0) return 0; i = n / BN_BITS2; j = n % BN_BITS2; if (a->top <= i) { if (bn_wexpand(a, i + 1) == NULL) return (0); for (k = a->top; k < i + 1; k++) a->d[k] = 0; a->top = i + 1; } a->d[i] |= (((BN_ULONG)1) << j); bn_check_top(a); return (1); } test/bntest.c:756: error: BUFFER_OVERRUN_L3 Offset: [0, 193] Size: [0, 8388607] by call to `BN_GF2m_arr2poly`. Showing all 9 steps of the trace test/bntest.c:746:16: Assignment 744. int i, j, s = 0, t, st = 0; 745. int p0[] = { 163, 7, 6, 3, 0, -1 }; 746. int p1[] = { 193, 15, 0, -1 }; ^ 747. 748. a = BN_new(); test/bntest.c:756:5: Call 754. 755. BN_GF2m_arr2poly(p0, b[0]); 756. BN_GF2m_arr2poly(p1, b[1]); ^ 757. 758. for (i = 0; i < NUM0; i++) { crypto/bn/bn_gf2m.c:1209:1: Parameter `*p` 1207. * bit-string. The array must be terminated by -1. 1208. */ 1209. > int BN_GF2m_arr2poly(const int p[], BIGNUM *a) 1210. { 1211. int i; crypto/bn/bn_gf2m.c:1216:13: Call 1214. BN_zero(a); 1215. for (i = 0; p[i] != -1; i++) { 1216. if (BN_set_bit(a, p[i]) == 0) ^ 1217. return 0; 1218. } crypto/bn/bn_lib.c:692:1: <Offset trace> 690. } 691. 692. > int BN_set_bit(BIGNUM *a, int n) 693. { 694. int i, j, k; crypto/bn/bn_lib.c:692:1: Parameter `a->top` 690. } 691. 692. > int BN_set_bit(BIGNUM *a, int n) 693. { 694. int i, j, k; crypto/bn/bn_lib.c:692:1: <Length trace> 690. } 691. 692. > int BN_set_bit(BIGNUM *a, int n) 693. { 694. int i, j, k; crypto/bn/bn_lib.c:692:1: Parameter `*a->d` 690. } 691. 692. > int BN_set_bit(BIGNUM *a, int n) 693. { 694. int i, j, k; crypto/bn/bn_lib.c:709:5: Array access: Offset: [0, 193] Size: [0, 8388607] by call to `BN_GF2m_arr2poly` 707. } 708. 709. a->d[i] |= (((BN_ULONG)1) << j); ^ 710. bn_check_top(a); 711. return (1);
https://github.com/openssl/openssl/blob/0282aeb690d63fab73a07191b63300a2fe30d212/crypto/bn/bn_lib.c/#L709
d2a_code_trace_data_44238
ERR_STATE *ERR_get_state(void) { ERR_STATE *state = NULL; if (!RUN_ONCE(&err_init, err_do_init)) return NULL; if (!OPENSSL_init_crypto(0, NULL)) return NULL; state = CRYPTO_THREAD_get_local(&err_thread_local); if (state == NULL) { state = OPENSSL_zalloc(sizeof(*state)); if (state == NULL) return NULL; if (!ossl_init_thread_start(OPENSSL_INIT_THREAD_ERR_STATE) || !CRYPTO_THREAD_set_local(&err_thread_local, state)) { ERR_STATE_free(state); return NULL; } OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL); } return state; } crypto/err/err.c:686: error: MEMORY_LEAK memory dynamically allocated by call to `CRYPTO_zalloc()` at line 680, column 17 is not reachable after line 686, column 13. Showing all 42 steps of the trace crypto/err/err.c:662:1: start of procedure ERR_get_state() 660. } 661. 662. > ERR_STATE *ERR_get_state(void) 663. { 664. ERR_STATE *state = NULL; crypto/err/err.c:664:5: 662. ERR_STATE *ERR_get_state(void) 663. { 664. > ERR_STATE *state = NULL; 665. 666. if (!RUN_ONCE(&err_init, err_do_init)) crypto/err/err.c:666:10: 664. ERR_STATE *state = NULL; 665. 666. > if (!RUN_ONCE(&err_init, err_do_init)) 667. return NULL; 668. crypto/threads_pthread.c:105:1: start of procedure CRYPTO_THREAD_run_once() 103. } 104. 105. > int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void)) 106. { 107. if (pthread_once(once, init) != 0) crypto/threads_pthread.c:107:9: Taking false branch 105. int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void)) 106. { 107. if (pthread_once(once, init) != 0) ^ 108. return 0; 109. crypto/threads_pthread.c:110:5: 108. return 0; 109. 110. > return 1; 111. } 112. crypto/threads_pthread.c:111:1: return from a call to CRYPTO_THREAD_run_once 109. 110. return 1; 111. > } 112. 113. int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *)) crypto/err/err.c:666:10: Condition is true 664. ERR_STATE *state = NULL; 665. 666. if (!RUN_ONCE(&err_init, err_do_init)) ^ 667. return NULL; 668. crypto/err/err.c:666:10: Taking false branch 664. ERR_STATE *state = NULL; 665. 666. if (!RUN_ONCE(&err_init, err_do_init)) ^ 667. return NULL; 668. crypto/err/err.c:674:10: Taking false branch 672. * Needed on any platform that doesn't define OPENSSL_USE_NODELETE. 673. */ 674. if (!OPENSSL_init_crypto(0, NULL)) ^ 675. return NULL; 676. crypto/err/err.c:677:5: 675. return NULL; 676. 677. > state = CRYPTO_THREAD_get_local(&err_thread_local); 678. 679. if (state == NULL) { crypto/threads_pthread.c:121:1: start of procedure CRYPTO_THREAD_get_local() 119. } 120. 121. > void *CRYPTO_THREAD_get_local(CRYPTO_THREAD_LOCAL *key) 122. { 123. return pthread_getspecific(*key); crypto/threads_pthread.c:123:5: Skipping pthread_getspecific(): method has no implementation 121. void *CRYPTO_THREAD_get_local(CRYPTO_THREAD_LOCAL *key) 122. { 123. return pthread_getspecific(*key); ^ 124. } 125. crypto/threads_pthread.c:124:1: return from a call to CRYPTO_THREAD_get_local 122. { 123. return pthread_getspecific(*key); 124. > } 125. 126. int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val) crypto/err/err.c:679:9: Taking true branch 677. state = CRYPTO_THREAD_get_local(&err_thread_local); 678. 679. if (state == NULL) { ^ 680. state = OPENSSL_zalloc(sizeof(*state)); 681. if (state == NULL) crypto/err/err.c:680:9: 678. 679. if (state == NULL) { 680. > state = OPENSSL_zalloc(sizeof(*state)); 681. if (state == NULL) 682. return NULL; crypto/mem.c:228:1: start of procedure CRYPTO_zalloc() 226. } 227. 228. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:230:5: 228. void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. > void *ret = CRYPTO_malloc(num, file, line); 231. 232. FAILTEST(); crypto/mem.c:192:1: start of procedure CRYPTO_malloc() 190. #endif 191. 192. > void *CRYPTO_malloc(size_t num, const char *file, int line) 193. { 194. void *ret = NULL; crypto/mem.c:194:5: 192. void *CRYPTO_malloc(size_t num, const char *file, int line) 193. { 194. > void *ret = NULL; 195. 196. INCREMENT(malloc_count); crypto/mem.c:197:9: Taking false branch 195. 196. INCREMENT(malloc_count); 197. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) ^ 198. return malloc_impl(num, file, line); 199. crypto/mem.c:200:9: Taking false branch 198. return malloc_impl(num, file, line); 199. 200. if (num == 0) ^ 201. return NULL; 202. crypto/mem.c:204:9: Taking true branch 202. 203. FAILTEST(); 204. if (allow_customize) { ^ 205. /* 206. * Disallow customization after the first allocation. We only set this crypto/mem.c:210:9: 208. * allocation. 209. */ 210. > allow_customize = 0; 211. } 212. #ifndef OPENSSL_NO_CRYPTO_MDEBUG crypto/mem.c:221:5: 219. } 220. #else 221. > (void)(file); (void)(line); 222. ret = malloc(num); 223. #endif crypto/mem.c:221:19: 219. } 220. #else 221. > (void)(file); (void)(line); 222. ret = malloc(num); 223. #endif crypto/mem.c:222:5: 220. #else 221. (void)(file); (void)(line); 222. > ret = malloc(num); 223. #endif 224. crypto/mem.c:225:5: 223. #endif 224. 225. > return ret; 226. } 227. crypto/mem.c:226:1: return from a call to CRYPTO_malloc 224. 225. return ret; 226. > } 227. 228. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:233:9: Taking true branch 231. 232. FAILTEST(); 233. if (ret != NULL) ^ 234. memset(ret, 0, num); 235. return ret; crypto/mem.c:234:9: 232. FAILTEST(); 233. if (ret != NULL) 234. > memset(ret, 0, num); 235. return ret; 236. } crypto/mem.c:235:5: 233. if (ret != NULL) 234. memset(ret, 0, num); 235. > return ret; 236. } 237. crypto/mem.c:236:1: return from a call to CRYPTO_zalloc 234. memset(ret, 0, num); 235. return ret; 236. > } 237. 238. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/err/err.c:681:13: Taking false branch 679. if (state == NULL) { 680. state = OPENSSL_zalloc(sizeof(*state)); 681. if (state == NULL) ^ 682. return NULL; 683. crypto/err/err.c:684:14: Taking false branch 682. return NULL; 683. 684. if (!ossl_init_thread_start(OPENSSL_INIT_THREAD_ERR_STATE) ^ 685. || !CRYPTO_THREAD_set_local(&err_thread_local, state)) { 686. ERR_STATE_free(state); crypto/err/err.c:685:17: 683. 684. if (!ossl_init_thread_start(OPENSSL_INIT_THREAD_ERR_STATE) 685. > || !CRYPTO_THREAD_set_local(&err_thread_local, state)) { 686. ERR_STATE_free(state); 687. return NULL; crypto/threads_pthread.c:126:1: start of procedure CRYPTO_THREAD_set_local() 124. } 125. 126. > int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val) 127. { 128. if (pthread_setspecific(*key, val) != 0) crypto/threads_pthread.c:128:9: Taking true branch 126. int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val) 127. { 128. if (pthread_setspecific(*key, val) != 0) ^ 129. return 0; 130. crypto/threads_pthread.c:129:9: 127. { 128. if (pthread_setspecific(*key, val) != 0) 129. > return 0; 130. 131. return 1; crypto/threads_pthread.c:132:1: return from a call to CRYPTO_THREAD_set_local 130. 131. return 1; 132. > } 133. 134. int CRYPTO_THREAD_cleanup_local(CRYPTO_THREAD_LOCAL *key) crypto/err/err.c:685:17: Taking true branch 683. 684. if (!ossl_init_thread_start(OPENSSL_INIT_THREAD_ERR_STATE) 685. || !CRYPTO_THREAD_set_local(&err_thread_local, state)) { ^ 686. ERR_STATE_free(state); 687. return NULL; crypto/err/err.c:686:13: Skipping ERR_STATE_free(): empty list of specs 684. if (!ossl_init_thread_start(OPENSSL_INIT_THREAD_ERR_STATE) 685. || !CRYPTO_THREAD_set_local(&err_thread_local, state)) { 686. ERR_STATE_free(state); ^ 687. return NULL; 688. }
https://github.com/openssl/openssl/blob/f770d75b1cac264d6280ec7326277daff6965cbb/crypto/err/err.c/#L686
d2a_code_trace_data_44239
static void float_to_fixed24_c(int32_t *dst, const float *src, unsigned int len) { const float scale = 1 << 24; do { *dst++ = lrintf(*src++ * scale); *dst++ = lrintf(*src++ * scale); *dst++ = lrintf(*src++ * scale); *dst++ = lrintf(*src++ * scale); *dst++ = lrintf(*src++ * scale); *dst++ = lrintf(*src++ * scale); *dst++ = lrintf(*src++ * scale); *dst++ = lrintf(*src++ * scale); len -= 8; } while (len > 0); } libavcodec/ac3dsp.c:100: error: Integer Overflow L2 ([min(1, `len`), `len`] - 8):unsigned32. libavcodec/ac3dsp.c:88:1: <LHS trace> 86. } 87. 88. static void float_to_fixed24_c(int32_t *dst, const float *src, unsigned int len) ^ 89. { 90. const float scale = 1 << 24; libavcodec/ac3dsp.c:88:1: Parameter `len` 86. } 87. 88. static void float_to_fixed24_c(int32_t *dst, const float *src, unsigned int len) ^ 89. { 90. const float scale = 1 << 24; libavcodec/ac3dsp.c:100:9: Binary operation: ([min(1, len), len] - 8):unsigned32 98. *dst++ = lrintf(*src++ * scale); 99. *dst++ = lrintf(*src++ * scale); 100. len -= 8; ^ 101. } while (len > 0); 102. }
https://github.com/libav/libav/blob/350785a6621529c50771f4e7043b4d159a96ed26/libavcodec/ac3dsp.c/#L100
d2a_code_trace_data_44240
int test_div(BIO *bp, BN_CTX *ctx) { BIGNUM *a, *b, *c, *d, *e; int i; a = BN_new(); b = BN_new(); c = BN_new(); d = BN_new(); e = BN_new(); BN_one(a); BN_zero(b); if (BN_div(d, c, a, b, ctx)) { fprintf(stderr, "Division by zero succeeded!\n"); return 0; } for (i = 0; i < num0 + num1; i++) { if (i < num1) { BN_bntest_rand(a, 400, 0, 0); BN_copy(b, a); BN_lshift(a, a, i); BN_add_word(a, i); } else BN_bntest_rand(b, 50 + 3 * (i - num1), 0, 0); a->neg = rand_neg(); b->neg = rand_neg(); BN_div(d, c, a, b, ctx); if (bp != NULL) { if (!results) { BN_print(bp, a); BIO_puts(bp, " / "); BN_print(bp, b); BIO_puts(bp, " - "); } BN_print(bp, d); BIO_puts(bp, "\n"); if (!results) { BN_print(bp, a); BIO_puts(bp, " % "); BN_print(bp, b); BIO_puts(bp, " - "); } BN_print(bp, c); BIO_puts(bp, "\n"); } BN_mul(e, d, b, ctx); BN_add(d, e, c); BN_sub(d, d, a); if (!BN_is_zero(d)) { fprintf(stderr, "Division test failed!\n"); return 0; } } BN_free(a); BN_free(b); BN_free(c); BN_free(d); BN_free(e); return (1); } test/bntest.c:499: error: MEMORY_LEAK memory dynamically allocated by call to `BN_new()` at line 447, column 9 is not reachable after line 499, column 5. Showing all 186 steps of the trace test/bntest.c:439:1: start of procedure test_div() 437. } 438. 439. > int test_div(BIO *bp, BN_CTX *ctx) 440. { 441. BIGNUM *a, *b, *c, *d, *e; test/bntest.c:444:5: 442. int i; 443. 444. > a = BN_new(); 445. b = BN_new(); 446. c = BN_new(); crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) test/bntest.c:445:5: 443. 444. a = BN_new(); 445. > b = BN_new(); 446. c = BN_new(); 447. d = BN_new(); crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) test/bntest.c:446:5: 444. a = BN_new(); 445. b = BN_new(); 446. > c = BN_new(); 447. d = BN_new(); 448. e = BN_new(); crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) test/bntest.c:447:5: 445. b = BN_new(); 446. c = BN_new(); 447. > d = BN_new(); 448. e = BN_new(); 449. crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) test/bntest.c:448:5: 446. c = BN_new(); 447. d = BN_new(); 448. > e = BN_new(); 449. 450. BN_one(a); crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) test/bntest.c:450:5: 448. e = BN_new(); 449. 450. > BN_one(a); 451. BN_zero(b); 452. crypto/bn/bn_lib.c:530:1: start of procedure BN_set_word() 528. } 529. 530. > int BN_set_word(BIGNUM *a, BN_ULONG w) 531. { 532. bn_check_top(a); crypto/bn/bn_lib.c:533:9: Condition is true 531. { 532. bn_check_top(a); 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 534. return (0); 535. a->neg = 0; crypto/bn/bn_lib.c:533:9: Taking false branch 531. { 532. bn_check_top(a); 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 534. return (0); 535. a->neg = 0; crypto/bn/bn_lib.c:535:5: 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) 534. return (0); 535. > a->neg = 0; 536. a->d[0] = w; 537. a->top = (w ? 1 : 0); crypto/bn/bn_lib.c:536:5: 534. return (0); 535. a->neg = 0; 536. > a->d[0] = w; 537. a->top = (w ? 1 : 0); 538. bn_check_top(a); crypto/bn/bn_lib.c:537:15: Condition is true 535. a->neg = 0; 536. a->d[0] = w; 537. a->top = (w ? 1 : 0); ^ 538. bn_check_top(a); 539. return (1); crypto/bn/bn_lib.c:537:5: 535. a->neg = 0; 536. a->d[0] = w; 537. > a->top = (w ? 1 : 0); 538. bn_check_top(a); 539. return (1); crypto/bn/bn_lib.c:539:5: 537. a->top = (w ? 1 : 0); 538. bn_check_top(a); 539. > return (1); 540. } 541. crypto/bn/bn_lib.c:540:1: return from a call to BN_set_word 538. bn_check_top(a); 539. return (1); 540. > } 541. 542. BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret) test/bntest.c:451:5: 449. 450. BN_one(a); 451. > BN_zero(b); 452. 453. if (BN_div(d, c, a, b, ctx)) { crypto/bn/bn_lib.c:530:1: start of procedure BN_set_word() 528. } 529. 530. > int BN_set_word(BIGNUM *a, BN_ULONG w) 531. { 532. bn_check_top(a); crypto/bn/bn_lib.c:533:9: Condition is true 531. { 532. bn_check_top(a); 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 534. return (0); 535. a->neg = 0; crypto/bn/bn_lib.c:533:9: Taking false branch 531. { 532. bn_check_top(a); 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 534. return (0); 535. a->neg = 0; crypto/bn/bn_lib.c:535:5: 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) 534. return (0); 535. > a->neg = 0; 536. a->d[0] = w; 537. a->top = (w ? 1 : 0); crypto/bn/bn_lib.c:536:5: 534. return (0); 535. a->neg = 0; 536. > a->d[0] = w; 537. a->top = (w ? 1 : 0); 538. bn_check_top(a); crypto/bn/bn_lib.c:537:15: Condition is false 535. a->neg = 0; 536. a->d[0] = w; 537. a->top = (w ? 1 : 0); ^ 538. bn_check_top(a); 539. return (1); crypto/bn/bn_lib.c:537:5: 535. a->neg = 0; 536. a->d[0] = w; 537. > a->top = (w ? 1 : 0); 538. bn_check_top(a); 539. return (1); crypto/bn/bn_lib.c:539:5: 537. a->top = (w ? 1 : 0); 538. bn_check_top(a); 539. > return (1); 540. } 541. crypto/bn/bn_lib.c:540:1: return from a call to BN_set_word 538. bn_check_top(a); 539. return (1); 540. > } 541. 542. BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret) test/bntest.c:453:9: Taking false branch 451. BN_zero(b); 452. 453. if (BN_div(d, c, a, b, ctx)) { ^ 454. fprintf(stderr, "Division by zero succeeded!\n"); 455. return 0; test/bntest.c:458:10: 456. } 457. 458. > for (i = 0; i < num0 + num1; i++) { 459. if (i < num1) { 460. BN_bntest_rand(a, 400, 0, 0); test/bntest.c:458:17: Loop condition is false. Leaving loop 456. } 457. 458. for (i = 0; i < num0 + num1; i++) { ^ 459. if (i < num1) { 460. BN_bntest_rand(a, 400, 0, 0); test/bntest.c:496:5: 494. } 495. } 496. > BN_free(a); 497. BN_free(b); 498. BN_free(c); crypto/bn/bn_lib.c:252:1: start of procedure BN_free() 250. } 251. 252. > void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) crypto/bn/bn_lib.c:254:9: Taking false branch 252. void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) ^ 255. return; 256. bn_check_top(a); crypto/bn/bn_lib.c:257:10: 255. return; 256. bn_check_top(a); 257. > if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:965:1: start of procedure BN_get_flags() 963. } 964. 965. > int BN_get_flags(const BIGNUM *b, int n) 966. { 967. return b->flags & n; crypto/bn/bn_lib.c:967:5: 965. int BN_get_flags(const BIGNUM *b, int n) 966. { 967. > return b->flags & n; 968. } 969. crypto/bn/bn_lib.c:968:1: return from a call to BN_get_flags 966. { 967. return b->flags & n; 968. > } 969. 970. /* Populate a BN_GENCB structure with an "old"-style callback */ crypto/bn/bn_lib.c:257:10: Taking false branch 255. return; 256. bn_check_top(a); 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) ^ 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:259:9: Taking false branch 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) ^ 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:263:9: 261. else { 262. #if OPENSSL_API_COMPAT < 0x00908000L 263. > a->flags |= BN_FLG_FREE; 264. #endif 265. a->d = NULL; crypto/bn/bn_lib.c:265:9: 263. a->flags |= BN_FLG_FREE; 264. #endif 265. > a->d = NULL; 266. } 267. } crypto/bn/bn_lib.c:259:5: 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. > if (a->flags & BN_FLG_MALLOCED) 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:267:1: return from a call to BN_free 265. a->d = NULL; 266. } 267. > } 268. 269. void bn_init(BIGNUM *a) test/bntest.c:497:5: 495. } 496. BN_free(a); 497. > BN_free(b); 498. BN_free(c); 499. BN_free(d); crypto/bn/bn_lib.c:252:1: start of procedure BN_free() 250. } 251. 252. > void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) crypto/bn/bn_lib.c:254:9: Taking false branch 252. void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) ^ 255. return; 256. bn_check_top(a); crypto/bn/bn_lib.c:257:10: 255. return; 256. bn_check_top(a); 257. > if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:965:1: start of procedure BN_get_flags() 963. } 964. 965. > int BN_get_flags(const BIGNUM *b, int n) 966. { 967. return b->flags & n; crypto/bn/bn_lib.c:967:5: 965. int BN_get_flags(const BIGNUM *b, int n) 966. { 967. > return b->flags & n; 968. } 969. crypto/bn/bn_lib.c:968:1: return from a call to BN_get_flags 966. { 967. return b->flags & n; 968. > } 969. 970. /* Populate a BN_GENCB structure with an "old"-style callback */ crypto/bn/bn_lib.c:257:10: Taking false branch 255. return; 256. bn_check_top(a); 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) ^ 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:259:9: Taking false branch 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) ^ 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:263:9: 261. else { 262. #if OPENSSL_API_COMPAT < 0x00908000L 263. > a->flags |= BN_FLG_FREE; 264. #endif 265. a->d = NULL; crypto/bn/bn_lib.c:265:9: 263. a->flags |= BN_FLG_FREE; 264. #endif 265. > a->d = NULL; 266. } 267. } crypto/bn/bn_lib.c:259:5: 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. > if (a->flags & BN_FLG_MALLOCED) 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:267:1: return from a call to BN_free 265. a->d = NULL; 266. } 267. > } 268. 269. void bn_init(BIGNUM *a) test/bntest.c:498:5: 496. BN_free(a); 497. BN_free(b); 498. > BN_free(c); 499. BN_free(d); 500. BN_free(e); crypto/bn/bn_lib.c:252:1: start of procedure BN_free() 250. } 251. 252. > void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) crypto/bn/bn_lib.c:254:9: Taking false branch 252. void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) ^ 255. return; 256. bn_check_top(a); crypto/bn/bn_lib.c:257:10: 255. return; 256. bn_check_top(a); 257. > if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:965:1: start of procedure BN_get_flags() 963. } 964. 965. > int BN_get_flags(const BIGNUM *b, int n) 966. { 967. return b->flags & n; crypto/bn/bn_lib.c:967:5: 965. int BN_get_flags(const BIGNUM *b, int n) 966. { 967. > return b->flags & n; 968. } 969. crypto/bn/bn_lib.c:968:1: return from a call to BN_get_flags 966. { 967. return b->flags & n; 968. > } 969. 970. /* Populate a BN_GENCB structure with an "old"-style callback */ crypto/bn/bn_lib.c:257:10: Taking false branch 255. return; 256. bn_check_top(a); 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) ^ 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:259:9: Taking false branch 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) ^ 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:263:9: 261. else { 262. #if OPENSSL_API_COMPAT < 0x00908000L 263. > a->flags |= BN_FLG_FREE; 264. #endif 265. a->d = NULL; crypto/bn/bn_lib.c:265:9: 263. a->flags |= BN_FLG_FREE; 264. #endif 265. > a->d = NULL; 266. } 267. } crypto/bn/bn_lib.c:259:5: 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. > if (a->flags & BN_FLG_MALLOCED) 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:267:1: return from a call to BN_free 265. a->d = NULL; 266. } 267. > } 268. 269. void bn_init(BIGNUM *a) test/bntest.c:499:5: 497. BN_free(b); 498. BN_free(c); 499. > BN_free(d); 500. BN_free(e); 501. return (1); crypto/bn/bn_lib.c:252:1: start of procedure BN_free() 250. } 251. 252. > void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) crypto/bn/bn_lib.c:254:9: Taking false branch 252. void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) ^ 255. return; 256. bn_check_top(a); crypto/bn/bn_lib.c:257:10: 255. return; 256. bn_check_top(a); 257. > if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:965:1: start of procedure BN_get_flags() 963. } 964. 965. > int BN_get_flags(const BIGNUM *b, int n) 966. { 967. return b->flags & n; crypto/bn/bn_lib.c:967:5: 965. int BN_get_flags(const BIGNUM *b, int n) 966. { 967. > return b->flags & n; 968. } 969. crypto/bn/bn_lib.c:968:1: return from a call to BN_get_flags 966. { 967. return b->flags & n; 968. > } 969. 970. /* Populate a BN_GENCB structure with an "old"-style callback */ crypto/bn/bn_lib.c:257:10: Taking false branch 255. return; 256. bn_check_top(a); 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) ^ 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:259:9: Taking false branch 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) ^ 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:263:9: 261. else { 262. #if OPENSSL_API_COMPAT < 0x00908000L 263. > a->flags |= BN_FLG_FREE; 264. #endif 265. a->d = NULL; crypto/bn/bn_lib.c:265:9: 263. a->flags |= BN_FLG_FREE; 264. #endif 265. > a->d = NULL; 266. } 267. } crypto/bn/bn_lib.c:259:5: 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. > if (a->flags & BN_FLG_MALLOCED) 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:267:1: return from a call to BN_free 265. a->d = NULL; 266. } 267. > } 268. 269. void bn_init(BIGNUM *a)
https://github.com/openssl/openssl/blob/d9e309a675900030d7308e36f614962a344816f9/test/bntest.c/#L499
d2a_code_trace_data_44241
int ossl_init_thread_start(uint64_t opts) { struct thread_local_inits_st *locals; if (!OPENSSL_init_crypto(0, NULL)) return 0; locals = ossl_init_get_thread_local(1); if (locals == NULL) return 0; if (opts & OPENSSL_INIT_THREAD_ASYNC) { #ifdef OPENSSL_INIT_DEBUG fprintf(stderr, "OPENSSL_INIT: ossl_init_thread_start: " "marking thread for async\n"); #endif locals->async = 1; } if (opts & OPENSSL_INIT_THREAD_ERR_STATE) { #ifdef OPENSSL_INIT_DEBUG fprintf(stderr, "OPENSSL_INIT: ossl_init_thread_start: " "marking thread for err_state\n"); #endif locals->err_state = 1; } return 1; } crypto/init.c:402: error: MEMORY_LEAK memory dynamically allocated by call to `ossl_init_get_thread_local()` at line 384, column 14 is not reachable after line 402, column 9. Showing all 41 steps of the trace crypto/init.c:377:1: start of procedure ossl_init_thread_start() 375. } 376. 377. > int ossl_init_thread_start(uint64_t opts) 378. { 379. struct thread_local_inits_st *locals; crypto/init.c:381:10: Taking false branch 379. struct thread_local_inits_st *locals; 380. 381. if (!OPENSSL_init_crypto(0, NULL)) ^ 382. return 0; 383. crypto/init.c:384:5: 382. return 0; 383. 384. > locals = ossl_init_get_thread_local(1); 385. 386. if (locals == NULL) crypto/init.c:50:1: start of procedure ossl_init_get_thread_local() 48. } 49. 50. > static struct thread_local_inits_st *ossl_init_get_thread_local(int alloc) 51. { 52. struct thread_local_inits_st *local = crypto/init.c:52:5: 50. static struct thread_local_inits_st *ossl_init_get_thread_local(int alloc) 51. { 52. > struct thread_local_inits_st *local = 53. CRYPTO_THREAD_get_local(&threadstopkey); 54. crypto/threads_pthread.c:121:1: start of procedure CRYPTO_THREAD_get_local() 119. } 120. 121. > void *CRYPTO_THREAD_get_local(CRYPTO_THREAD_LOCAL *key) 122. { 123. return pthread_getspecific(*key); crypto/threads_pthread.c:123:5: Skipping pthread_getspecific(): method has no implementation 121. void *CRYPTO_THREAD_get_local(CRYPTO_THREAD_LOCAL *key) 122. { 123. return pthread_getspecific(*key); ^ 124. } 125. crypto/threads_pthread.c:124:1: return from a call to CRYPTO_THREAD_get_local 122. { 123. return pthread_getspecific(*key); 124. > } 125. 126. int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val) crypto/init.c:55:9: Taking true branch 53. CRYPTO_THREAD_get_local(&threadstopkey); 54. 55. if (local == NULL && alloc) { ^ 56. local = OPENSSL_zalloc(sizeof *local); 57. if (local != NULL && !CRYPTO_THREAD_set_local(&threadstopkey, local)) { crypto/init.c:55:26: Taking true branch 53. CRYPTO_THREAD_get_local(&threadstopkey); 54. 55. if (local == NULL && alloc) { ^ 56. local = OPENSSL_zalloc(sizeof *local); 57. if (local != NULL && !CRYPTO_THREAD_set_local(&threadstopkey, local)) { crypto/init.c:56:9: 54. 55. if (local == NULL && alloc) { 56. > local = OPENSSL_zalloc(sizeof *local); 57. if (local != NULL && !CRYPTO_THREAD_set_local(&threadstopkey, local)) { 58. OPENSSL_free(local); crypto/mem.c:198:1: start of procedure CRYPTO_zalloc() 196. } 197. 198. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 199. { 200. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:200:5: 198. void *CRYPTO_zalloc(size_t num, const char *file, int line) 199. { 200. > void *ret = CRYPTO_malloc(num, file, line); 201. 202. FAILTEST(); crypto/mem.c:170:1: start of procedure CRYPTO_malloc() 168. #endif 169. 170. > void *CRYPTO_malloc(size_t num, const char *file, int line) 171. { 172. void *ret = NULL; crypto/mem.c:172:5: 170. void *CRYPTO_malloc(size_t num, const char *file, int line) 171. { 172. > void *ret = NULL; 173. 174. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) crypto/mem.c:174:9: Taking false branch 172. void *ret = NULL; 173. 174. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) ^ 175. return malloc_impl(num, file, line); 176. crypto/mem.c:177:9: Taking false branch 175. return malloc_impl(num, file, line); 176. 177. if (num == 0) ^ 178. return NULL; 179. crypto/mem.c:181:5: 179. 180. FAILTEST(); 181. > allow_customize = 0; 182. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 183. if (call_malloc_debug) { crypto/mem.c:191:5: 189. } 190. #else 191. > (void)(file); (void)(line); 192. ret = malloc(num); 193. #endif crypto/mem.c:191:19: 189. } 190. #else 191. > (void)(file); (void)(line); 192. ret = malloc(num); 193. #endif crypto/mem.c:192:5: 190. #else 191. (void)(file); (void)(line); 192. > ret = malloc(num); 193. #endif 194. crypto/mem.c:195:5: 193. #endif 194. 195. > return ret; 196. } 197. crypto/mem.c:196:1: return from a call to CRYPTO_malloc 194. 195. return ret; 196. > } 197. 198. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:203:9: Taking true branch 201. 202. FAILTEST(); 203. if (ret != NULL) ^ 204. memset(ret, 0, num); 205. return ret; crypto/mem.c:204:9: 202. FAILTEST(); 203. if (ret != NULL) 204. > memset(ret, 0, num); 205. return ret; 206. } crypto/mem.c:205:5: 203. if (ret != NULL) 204. memset(ret, 0, num); 205. > return ret; 206. } 207. crypto/mem.c:206:1: return from a call to CRYPTO_zalloc 204. memset(ret, 0, num); 205. return ret; 206. > } 207. 208. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/init.c:57:13: Taking true branch 55. if (local == NULL && alloc) { 56. local = OPENSSL_zalloc(sizeof *local); 57. if (local != NULL && !CRYPTO_THREAD_set_local(&threadstopkey, local)) { ^ 58. OPENSSL_free(local); 59. return NULL; crypto/init.c:57:31: 55. if (local == NULL && alloc) { 56. local = OPENSSL_zalloc(sizeof *local); 57. > if (local != NULL && !CRYPTO_THREAD_set_local(&threadstopkey, local)) { 58. OPENSSL_free(local); 59. return NULL; crypto/threads_pthread.c:126:1: start of procedure CRYPTO_THREAD_set_local() 124. } 125. 126. > int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val) 127. { 128. if (pthread_setspecific(*key, val) != 0) crypto/threads_pthread.c:128:9: Taking false branch 126. int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val) 127. { 128. if (pthread_setspecific(*key, val) != 0) ^ 129. return 0; 130. crypto/threads_pthread.c:131:5: 129. return 0; 130. 131. > return 1; 132. } 133. crypto/threads_pthread.c:132:1: return from a call to CRYPTO_THREAD_set_local 130. 131. return 1; 132. > } 133. 134. int CRYPTO_THREAD_cleanup_local(CRYPTO_THREAD_LOCAL *key) crypto/init.c:57:31: Taking false branch 55. if (local == NULL && alloc) { 56. local = OPENSSL_zalloc(sizeof *local); 57. if (local != NULL && !CRYPTO_THREAD_set_local(&threadstopkey, local)) { ^ 58. OPENSSL_free(local); 59. return NULL; crypto/init.c:62:10: Taking false branch 60. } 61. } 62. if (!alloc) { ^ 63. CRYPTO_THREAD_set_local(&threadstopkey, NULL); 64. } crypto/init.c:66:5: 64. } 65. 66. > return local; 67. } 68. crypto/init.c:67:1: return from a call to ossl_init_get_thread_local 65. 66. return local; 67. > } 68. 69. typedef struct ossl_init_stop_st OPENSSL_INIT_STOP; crypto/init.c:386:9: Taking false branch 384. locals = ossl_init_get_thread_local(1); 385. 386. if (locals == NULL) ^ 387. return 0; 388. crypto/init.c:389:9: Taking false branch 387. return 0; 388. 389. if (opts & OPENSSL_INIT_THREAD_ASYNC) { ^ 390. #ifdef OPENSSL_INIT_DEBUG 391. fprintf(stderr, "OPENSSL_INIT: ossl_init_thread_start: " crypto/init.c:397:9: Taking true branch 395. } 396. 397. if (opts & OPENSSL_INIT_THREAD_ERR_STATE) { ^ 398. #ifdef OPENSSL_INIT_DEBUG 399. fprintf(stderr, "OPENSSL_INIT: ossl_init_thread_start: " crypto/init.c:402:9: 400. "marking thread for err_state\n"); 401. #endif 402. > locals->err_state = 1; 403. } 404.
https://github.com/openssl/openssl/blob/89bc9cf682e833d44fe135c901fe75f600d871ef/crypto/init.c/#L402
d2a_code_trace_data_44242
static void new_audio_stream(AVFormatContext *oc) { AVStream *st; AVCodecContext *audio_enc; enum CodecID codec_id; st = av_new_stream(oc, streamid_map[oc->nb_streams]); if (!st) { fprintf(stderr, "Could not alloc stream\n"); ffmpeg_exit(1); } avcodec_get_context_defaults2(st->codec, AVMEDIA_TYPE_AUDIO); bitstream_filters[nb_output_files][oc->nb_streams - 1]= audio_bitstream_filters; audio_bitstream_filters= NULL; avcodec_thread_init(st->codec, thread_count); audio_enc = st->codec; audio_enc->codec_type = AVMEDIA_TYPE_AUDIO; if(audio_codec_tag) audio_enc->codec_tag= audio_codec_tag; if (oc->oformat->flags & AVFMT_GLOBALHEADER) { audio_enc->flags |= CODEC_FLAG_GLOBAL_HEADER; avcodec_opts[AVMEDIA_TYPE_AUDIO]->flags|= CODEC_FLAG_GLOBAL_HEADER; } if (audio_stream_copy) { st->stream_copy = 1; audio_enc->channels = audio_channels; audio_enc->sample_rate = audio_sample_rate; } else { AVCodec *codec; set_context_opts(audio_enc, avcodec_opts[AVMEDIA_TYPE_AUDIO], AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM); if (audio_codec_name) { codec_id = find_codec_or_die(audio_codec_name, AVMEDIA_TYPE_AUDIO, 1, audio_enc->strict_std_compliance); codec = avcodec_find_encoder_by_name(audio_codec_name); output_codecs[nb_ocodecs] = codec; } else { codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, AVMEDIA_TYPE_AUDIO); codec = avcodec_find_encoder(codec_id); } audio_enc->codec_id = codec_id; if (audio_qscale > QSCALE_NONE) { audio_enc->flags |= CODEC_FLAG_QSCALE; audio_enc->global_quality = st->quality = FF_QP2LAMBDA * audio_qscale; } audio_enc->channels = audio_channels; audio_enc->sample_fmt = audio_sample_fmt; audio_enc->sample_rate = audio_sample_rate; audio_enc->channel_layout = channel_layout; if (avcodec_channel_layout_num_channels(channel_layout) != audio_channels) audio_enc->channel_layout = 0; choose_sample_fmt(st, codec); choose_sample_rate(st, codec); } nb_ocodecs++; audio_enc->time_base= (AVRational){1, audio_sample_rate}; if (audio_language) { av_metadata_set2(&st->metadata, "language", audio_language, 0); av_freep(&audio_language); } audio_disable = 0; av_freep(&audio_codec_name); audio_stream_copy = 0; } ffmpeg.c:3501: error: Null Dereference pointer `st` last assigned on line 3496 could be null and is dereferenced at line 3501, column 35. ffmpeg.c:3490:1: start of procedure new_audio_stream() 3488. } 3489. 3490. static void new_audio_stream(AVFormatContext *oc) ^ 3491. { 3492. AVStream *st; ffmpeg.c:3496:5: 3494. enum CodecID codec_id; 3495. 3496. st = av_new_stream(oc, streamid_map[oc->nb_streams]); ^ 3497. if (!st) { 3498. fprintf(stderr, "Could not alloc stream\n"); libavformat/utils.c:2501:1: start of procedure av_new_stream() 2499. } 2500. 2501. AVStream *av_new_stream(AVFormatContext *s, int id) ^ 2502. { 2503. AVStream *st; libavformat/utils.c:2506:9: Taking true branch 2504. int i; 2505. 2506. if (s->nb_streams >= MAX_STREAMS){ ^ 2507. av_log(s, AV_LOG_ERROR, "Too many streams\n"); 2508. return NULL; libavformat/utils.c:2507:9: Skipping av_log(): empty list of specs 2505. 2506. if (s->nb_streams >= MAX_STREAMS){ 2507. av_log(s, AV_LOG_ERROR, "Too many streams\n"); ^ 2508. return NULL; 2509. } libavformat/utils.c:2508:9: 2506. if (s->nb_streams >= MAX_STREAMS){ 2507. av_log(s, AV_LOG_ERROR, "Too many streams\n"); 2508. return NULL; ^ 2509. } 2510. libavformat/utils.c:2543:1: return from a call to av_new_stream 2541. s->streams[s->nb_streams++] = st; 2542. return st; 2543. } ^ 2544. 2545. AVProgram *av_new_program(AVFormatContext *ac, int id) ffmpeg.c:3497:10: Taking true branch 3495. 3496. st = av_new_stream(oc, streamid_map[oc->nb_streams]); 3497. if (!st) { ^ 3498. fprintf(stderr, "Could not alloc stream\n"); 3499. ffmpeg_exit(1); ffmpeg.c:3498:9: 3496. st = av_new_stream(oc, streamid_map[oc->nb_streams]); 3497. if (!st) { 3498. fprintf(stderr, "Could not alloc stream\n"); ^ 3499. ffmpeg_exit(1); 3500. } ffmpeg.c:3499:9: Skipping ffmpeg_exit(): empty list of specs 3497. if (!st) { 3498. fprintf(stderr, "Could not alloc stream\n"); 3499. ffmpeg_exit(1); ^ 3500. } 3501. avcodec_get_context_defaults2(st->codec, AVMEDIA_TYPE_AUDIO); ffmpeg.c:3501:5: 3499. ffmpeg_exit(1); 3500. } 3501. avcodec_get_context_defaults2(st->codec, AVMEDIA_TYPE_AUDIO); ^ 3502. 3503. bitstream_filters[nb_output_files][oc->nb_streams - 1]= audio_bitstream_filters;
https://github.com/libav/libav/blob/ad0d70c964f852a18e9ab8124f0e7aa8876cac6e/ffmpeg.c/#L3501
d2a_code_trace_data_44243
static void slide(signed char *r, const uint8_t *a) { int i; int b; int k; for (i = 0; i < 256; ++i) { r[i] = 1 & (a[i >> 3] >> (i & 7)); } for (i = 0; i < 256; ++i) { if (r[i]) { for (b = 1; b <= 6 && i + b < 256; ++b) { if (r[i + b]) { if (r[i] + (r[i + b] << b) <= 15) { r[i] += r[i + b] << b; r[i + b] = 0; } else if (r[i] - (r[i + b] << b) >= -15) { r[i] -= r[i + b] << b; for (k = i + b; k < 256; ++k) { if (!r[k]) { r[k] = 1; break; } r[k] = 0; } } else { break; } } } } } } crypto/ec/curve25519.c:3703: error: BUFFER_OVERRUN_L2 Offset: [1, 260] Size: 256 by call to `slide`. Showing all 7 steps of the trace crypto/ec/curve25519.c:3693:1: Array declaration 3691. * and b = b[0]+256*b[1]+...+256^31 b[31]. 3692. * B is the Ed25519 base point (x,4/5) with x positive. */ 3693. > static void ge_double_scalarmult_vartime(ge_p2 *r, const uint8_t *a, 3694. const ge_p3 *A, const uint8_t *b) { 3695. signed char aslide[256]; crypto/ec/curve25519.c:3703:3: Call 3701. int i; 3702. 3703. slide(aslide, a); ^ 3704. slide(bslide, b); 3705. crypto/ec/curve25519.c:3597:8: <Offset trace> 3595. } 3596. 3597. for (i = 0; i < 256; ++i) { ^ 3598. if (r[i]) { 3599. for (b = 1; b <= 6 && i + b < 256; ++b) { crypto/ec/curve25519.c:3597:8: Assignment 3595. } 3596. 3597. for (i = 0; i < 256; ++i) { ^ 3598. if (r[i]) { 3599. for (b = 1; b <= 6 && i + b < 256; ++b) { crypto/ec/curve25519.c:3588:1: <Length trace> 3586. } 3587. 3588. > static void slide(signed char *r, const uint8_t *a) { 3589. int i; 3590. int b; crypto/ec/curve25519.c:3588:1: Parameter `*r` 3586. } 3587. 3588. > static void slide(signed char *r, const uint8_t *a) { 3589. int i; 3590. int b; crypto/ec/curve25519.c:3600:13: Array access: Offset: [1, 260] Size: 256 by call to `slide` 3598. if (r[i]) { 3599. for (b = 1; b <= 6 && i + b < 256; ++b) { 3600. if (r[i + b]) { ^ 3601. if (r[i] + (r[i + b] << b) <= 15) { 3602. r[i] += r[i + b] << b;
https://github.com/openssl/openssl/blob/04dec1ab34df70c1588d42cc394e8fa8b5f3191c/crypto/ec/curve25519.c/#L3600
d2a_code_trace_data_44244
int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) { if (!ossl_assert(pkt->subs != NULL && len != 0)) return 0; if (pkt->maxsize - pkt->written < len) return 0; if (pkt->staticbuf == NULL && (pkt->buf->length - pkt->written < len)) { size_t newlen; size_t reflen; reflen = (len > pkt->buf->length) ? len : pkt->buf->length; if (reflen > SIZE_MAX / 2) { newlen = SIZE_MAX; } else { newlen = reflen * 2; if (newlen < DEFAULT_BUF_SIZE) newlen = DEFAULT_BUF_SIZE; } if (BUF_MEM_grow(pkt->buf, newlen) == 0) return 0; } if (allocbytes != NULL) *allocbytes = WPACKET_get_curr(pkt); return 1; } ssl/statem/extensions_clnt.c:416: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [`pkt->written`, `pkt->written` + 4]):unsigned64 by call to `WPACKET_put_bytes__`. Showing all 12 steps of the trace ssl/statem/extensions_clnt.c:415:10: Call 413. return EXT_RETURN_NOT_SENT; 414. 415. if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_encrypt_then_mac) ^ 416. || !WPACKET_put_bytes_u16(pkt, 0)) { 417. SSLerr(SSL_F_TLS_CONSTRUCT_CTOS_ETM, ERR_R_INTERNAL_ERROR); ssl/packet.c:306:1: Parameter `pkt->buf->length` 304. } 305. 306. > int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size) 307. { 308. unsigned char *data; ssl/statem/extensions_clnt.c:416:17: Call 414. 415. if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_encrypt_then_mac) 416. || !WPACKET_put_bytes_u16(pkt, 0)) { ^ 417. SSLerr(SSL_F_TLS_CONSTRUCT_CTOS_ETM, ERR_R_INTERNAL_ERROR); 418. return EXT_RETURN_FAIL; ssl/packet.c:306:1: Parameter `pkt->written` 304. } 305. 306. > int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size) 307. { 308. unsigned char *data; ssl/packet.c:312:17: Call 310. /* Internal API, so should not fail */ 311. if (!ossl_assert(size <= sizeof(unsigned int)) 312. || !WPACKET_allocate_bytes(pkt, size, &data) ^ 313. || !put_value(data, val, size)) 314. return 0; ssl/packet.c:15:1: Parameter `pkt->written` 13. #define DEFAULT_BUF_SIZE 256 14. 15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes)) ssl/packet.c:17:10: Call 15. int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes)) ^ 18. return 0; 19. ssl/packet.c:39:1: <LHS trace> 37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data) 38. 39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 40. { 41. /* Internal API, so should not fail */ ssl/packet.c:39:1: Parameter `pkt->buf->length` 37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data) 38. 39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 40. { 41. /* Internal API, so should not fail */ ssl/packet.c:39:1: <RHS trace> 37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data) 38. 39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 40. { 41. /* Internal API, so should not fail */ ssl/packet.c:39:1: Parameter `len` 37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data) 38. 39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 40. { 41. /* Internal API, so should not fail */ ssl/packet.c:48:36: Binary operation: ([0, +oo] - [pkt->written, pkt->written + 4]):unsigned64 by call to `WPACKET_put_bytes__` 46. return 0; 47. 48. if (pkt->staticbuf == NULL && (pkt->buf->length - pkt->written < len)) { ^ 49. size_t newlen; 50. size_t reflen;
https://github.com/openssl/openssl/blob/7f7eb90b8ac55997c5c825bb3ebcfe28611e06f5/ssl/packet.c/#L48
d2a_code_trace_data_44245
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:3979: error: NULL_DEREFERENCE pointer `cpk` last assigned on line 3978 could be null and is dereferenced at line 3979, column 45. Showing all 30 steps of the trace ssl/t1_lib.c:3967:1: start of procedure ssl_get_auto_dh() 3965. 3966. #ifndef OPENSSL_NO_DH 3967. > DH *ssl_get_auto_dh(SSL *s) 3968. { 3969. int dh_secbits = 80; ssl/t1_lib.c:3969:5: 3967. DH *ssl_get_auto_dh(SSL *s) 3968. { 3969. > int dh_secbits = 80; 3970. if (s->cert->dh_tmp_auto == 2) 3971. return DH_get_1024_160(); ssl/t1_lib.c:3970:9: Taking false branch 3968. { 3969. int dh_secbits = 80; 3970. if (s->cert->dh_tmp_auto == 2) ^ 3971. return DH_get_1024_160(); 3972. if (s->s3->tmp.new_cipher->algorithm_auth & (SSL_aNULL | SSL_aPSK)) { ssl/t1_lib.c:3972:9: Taking false branch 3970. if (s->cert->dh_tmp_auto == 2) 3971. return DH_get_1024_160(); 3972. if (s->s3->tmp.new_cipher->algorithm_auth & (SSL_aNULL | SSL_aPSK)) { ^ 3973. if (s->s3->tmp.new_cipher->strength_bits == 256) 3974. dh_secbits = 128; ssl/t1_lib.c:3978:9: 3976. dh_secbits = 80; 3977. } else { 3978. > CERT_PKEY *cpk = ssl_get_server_send_pkey(s); 3979. dh_secbits = EVP_PKEY_security_bits(cpk->privatekey); 3980. } ssl/ssl_lib.c:2772:1: start of procedure ssl_get_server_send_pkey() 2770. } 2771. 2772. > CERT_PKEY *ssl_get_server_send_pkey(SSL *s) 2773. { 2774. CERT *c; ssl/ssl_lib.c:2777:5: 2775. int i; 2776. 2777. > c = s->cert; 2778. if (!s->s3 || !s->s3->tmp.new_cipher) 2779. return NULL; ssl/ssl_lib.c:2778:10: Taking false branch 2776. 2777. c = s->cert; 2778. if (!s->s3 || !s->s3->tmp.new_cipher) ^ 2779. return NULL; 2780. ssl_set_masks(s); ssl/ssl_lib.c:2778:20: Taking false branch 2776. 2777. c = s->cert; 2778. if (!s->s3 || !s->s3->tmp.new_cipher) ^ 2779. return NULL; 2780. ssl_set_masks(s); ssl/ssl_lib.c:2780:5: Skipping ssl_set_masks(): empty list of specs 2778. if (!s->s3 || !s->s3->tmp.new_cipher) 2779. return NULL; 2780. ssl_set_masks(s); ^ 2781. 2782. i = ssl_get_server_cert_index(s); ssl/ssl_lib.c:2782:5: 2780. ssl_set_masks(s); 2781. 2782. > i = ssl_get_server_cert_index(s); 2783. 2784. /* This may or may not be an error. */ ssl/ssl_lib.c:2751:1: start of procedure ssl_get_server_cert_index() 2749. #endif 2750. 2751. > static int ssl_get_server_cert_index(const SSL *s) 2752. { 2753. int idx; ssl/ssl_lib.c:2754:5: 2752. { 2753. int idx; 2754. > idx = ssl_cipher_get_cert_index(s->s3->tmp.new_cipher); 2755. if (idx == SSL_PKEY_RSA_ENC && !s->cert->pkeys[SSL_PKEY_RSA_ENC].x509) 2756. idx = SSL_PKEY_RSA_SIGN; ssl/ssl_ciph.c:1872:1: start of procedure ssl_cipher_get_cert_index() 1870. 1871. /* For a cipher return the index corresponding to the certificate type */ 1872. > int ssl_cipher_get_cert_index(const SSL_CIPHER *c) 1873. { 1874. uint32_t alg_a; ssl/ssl_ciph.c:1876:5: 1874. uint32_t alg_a; 1875. 1876. > alg_a = c->algorithm_auth; 1877. 1878. if (alg_a & SSL_aECDSA) ssl/ssl_ciph.c:1878:9: Taking false branch 1876. alg_a = c->algorithm_auth; 1877. 1878. if (alg_a & SSL_aECDSA) ^ 1879. return SSL_PKEY_ECC; 1880. else if (alg_a & SSL_aDSS) ssl/ssl_ciph.c:1880:14: Taking false branch 1878. if (alg_a & SSL_aECDSA) 1879. return SSL_PKEY_ECC; 1880. else if (alg_a & SSL_aDSS) ^ 1881. return SSL_PKEY_DSA_SIGN; 1882. else if (alg_a & SSL_aRSA) ssl/ssl_ciph.c:1882:14: Taking true branch 1880. else if (alg_a & SSL_aDSS) 1881. return SSL_PKEY_DSA_SIGN; 1882. else if (alg_a & SSL_aRSA) ^ 1883. return SSL_PKEY_RSA_ENC; 1884. else if (alg_a & SSL_aGOST12) ssl/ssl_ciph.c:1883:9: 1881. return SSL_PKEY_DSA_SIGN; 1882. else if (alg_a & SSL_aRSA) 1883. > return SSL_PKEY_RSA_ENC; 1884. else if (alg_a & SSL_aGOST12) 1885. return SSL_PKEY_GOST_EC; ssl/ssl_ciph.c:1890:1: return from a call to ssl_cipher_get_cert_index 1888. 1889. return -1; 1890. > } 1891. 1892. const SSL_CIPHER *ssl_get_cipher_by_char(SSL *ssl, const unsigned char *ptr) ssl/ssl_lib.c:2755:9: Taking true branch 2753. int idx; 2754. idx = ssl_cipher_get_cert_index(s->s3->tmp.new_cipher); 2755. if (idx == SSL_PKEY_RSA_ENC && !s->cert->pkeys[SSL_PKEY_RSA_ENC].x509) ^ 2756. idx = SSL_PKEY_RSA_SIGN; 2757. if (idx == SSL_PKEY_GOST_EC) { ssl/ssl_lib.c:2755:37: Taking false branch 2753. int idx; 2754. idx = ssl_cipher_get_cert_index(s->s3->tmp.new_cipher); 2755. if (idx == SSL_PKEY_RSA_ENC && !s->cert->pkeys[SSL_PKEY_RSA_ENC].x509) ^ 2756. idx = SSL_PKEY_RSA_SIGN; 2757. if (idx == SSL_PKEY_GOST_EC) { ssl/ssl_lib.c:2757:9: Taking false branch 2755. if (idx == SSL_PKEY_RSA_ENC && !s->cert->pkeys[SSL_PKEY_RSA_ENC].x509) 2756. idx = SSL_PKEY_RSA_SIGN; 2757. if (idx == SSL_PKEY_GOST_EC) { ^ 2758. if (s->cert->pkeys[SSL_PKEY_GOST12_512].x509) 2759. idx = SSL_PKEY_GOST12_512; ssl/ssl_lib.c:2767:9: Taking false branch 2765. idx = -1; 2766. } 2767. if (idx == -1) ^ 2768. SSLerr(SSL_F_SSL_GET_SERVER_CERT_INDEX, ERR_R_INTERNAL_ERROR); 2769. return idx; ssl/ssl_lib.c:2769:5: 2767. if (idx == -1) 2768. SSLerr(SSL_F_SSL_GET_SERVER_CERT_INDEX, ERR_R_INTERNAL_ERROR); 2769. > return idx; 2770. } 2771. ssl/ssl_lib.c:2770:1: return from a call to ssl_get_server_cert_index 2768. SSLerr(SSL_F_SSL_GET_SERVER_CERT_INDEX, ERR_R_INTERNAL_ERROR); 2769. return idx; 2770. > } 2771. 2772. CERT_PKEY *ssl_get_server_send_pkey(SSL *s) ssl/ssl_lib.c:2785:9: Taking true branch 2783. 2784. /* This may or may not be an error. */ 2785. if (i < 0) ^ 2786. return NULL; 2787. ssl/ssl_lib.c:2786:9: 2784. /* This may or may not be an error. */ 2785. if (i < 0) 2786. > return NULL; 2787. 2788. /* May be NULL. */ ssl/ssl_lib.c:2790:1: return from a call to ssl_get_server_send_pkey 2788. /* May be NULL. */ 2789. return &c->pkeys[i]; 2790. > } 2791. 2792. EVP_PKEY *ssl_get_sign_pkey(SSL *s, const SSL_CIPHER *cipher, ssl/t1_lib.c:3979:9: 3977. } else { 3978. CERT_PKEY *cpk = ssl_get_server_send_pkey(s); 3979. > dh_secbits = EVP_PKEY_security_bits(cpk->privatekey); 3980. } 3981.
https://github.com/openssl/openssl/blob/de451856f08364ad6c6659b6eacbe820edc2aab9/ssl/t1_lib.c/#L3979
d2a_code_trace_data_44246
void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) { unsigned long hash; OPENSSL_LH_NODE *nn, **rn; void *ret; lh->error = 0; rn = getrn(lh, data, &hash); if (*rn == NULL) { lh->num_no_delete++; return (NULL); } else { nn = *rn; *rn = nn->next; ret = nn->data; OPENSSL_free(nn); lh->num_delete++; } lh->num_items--; if ((lh->num_nodes > MIN_NODES) && (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes))) contract(lh); return (ret); } ssl/record/rec_layer_d1.c:250: error: INTEGER_OVERFLOW_L2 ([0, max(0, `s->initial_ctx->sessions->num_items`)] - 1):unsigned64 by call to `dtls1_process_record`. Showing all 15 steps of the trace ssl/record/rec_layer_d1.c:237:1: Parameter `s->initial_ctx->sessions->num_items` 235. 236. 237. > int dtls1_process_buffered_records(SSL *s) 238. { 239. pitem *item; ssl/record/rec_layer_d1.c:250:18: Call 248. while (pqueue_peek(s->rlayer.d->unprocessed_rcds.q)) { 249. dtls1_get_unprocessed_record(s); 250. if (!dtls1_process_record(s)) ^ 251. return (0); 252. if (dtls1_buffer_record(s, &(s->rlayer.d->processed_rcds), ssl/record/ssl3_record.c:1264:1: Parameter `s->initial_ctx->sessions->num_items` 1262. } 1263. 1264. > int dtls1_process_record(SSL *s) 1265. { 1266. int i, al; ssl/record/ssl3_record.c:1423:5: Call 1421. 1422. f_err: 1423. ssl3_send_alert(s, SSL3_AL_FATAL, al); ^ 1424. err: 1425. return (0); ssl/s3_msg.c:64:1: Parameter `s->initial_ctx->sessions->num_items` 62. } 63. 64. > int ssl3_send_alert(SSL *s, int level, int desc) 65. { 66. /* Map tls/ssl alert value to correct one */ ssl/s3_msg.c:75:9: Call 73. /* If a fatal one, remove from cache */ 74. if ((level == SSL3_AL_FATAL) && (s->session != NULL)) 75. SSL_CTX_remove_session(s->session_ctx, s->session); ^ 76. 77. s->s3->alert_dispatch = 1; ssl/ssl_sess.c:691:1: Parameter `ctx->sessions->num_items` 689. } 690. 691. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 692. { 693. return remove_session_lock(ctx, c, 1); ssl/ssl_sess.c:693:12: Call 691. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 692. { 693. return remove_session_lock(ctx, c, 1); ^ 694. } 695. ssl/ssl_sess.c:696:1: Parameter `ctx->sessions->num_items` 694. } 695. 696. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck) 697. { 698. SSL_SESSION *r; ssl/ssl_sess.c:706:17: Call 704. if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) == c) { 705. ret = 1; 706. r = lh_SSL_SESSION_delete(ctx->sessions, c); ^ 707. SSL_SESSION_list_remove(ctx, c); 708. } ssl/ssl_locl.h:581:1: Parameter `lh->num_items` 579. }; 580. 581. > DEFINE_LHASH_OF(SSL_SESSION); 582. /* Needed in ssl_cert.c */ 583. DEFINE_LHASH_OF(X509_NAME); ssl/ssl_locl.h:581:1: Call 579. }; 580. 581. > DEFINE_LHASH_OF(SSL_SESSION); 582. /* Needed in ssl_cert.c */ 583. DEFINE_LHASH_OF(X509_NAME); crypto/lhash/lhash.c:103:1: <LHS trace> 101. } 102. 103. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) 104. { 105. unsigned long hash; crypto/lhash/lhash.c:103:1: Parameter `lh->num_items` 101. } 102. 103. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) 104. { 105. unsigned long hash; crypto/lhash/lhash.c:123:5: Binary operation: ([0, max(0, s->initial_ctx->sessions->num_items)] - 1):unsigned64 by call to `dtls1_process_record` 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_44247
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:1025: 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:777:1: Parameter `s->ctx->sessions->num_items` 775. } 776. 777. > int ssl3_get_server_hello(SSL *s) 778. { 779. STACK_OF(SSL_CIPHER) *sk; ssl/s3_clnt.c:1025:2: Call 1023. return(1); 1024. f_err: 1025. ssl3_send_alert(s,SSL3_AL_FATAL,al); ^ 1026. err: 1027. return(-1); ssl/s3_pkt.c:1452:1: Parameter `s->ctx->sessions->num_items` 1450. } 1451. 1452. > int ssl3_send_alert(SSL *s, int level, int desc) 1453. { 1454. /* Map tls/ssl alert value to correct one */ ssl/s3_pkt.c:1461:3: Call 1459. /* If a fatal one, remove from cache */ 1460. if ((level == 2) && (s->session != NULL)) 1461. SSL_CTX_remove_session(s->ctx,s->session); ^ 1462. 1463. s->s3->alert_dispatch=1; ssl/ssl_sess.c:696:1: Parameter `ctx->sessions->num_items` 694. } 695. 696. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 697. { 698. return remove_session_lock(ctx, c, 1); ssl/ssl_sess.c:698:9: Call 696. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 697. { 698. return remove_session_lock(ctx, c, 1); ^ 699. } 700. ssl/ssl_sess.c:701:1: Parameter `ctx->sessions->num_items` 699. } 700. 701. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck) 702. { 703. SSL_SESSION *r; ssl/ssl_sess.c:712:6: Call 710. { 711. ret=1; 712. r=lh_SSL_SESSION_delete(ctx->sessions,c); ^ 713. SSL_SESSION_list_remove(ctx,c); 714. } crypto/lhash/lhash.c:217:1: <LHS trace> 215. } 216. 217. > void *lh_delete(_LHASH *lh, const void *data) 218. { 219. unsigned long hash; crypto/lhash/lhash.c:217:1: Parameter `lh->num_items` 215. } 216. 217. > void *lh_delete(_LHASH *lh, const void *data) 218. { 219. unsigned long hash; crypto/lhash/lhash.c:240:2: Binary operation: ([0, max(0, s->ctx->sessions->num_items)] - 1):unsigned64 by call to `ssl3_send_alert` 238. } 239. 240. lh->num_items--; ^ 241. if ((lh->num_nodes > MIN_NODES) && 242. (lh->down_load >= (lh->num_items*LH_LOAD_MULT/lh->num_nodes)))
https://github.com/openssl/openssl/blob/27dfffd5b75ee1db114e32f6dc73e266513889c5/crypto/lhash/lhash.c/#L240
d2a_code_trace_data_44248
static int sdp_read_header(AVFormatContext *s) { RTSPState *rt = s->priv_data; RTSPStream *rtsp_st; int size, i, err; char *content; char url[1024]; if (!ff_network_init()) return AVERROR(EIO); if (s->max_delay < 0) s->max_delay = DEFAULT_REORDERING_DELAY; content = av_malloc(SDP_MAX_SIZE); size = avio_read(s->pb, content, SDP_MAX_SIZE - 1); if (size <= 0) { av_free(content); return AVERROR_INVALIDDATA; } content[size] ='\0'; err = ff_sdp_parse(s, content); av_free(content); if (err) goto fail; for (i = 0; i < rt->nb_rtsp_streams; i++) { char namebuf[50]; rtsp_st = rt->rtsp_streams[i]; getnameinfo((struct sockaddr*) &rtsp_st->sdp_ip, sizeof(rtsp_st->sdp_ip), namebuf, sizeof(namebuf), NULL, 0, NI_NUMERICHOST); ff_url_join(url, sizeof(url), "rtp", NULL, namebuf, rtsp_st->sdp_port, "?localport=%d&ttl=%d&connect=%d", rtsp_st->sdp_port, rtsp_st->sdp_ttl, rt->rtsp_flags & RTSP_FLAG_FILTER_SRC ? 1 : 0); if (ffurl_open(&rtsp_st->rtp_handle, url, AVIO_FLAG_READ_WRITE, &s->interrupt_callback, NULL) < 0) { err = AVERROR_INVALIDDATA; goto fail; } if ((err = rtsp_open_transport_ctx(s, rtsp_st))) goto fail; } return 0; fail: ff_rtsp_close_streams(s); ff_network_close(); return err; } libavformat/rtsp.c:1890: error: Null Dereference pointer `content` last assigned on line 1884 could be null and is dereferenced at line 1890, column 5. libavformat/rtsp.c:1868:1: start of procedure sdp_read_header() 1866. } 1867. 1868. static int sdp_read_header(AVFormatContext *s) ^ 1869. { 1870. RTSPState *rt = s->priv_data; libavformat/rtsp.c:1870:5: 1868. static int sdp_read_header(AVFormatContext *s) 1869. { 1870. RTSPState *rt = s->priv_data; ^ 1871. RTSPStream *rtsp_st; 1872. int size, i, err; libavformat/rtsp.c:1876:10: 1874. char url[1024]; 1875. 1876. if (!ff_network_init()) ^ 1877. return AVERROR(EIO); 1878. libavformat/network.c:124:1: start of procedure ff_network_init() 122. int ff_network_inited_globally; 123. 124. int ff_network_init(void) ^ 125. { 126. #if HAVE_WINSOCK2_H libavformat/network.c:130:10: Taking true branch 128. #endif 129. 130. if (!ff_network_inited_globally) ^ 131. av_log(NULL, AV_LOG_WARNING, "Using network protocols without global " 132. "network initialization. Please use " libavformat/network.c:131:9: Skipping av_log(): empty list of specs 129. 130. if (!ff_network_inited_globally) 131. av_log(NULL, AV_LOG_WARNING, "Using network protocols without global " ^ 132. "network initialization. Please use " 133. "avformat_network_init(), this will " libavformat/network.c:139:5: 137. return 0; 138. #endif 139. return 1; ^ 140. } 141. libavformat/network.c:140:1: return from a call to ff_network_init 138. #endif 139. return 1; 140. } ^ 141. 142. int ff_network_wait_fd(int fd, int write) libavformat/rtsp.c:1876:10: Taking false branch 1874. char url[1024]; 1875. 1876. if (!ff_network_init()) ^ 1877. return AVERROR(EIO); 1878. libavformat/rtsp.c:1879:9: Taking false branch 1877. return AVERROR(EIO); 1878. 1879. if (s->max_delay < 0) /* Not set by the caller */ ^ 1880. s->max_delay = DEFAULT_REORDERING_DELAY; 1881. libavformat/rtsp.c:1884:5: 1882. /* read the whole sdp file */ 1883. /* XXX: better loading */ 1884. content = av_malloc(SDP_MAX_SIZE); ^ 1885. size = avio_read(s->pb, content, SDP_MAX_SIZE - 1); 1886. if (size <= 0) { libavutil/mem.c:64:1: start of procedure av_malloc() 62. linker will do it automatically. */ 63. 64. void *av_malloc(size_t size) ^ 65. { 66. void *ptr = NULL; libavutil/mem.c:66:5: 64. void *av_malloc(size_t size) 65. { 66. void *ptr = NULL; ^ 67. #if CONFIG_MEMALIGN_HACK 68. long diff; libavutil/mem.c:72:8: Taking false branch 70. 71. /* let's disallow possible ambiguous cases */ 72. if(size > (INT_MAX-32) ) ^ 73. return NULL; 74. libavutil/mem.c:83:9: Taking true branch 81. ((char*)ptr)[-1]= diff; 82. #elif HAVE_POSIX_MEMALIGN 83. if (posix_memalign(&ptr,32,size)) ^ 84. ptr = NULL; 85. #elif HAVE_MEMALIGN libavutil/mem.c:84:9: 82. #elif HAVE_POSIX_MEMALIGN 83. if (posix_memalign(&ptr,32,size)) 84. ptr = NULL; ^ 85. #elif HAVE_MEMALIGN 86. ptr = memalign(32,size); libavutil/mem.c:114:5: 112. ptr = malloc(size); 113. #endif 114. return ptr; ^ 115. } 116. libavutil/mem.c:115:1: return from a call to av_malloc 113. #endif 114. return ptr; 115. } ^ 116. 117. void *av_realloc(void *ptr, size_t size) libavformat/rtsp.c:1885:5: Skipping avio_read(): empty list of specs 1883. /* XXX: better loading */ 1884. content = av_malloc(SDP_MAX_SIZE); 1885. size = avio_read(s->pb, content, SDP_MAX_SIZE - 1); ^ 1886. if (size <= 0) { 1887. av_free(content); libavformat/rtsp.c:1886:9: Taking false branch 1884. content = av_malloc(SDP_MAX_SIZE); 1885. size = avio_read(s->pb, content, SDP_MAX_SIZE - 1); 1886. if (size <= 0) { ^ 1887. av_free(content); 1888. return AVERROR_INVALIDDATA; libavformat/rtsp.c:1890:5: 1888. return AVERROR_INVALIDDATA; 1889. } 1890. content[size] ='\0'; ^ 1891. 1892. err = ff_sdp_parse(s, content);
https://github.com/libav/libav/blob/2ce7f4d4e6f3498f8a15a8bee3d124b589474197/libavformat/rtsp.c/#L1890
d2a_code_trace_data_44249
IMPLEMENT_new_ctx(ctr, CTR, 256) providers/common/ciphers/aes.c:318: error: NULL_DEREFERENCE pointer `ctx` last assigned on line 318 could be null and is dereferenced at line 318, column 1. Showing all 18 steps of the trace providers/common/ciphers/aes.c:318:1: start of procedure aes_256_ctr_newctx() 316. /* CTR */ 317. IMPLEMENT_new_params(ctr, CTR) 318. > IMPLEMENT_new_ctx(ctr, CTR, 256) 319. IMPLEMENT_new_ctx(ctr, CTR, 192) 320. IMPLEMENT_new_ctx(ctr, CTR, 128) crypto/mem.c:228:1: start of procedure CRYPTO_zalloc() 226. } 227. 228. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:230:5: 228. void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. > void *ret = CRYPTO_malloc(num, file, line); 231. 232. FAILTEST(); crypto/mem.c:192:1: start of procedure CRYPTO_malloc() 190. #endif 191. 192. > void *CRYPTO_malloc(size_t num, const char *file, int line) 193. { 194. void *ret = NULL; crypto/mem.c:194:5: 192. void *CRYPTO_malloc(size_t num, const char *file, int line) 193. { 194. > void *ret = NULL; 195. 196. INCREMENT(malloc_count); crypto/mem.c:197:9: Taking false branch 195. 196. INCREMENT(malloc_count); 197. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) ^ 198. return malloc_impl(num, file, line); 199. crypto/mem.c:200:9: Taking false branch 198. return malloc_impl(num, file, line); 199. 200. if (num == 0) ^ 201. return NULL; 202. crypto/mem.c:204:9: Taking true branch 202. 203. FAILTEST(); 204. if (allow_customize) { ^ 205. /* 206. * Disallow customization after the first allocation. We only set this crypto/mem.c:210:9: 208. * allocation. 209. */ 210. > allow_customize = 0; 211. } 212. #if !defined(OPENSSL_NO_CRYPTO_MDEBUG) && !defined(FIPS_MODE) crypto/mem.c:221:5: 219. } 220. #else 221. > (void)(file); (void)(line); 222. ret = malloc(num); 223. #endif crypto/mem.c:221:19: 219. } 220. #else 221. > (void)(file); (void)(line); 222. ret = malloc(num); 223. #endif crypto/mem.c:222:5: 220. #else 221. (void)(file); (void)(line); 222. > ret = malloc(num); 223. #endif 224. crypto/mem.c:225:5: 223. #endif 224. 225. > return ret; 226. } 227. crypto/mem.c:226:1: return from a call to CRYPTO_malloc 224. 225. return ret; 226. > } 227. 228. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:233:9: Taking false branch 231. 232. FAILTEST(); 233. if (ret != NULL) ^ 234. memset(ret, 0, num); 235. return ret; crypto/mem.c:235:5: 233. if (ret != NULL) 234. memset(ret, 0, num); 235. > return ret; 236. } 237. crypto/mem.c:236:1: return from a call to CRYPTO_zalloc 234. memset(ret, 0, num); 235. return ret; 236. > } 237. 238. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) providers/common/ciphers/aes.c:318:1: 316. /* CTR */ 317. IMPLEMENT_new_params(ctr, CTR) 318. > IMPLEMENT_new_ctx(ctr, CTR, 256) 319. IMPLEMENT_new_ctx(ctr, CTR, 192) 320. IMPLEMENT_new_ctx(ctr, CTR, 128)
https://github.com/openssl/openssl/blob/f79858ac4d90a450d0620d1ecb713bc35d7d9f8d/providers/common/ciphers/aes.c/#L318
d2a_code_trace_data_44250
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } test/bntest.c:1580: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_sqrt`. Showing all 31 steps of the trace test/bntest.c:1580:10: Call 1578. 1579. /* There are two possible answers. */ 1580. if (!TEST_true(BN_mod_sqrt(ret, a, p, ctx)) ^ 1581. || !TEST_true(BN_sub(ret2, p, ret))) 1582. goto err; crypto/bn/bn_sqrt.c:13:1: Parameter `ctx->stack.depth` 11. #include "bn_lcl.h" 12. 13. > BIGNUM *BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) 14. /* 15. * Returns 'ret' such that ret^2 == a (mod p), using the Tonelli/Shanks crypto/bn/bn_sqrt.c:59:5: Call 57. } 58. 59. BN_CTX_start(ctx); ^ 60. A = BN_CTX_get(ctx); 61. b = BN_CTX_get(ctx); crypto/bn/bn_ctx.c: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_sqrt.c:60:9: Call 58. 59. BN_CTX_start(ctx); 60. A = BN_CTX_get(ctx); ^ 61. b = BN_CTX_get(ctx); 62. q = 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_sqrt.c:61:9: Call 59. BN_CTX_start(ctx); 60. A = BN_CTX_get(ctx); 61. b = BN_CTX_get(ctx); ^ 62. q = BN_CTX_get(ctx); 63. 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_sqrt.c:62:9: Call 60. A = BN_CTX_get(ctx); 61. b = BN_CTX_get(ctx); 62. q = BN_CTX_get(ctx); ^ 63. t = BN_CTX_get(ctx); 64. 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_sqrt.c:63:9: Call 61. b = BN_CTX_get(ctx); 62. q = BN_CTX_get(ctx); 63. t = BN_CTX_get(ctx); ^ 64. x = BN_CTX_get(ctx); 65. 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_sqrt.c:64:9: Call 62. q = BN_CTX_get(ctx); 63. t = BN_CTX_get(ctx); 64. x = BN_CTX_get(ctx); ^ 65. y = BN_CTX_get(ctx); 66. if (y == NULL) crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_sqrt.c:65:9: Call 63. t = BN_CTX_get(ctx); 64. x = BN_CTX_get(ctx); 65. y = BN_CTX_get(ctx); ^ 66. if (y == NULL) 67. goto end; 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_sqrt.c:75:10: Call 73. 74. /* A = a mod p */ 75. if (!BN_nnmod(A, a, p, ctx)) ^ 76. goto end; 77. crypto/bn/bn_mod.c:13:1: Parameter `ctx->stack.depth` 11. #include "bn_lcl.h" 12. 13. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx) 14. { 15. /* crypto/bn/bn_mod.c:20:11: Call 18. */ 19. 20. if (!(BN_mod(r, m, d, ctx))) ^ 21. return 0; 22. if (!r->neg) crypto/bn/bn_div.c: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_mod_sqrt` 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_44251
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:287: error: Uninitialized Value The value read from inbuffer[_] was never initialized. libavcodec/ra144.c:287:3: 285. *(ptr++)=(inbuffer[5]>>2)&0x7f; 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;
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/ra144.c/#L287
d2a_code_trace_data_44252
static av_always_inline int cmp(MpegEncContext *s, const int x, const int y, const int subx, const int suby, const int size, const int h, int ref_index, int src_index, me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, const int flags){ MotionEstContext * const c= &s->me; const int stride= c->stride; const int uvstride= c->uvstride; const int qpel= flags&FLAG_QPEL; const int chroma= flags&FLAG_CHROMA; const int dxy= subx + (suby<<(1+qpel)); const int hx= subx + (x<<(1+qpel)); const int hy= suby + (y<<(1+qpel)); uint8_t * const * const ref= c->ref[ref_index]; uint8_t * const * const src= c->src[src_index]; int d; if(flags&FLAG_DIRECT){ assert(x >= c->xmin && hx <= c->xmax<<(qpel+1) && y >= c->ymin && hy <= c->ymax<<(qpel+1)); if(x >= c->xmin && hx <= c->xmax<<(qpel+1) && y >= c->ymin && hy <= c->ymax<<(qpel+1)){ const int time_pp= s->pp_time; const int time_pb= s->pb_time; const int mask= 2*qpel+1; if(s->mv_type==MV_TYPE_8X8){ int i; for(i=0; i<4; i++){ int fx = c->direct_basis_mv[i][0] + hx; int fy = c->direct_basis_mv[i][1] + hy; int bx = hx ? fx - c->co_located_mv[i][0] : c->co_located_mv[i][0]*(time_pb - time_pp)/time_pp + ((i &1)<<(qpel+4)); int by = hy ? fy - c->co_located_mv[i][1] : c->co_located_mv[i][1]*(time_pb - time_pp)/time_pp + ((i>>1)<<(qpel+4)); int fxy= (fx&mask) + ((fy&mask)<<(qpel+1)); int bxy= (bx&mask) + ((by&mask)<<(qpel+1)); uint8_t *dst= c->temp + 8*(i&1) + 8*stride*(i>>1); if(qpel){ c->qpel_put[1][fxy](dst, ref[0] + (fx>>2) + (fy>>2)*stride, stride); c->qpel_avg[1][bxy](dst, ref[8] + (bx>>2) + (by>>2)*stride, stride); }else{ c->hpel_put[1][fxy](dst, ref[0] + (fx>>1) + (fy>>1)*stride, stride, 8); c->hpel_avg[1][bxy](dst, ref[8] + (bx>>1) + (by>>1)*stride, stride, 8); } } }else{ int fx = c->direct_basis_mv[0][0] + hx; int fy = c->direct_basis_mv[0][1] + hy; int bx = hx ? fx - c->co_located_mv[0][0] : (c->co_located_mv[0][0]*(time_pb - time_pp)/time_pp); int by = hy ? fy - c->co_located_mv[0][1] : (c->co_located_mv[0][1]*(time_pb - time_pp)/time_pp); int fxy= (fx&mask) + ((fy&mask)<<(qpel+1)); int bxy= (bx&mask) + ((by&mask)<<(qpel+1)); if(qpel){ c->qpel_put[1][fxy](c->temp , ref[0] + (fx>>2) + (fy>>2)*stride , stride); c->qpel_put[1][fxy](c->temp + 8 , ref[0] + (fx>>2) + (fy>>2)*stride + 8 , stride); c->qpel_put[1][fxy](c->temp + 8*stride, ref[0] + (fx>>2) + (fy>>2)*stride + 8*stride, stride); c->qpel_put[1][fxy](c->temp + 8 + 8*stride, ref[0] + (fx>>2) + (fy>>2)*stride + 8 + 8*stride, stride); c->qpel_avg[1][bxy](c->temp , ref[8] + (bx>>2) + (by>>2)*stride , stride); c->qpel_avg[1][bxy](c->temp + 8 , ref[8] + (bx>>2) + (by>>2)*stride + 8 , stride); c->qpel_avg[1][bxy](c->temp + 8*stride, ref[8] + (bx>>2) + (by>>2)*stride + 8*stride, stride); c->qpel_avg[1][bxy](c->temp + 8 + 8*stride, ref[8] + (bx>>2) + (by>>2)*stride + 8 + 8*stride, stride); }else{ assert((fx>>1) + 16*s->mb_x >= -16); assert((fy>>1) + 16*s->mb_y >= -16); assert((fx>>1) + 16*s->mb_x <= s->width); assert((fy>>1) + 16*s->mb_y <= s->height); assert((bx>>1) + 16*s->mb_x >= -16); assert((by>>1) + 16*s->mb_y >= -16); assert((bx>>1) + 16*s->mb_x <= s->width); assert((by>>1) + 16*s->mb_y <= s->height); c->hpel_put[0][fxy](c->temp, ref[0] + (fx>>1) + (fy>>1)*stride, stride, 16); c->hpel_avg[0][bxy](c->temp, ref[8] + (bx>>1) + (by>>1)*stride, stride, 16); } } d = cmp_func(s, c->temp, src[0], stride, 16); }else d= 256*256*256*32; }else{ int uvdxy; if(dxy){ if(qpel){ c->qpel_put[size][dxy](c->temp, ref[0] + x + y*stride, stride); if(chroma){ int cx= hx/2; int cy= hy/2; cx= (cx>>1)|(cx&1); cy= (cy>>1)|(cy&1); uvdxy= (cx&1) + 2*(cy&1); } }else{ c->hpel_put[size][dxy](c->temp, ref[0] + x + y*stride, stride, h); if(chroma) uvdxy= dxy | (x&1) | (2*(y&1)); } d = cmp_func(s, c->temp, src[0], stride, h); }else{ d = cmp_func(s, src[0], ref[0] + x + y*stride, stride, h); if(chroma) uvdxy= (x&1) + 2*(y&1); } if(chroma){ uint8_t * const uvtemp= c->temp + 16*stride; c->hpel_put[size+1][uvdxy](uvtemp , ref[1] + (x>>1) + (y>>1)*uvstride, uvstride, h>>1); c->hpel_put[size+1][uvdxy](uvtemp+8, ref[2] + (x>>1) + (y>>1)*uvstride, uvstride, h>>1); d += chroma_cmp_func(s, uvtemp , src[1], uvstride, h>>1); d += chroma_cmp_func(s, uvtemp+8, src[2], uvstride, h>>1); } } #if 0 if(full_pel){ const int index= (((y)<<ME_MAP_SHIFT) + (x))&(ME_MAP_SIZE-1); score_map[index]= d; } d += (c->mv_penalty[hx - c->pred_x] + c->mv_penalty[hy - c->pred_y])*c->penalty_factor; #endif return d; } libavcodec/motion_est.c:1920: error: Buffer Overrun L1 Offset: 8 Size: 4 by call to `ff_estimate_motion_b`. libavcodec/motion_est.c:1920:11: Call 1918. //FIXME penalty stuff for non mpeg4 1919. c->skip=0; 1920. fmin= ff_estimate_motion_b(s, mb_x, mb_y, s->b_forw_mv_table, 0, s->f_code) + 3*penalty_factor; ^ 1921. 1922. c->skip=0; libavcodec/motion_est.c:1481:1: Parameter `ref_index` 1479. } 1480. 1481. static int ff_estimate_motion_b(MpegEncContext * s, ^ 1482. int mb_x, int mb_y, int16_t (*mv_table)[2], int ref_index, int f_code) 1483. { libavcodec/motion_est.c:1556:16: Call 1554. } 1555. 1556. dmin = ff_epzs_motion_search(s, &mx, &my, P, 0, ref_index, s->p_mv_table, mv_scale, 0, 16); ^ 1557. 1558. break; libavcodec/motion_est_template.c:1116:1: Parameter `ref_index` 1114. 1115. //this function is dedicated to the braindamaged gcc 1116. inline int ff_epzs_motion_search(MpegEncContext * s, int *mx_ptr, int *my_ptr, ^ 1117. int P[10][2], int src_index, int ref_index, int16_t (*last_mv)[2], 1118. int ref_mv_scale, int size, int h) libavcodec/motion_est_template.c:1123:16: Call 1121. //FIXME convert other functions in the same way if faster 1122. if(c->flags==0 && h==16 && size==0){ 1123. return epzs_motion_search_internal(s, mx_ptr, my_ptr, P, src_index, ref_index, last_mv, ref_mv_scale, 0, 0, 16); ^ 1124. // case FLAG_QPEL: 1125. // return epzs_motion_search_internal(s, mx_ptr, my_ptr, P, src_index, ref_index, last_mv, ref_mv_scale, FLAG_QPEL); libavcodec/motion_est_template.c:999:1: Parameter `ref_index` 997. optimal mv. 998. */ 999. static av_always_inline int epzs_motion_search_internal(MpegEncContext * s, int *mx_ptr, int *my_ptr, ^ 1000. int P[10][2], int src_index, int ref_index, int16_t (*last_mv)[2], 1001. int ref_mv_scale, int flags, int size, int h) libavcodec/motion_est_template.c:1105:11: Call 1103. 1104. //check(best[0],best[1],0, b0) 1105. dmin= diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags); ^ 1106. 1107. //check(best[0],best[1],0, b1) libavcodec/motion_est_template.c:973:1: Parameter `ref_index` 971. } 972. 973. static av_always_inline int diamond_search(MpegEncContext * s, int *best, int dmin, ^ 974. int src_index, int ref_index, int const penalty_factor, 975. int size, int h, int flags){ libavcodec/motion_est_template.c:990:18: Call 988. return l2s_dia_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags); 989. else 990. return var_diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags); ^ 991. } 992. libavcodec/motion_est_template.c:896:1: Parameter `ref_index` 894. } 895. 896. static int var_diamond_search(MpegEncContext * s, int *best, int dmin, ^ 897. int src_index, int ref_index, int const penalty_factor, 898. int size, int h, int flags) libavcodec/motion_est_template.c:921:13: Call 919. 920. //check(x + dir,y + dia_size - dir,0, a0) 921. CHECK_MV(x + dir , y + dia_size - dir); ^ 922. } 923. libavcodec/motion_est.c:108:1: <Length trace> 106. against a proposed motion-compensated prediction of that block 107. */ 108. static av_always_inline int cmp(MpegEncContext *s, const int x, const int y, const int subx, const int suby, ^ 109. const int size, const int h, int ref_index, int src_index, 110. me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, const int flags){ libavcodec/motion_est.c:108:1: Parameter `ref_index` 106. against a proposed motion-compensated prediction of that block 107. */ 108. static av_always_inline int cmp(MpegEncContext *s, const int x, const int y, const int subx, const int suby, ^ 109. const int size, const int h, int ref_index, int src_index, 110. me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, const int flags){ libavcodec/motion_est.c:119:5: Assignment 117. const int hx= subx + (x<<(1+qpel)); 118. const int hy= suby + (y<<(1+qpel)); 119. uint8_t * const * const ref= c->ref[ref_index]; ^ 120. uint8_t * const * const src= c->src[src_index]; 121. int d; libavcodec/motion_est.c:176:50: Array access: Offset: 8 Size: 4 by call to `ff_estimate_motion_b` 174. 175. c->hpel_put[0][fxy](c->temp, ref[0] + (fx>>1) + (fy>>1)*stride, stride, 16); 176. c->hpel_avg[0][bxy](c->temp, ref[8] + (bx>>1) + (by>>1)*stride, stride, 16); ^ 177. } 178. }
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est.c/#L176
d2a_code_trace_data_44253
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.c:1471: error: Buffer Overrun L2 Offset: [0, 4048] Size: 2048 by call to `ngx_log_error_core`. src/http/ngx_http.c:1463:14: Call 1461. #endif 1462. 1463. rc = ngx_hash_add_key(&ha, &name[s].name, name[s].core_srv_conf, ^ 1464. NGX_HASH_WILDCARD_KEY); 1465. src/core/ngx_hash.c:713:1: Parameter `*key->data` 711. 712. 713. ngx_int_t ^ 714. ngx_hash_add_key(ngx_hash_keys_arrays_t *ha, ngx_str_t *key, void *value, 715. ngx_uint_t flags) src/http/ngx_http.c:1471:13: Call 1469. 1470. if (rc == NGX_DECLINED) { 1471. ngx_log_error(NGX_LOG_EMERG, cf->log, 0, ^ 1472. "invalid server name or wildcard \"%V\" on %s", 1473. &name[s].name, addr->listen_conf->addr); 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