id
stringlengths 25
25
| content
stringlengths 649
72.1k
| max_stars_repo_path
stringlengths 91
133
|
|---|---|---|
d2a_code_trace_data_44754
|
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:296: error: Uninitialized Value
The value read from outbuffer[_] was never initialized.
libavcodec/ra144.c:296:3:
294. *(ptr++)=(inbuffer[9]>>1)&0x7f;
295.
296. *(output++)=outbuffer[11];
^
297. for (x=1;x<11;*(output++)=outbuffer[x++]);
298. ptr=outbuffer+12;
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/ra144.c/#L296
|
d2a_code_trace_data_44755
|
int ossl_ec_key_gen(EC_KEY *eckey)
{
int ok = 0;
BN_CTX *ctx = NULL;
BIGNUM *priv_key = NULL, *order = NULL;
EC_POINT *pub_key = NULL;
if ((order = BN_new()) == NULL)
goto err;
if ((ctx = BN_CTX_new()) == NULL)
goto err;
if (eckey->priv_key == NULL) {
priv_key = BN_new();
if (priv_key == NULL)
goto err;
} else
priv_key = eckey->priv_key;
if (!EC_GROUP_get_order(eckey->group, order, ctx))
goto err;
do
if (!BN_rand_range(priv_key, order))
goto err;
while (BN_is_zero(priv_key)) ;
if (eckey->pub_key == NULL) {
pub_key = EC_POINT_new(eckey->group);
if (pub_key == NULL)
goto err;
} else
pub_key = eckey->pub_key;
if (!EC_POINT_mul(eckey->group, pub_key, priv_key, NULL, NULL, ctx))
goto err;
eckey->priv_key = priv_key;
eckey->pub_key = pub_key;
ok = 1;
err:
BN_free(order);
if (eckey->pub_key == NULL)
EC_POINT_free(pub_key);
if (eckey->priv_key != priv_key)
BN_free(priv_key);
BN_CTX_free(ctx);
return (ok);
}
crypto/ec/ec_key.c:296: error: MEMORY_LEAK
memory dynamically allocated by call to `BN_new()` at line 260, column 18 is not reachable after line 296, column 5.
Showing all 111 steps of the trace
crypto/ec/ec_key.c:253:1: start of procedure ossl_ec_key_gen()
251. }
252.
253. > int ossl_ec_key_gen(EC_KEY *eckey)
254. {
255. int ok = 0;
crypto/ec/ec_key.c:255:5:
253. int ossl_ec_key_gen(EC_KEY *eckey)
254. {
255. > int ok = 0;
256. BN_CTX *ctx = NULL;
257. BIGNUM *priv_key = NULL, *order = NULL;
crypto/ec/ec_key.c:256:5:
254. {
255. int ok = 0;
256. > BN_CTX *ctx = NULL;
257. BIGNUM *priv_key = NULL, *order = NULL;
258. EC_POINT *pub_key = NULL;
crypto/ec/ec_key.c:257:5:
255. int ok = 0;
256. BN_CTX *ctx = NULL;
257. > BIGNUM *priv_key = NULL, *order = NULL;
258. EC_POINT *pub_key = NULL;
259.
crypto/ec/ec_key.c:258:5:
256. BN_CTX *ctx = NULL;
257. BIGNUM *priv_key = NULL, *order = NULL;
258. > EC_POINT *pub_key = NULL;
259.
260. if ((order = BN_new()) == NULL)
crypto/ec/ec_key.c:260:9:
258. EC_POINT *pub_key = NULL;
259.
260. > if ((order = BN_new()) == NULL)
261. goto err;
262. if ((ctx = BN_CTX_new()) == NULL)
crypto/bn/bn_lib.c:277:1: start of procedure BN_new()
275. }
276.
277. > BIGNUM *BN_new(void)
278. {
279. BIGNUM *ret;
crypto/bn/bn_lib.c:281:9:
279. BIGNUM *ret;
280.
281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
155. }
156.
157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:159:5:
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. > void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:161:9: Taking true branch
159. void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
^
162. memset(ret, 0, num);
163. return ret;
crypto/mem.c:162:9:
160.
161. if (ret != NULL)
162. > memset(ret, 0, num);
163. return ret;
164. }
crypto/mem.c:163:5:
161. if (ret != NULL)
162. memset(ret, 0, num);
163. > return ret;
164. }
165.
crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
162. memset(ret, 0, num);
163. return ret;
164. > }
165.
166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/bn/bn_lib.c:281:9: Taking false branch
279. BIGNUM *ret;
280.
281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
^
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/bn/bn_lib.c:285:5:
283. return (NULL);
284. }
285. > ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. return (ret);
crypto/bn/bn_lib.c:287:5:
285. ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. > return (ret);
288. }
289.
crypto/bn/bn_lib.c:288:1: return from a call to BN_new
286. bn_check_top(ret);
287. return (ret);
288. > }
289.
290. BIGNUM *BN_secure_new(void)
crypto/ec/ec_key.c:260:9: Taking false branch
258. EC_POINT *pub_key = NULL;
259.
260. if ((order = BN_new()) == NULL)
^
261. goto err;
262. if ((ctx = BN_CTX_new()) == NULL)
crypto/ec/ec_key.c:262:9:
260. if ((order = BN_new()) == NULL)
261. goto err;
262. > if ((ctx = BN_CTX_new()) == NULL)
263. goto err;
264.
crypto/bn/bn_ctx.c:189:1: start of procedure BN_CTX_new()
187.
188.
189. > BN_CTX *BN_CTX_new(void)
190. {
191. BN_CTX *ret;
crypto/bn/bn_ctx.c:193:9:
191. BN_CTX *ret;
192.
193. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
194. BNerr(BN_F_BN_CTX_NEW, ERR_R_MALLOC_FAILURE);
195. return NULL;
crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
155. }
156.
157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:159:5:
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. > void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:161:9: Taking true branch
159. void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
^
162. memset(ret, 0, num);
163. return ret;
crypto/mem.c:162:9:
160.
161. if (ret != NULL)
162. > memset(ret, 0, num);
163. return ret;
164. }
crypto/mem.c:163:5:
161. if (ret != NULL)
162. memset(ret, 0, num);
163. > return ret;
164. }
165.
crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
162. memset(ret, 0, num);
163. return ret;
164. > }
165.
166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/bn/bn_ctx.c:193:9: Taking false branch
191. BN_CTX *ret;
192.
193. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
^
194. BNerr(BN_F_BN_CTX_NEW, ERR_R_MALLOC_FAILURE);
195. return NULL;
crypto/bn/bn_ctx.c:198:5:
196. }
197. /* Initialise the structure */
198. > BN_POOL_init(&ret->pool);
199. BN_STACK_init(&ret->stack);
200. return ret;
crypto/bn/bn_ctx.c:335:1: start of procedure BN_POOL_init()
333. /***********/
334.
335. > static void BN_POOL_init(BN_POOL *p)
336. {
337. p->head = p->current = p->tail = NULL;
crypto/bn/bn_ctx.c:337:5:
335. static void BN_POOL_init(BN_POOL *p)
336. {
337. > p->head = p->current = p->tail = NULL;
338. p->used = p->size = 0;
339. }
crypto/bn/bn_ctx.c:338:5:
336. {
337. p->head = p->current = p->tail = NULL;
338. > p->used = p->size = 0;
339. }
340.
crypto/bn/bn_ctx.c:339:1: return from a call to BN_POOL_init
337. p->head = p->current = p->tail = NULL;
338. p->used = p->size = 0;
339. > }
340.
341. static void BN_POOL_finish(BN_POOL *p)
crypto/bn/bn_ctx.c:199:5:
197. /* Initialise the structure */
198. BN_POOL_init(&ret->pool);
199. > BN_STACK_init(&ret->stack);
200. return ret;
201. }
crypto/bn/bn_ctx.c:294:1: start of procedure BN_STACK_init()
292. /************/
293.
294. > static void BN_STACK_init(BN_STACK *st)
295. {
296. st->indexes = NULL;
crypto/bn/bn_ctx.c:296:5:
294. static void BN_STACK_init(BN_STACK *st)
295. {
296. > st->indexes = NULL;
297. st->depth = st->size = 0;
298. }
crypto/bn/bn_ctx.c:297:5:
295. {
296. st->indexes = NULL;
297. > st->depth = st->size = 0;
298. }
299.
crypto/bn/bn_ctx.c:298:1: return from a call to BN_STACK_init
296. st->indexes = NULL;
297. st->depth = st->size = 0;
298. > }
299.
300. static void BN_STACK_finish(BN_STACK *st)
crypto/bn/bn_ctx.c:200:5:
198. BN_POOL_init(&ret->pool);
199. BN_STACK_init(&ret->stack);
200. > return ret;
201. }
202.
crypto/bn/bn_ctx.c:201:1: return from a call to BN_CTX_new
199. BN_STACK_init(&ret->stack);
200. return ret;
201. > }
202.
203. BN_CTX *BN_CTX_secure_new(void)
crypto/ec/ec_key.c:262:9: Taking false branch
260. if ((order = BN_new()) == NULL)
261. goto err;
262. if ((ctx = BN_CTX_new()) == NULL)
^
263. goto err;
264.
crypto/ec/ec_key.c:265:9: Taking true branch
263. goto err;
264.
265. if (eckey->priv_key == NULL) {
^
266. priv_key = BN_new();
267. if (priv_key == NULL)
crypto/ec/ec_key.c:266:9:
264.
265. if (eckey->priv_key == NULL) {
266. > priv_key = BN_new();
267. if (priv_key == NULL)
268. goto err;
crypto/bn/bn_lib.c:277:1: start of procedure BN_new()
275. }
276.
277. > BIGNUM *BN_new(void)
278. {
279. BIGNUM *ret;
crypto/bn/bn_lib.c:281:9:
279. BIGNUM *ret;
280.
281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
155. }
156.
157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:159:5:
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. > void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:161:9: Taking true branch
159. void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
^
162. memset(ret, 0, num);
163. return ret;
crypto/mem.c:162:9:
160.
161. if (ret != NULL)
162. > memset(ret, 0, num);
163. return ret;
164. }
crypto/mem.c:163:5:
161. if (ret != NULL)
162. memset(ret, 0, num);
163. > return ret;
164. }
165.
crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
162. memset(ret, 0, num);
163. return ret;
164. > }
165.
166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/bn/bn_lib.c:281:9: Taking false branch
279. BIGNUM *ret;
280.
281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
^
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/bn/bn_lib.c:285:5:
283. return (NULL);
284. }
285. > ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. return (ret);
crypto/bn/bn_lib.c:287:5:
285. ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. > return (ret);
288. }
289.
crypto/bn/bn_lib.c:288:1: return from a call to BN_new
286. bn_check_top(ret);
287. return (ret);
288. > }
289.
290. BIGNUM *BN_secure_new(void)
crypto/ec/ec_key.c:267:13: Taking false branch
265. if (eckey->priv_key == NULL) {
266. priv_key = BN_new();
267. if (priv_key == NULL)
^
268. goto err;
269. } else
crypto/ec/ec_key.c:272:10:
270. priv_key = eckey->priv_key;
271.
272. > if (!EC_GROUP_get_order(eckey->group, order, ctx))
273. goto err;
274.
crypto/ec/ec_lib.c:313:1: start of procedure EC_GROUP_get_order()
311. }
312.
313. > int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx)
314. {
315. if (!BN_copy(order, group->order))
crypto/ec/ec_lib.c:315:10: Taking false branch
313. int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx)
314. {
315. if (!BN_copy(order, group->order))
^
316. return 0;
317.
crypto/ec/ec_lib.c:318:13:
316. return 0;
317.
318. > return !BN_is_zero(order);
319. }
320.
crypto/bn/bn_lib.c:899:1: start of procedure BN_is_zero()
897. }
898.
899. > int BN_is_zero(const BIGNUM *a)
900. {
901. return a->top == 0;
crypto/bn/bn_lib.c:901:12: Condition is true
899. int BN_is_zero(const BIGNUM *a)
900. {
901. return a->top == 0;
^
902. }
903.
crypto/bn/bn_lib.c:901:5:
899. int BN_is_zero(const BIGNUM *a)
900. {
901. > return a->top == 0;
902. }
903.
crypto/bn/bn_lib.c:902:1: return from a call to BN_is_zero
900. {
901. return a->top == 0;
902. > }
903.
904. int BN_is_one(const BIGNUM *a)
crypto/ec/ec_lib.c:318:13: Condition is true
316. return 0;
317.
318. return !BN_is_zero(order);
^
319. }
320.
crypto/ec/ec_lib.c:318:12:
316. return 0;
317.
318. > return !BN_is_zero(order);
319. }
320.
crypto/ec/ec_lib.c:318:5:
316. return 0;
317.
318. > return !BN_is_zero(order);
319. }
320.
crypto/ec/ec_lib.c:319:1: return from a call to EC_GROUP_get_order
317.
318. return !BN_is_zero(order);
319. > }
320.
321. int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor,
crypto/ec/ec_key.c:272:10: Taking true branch
270. priv_key = eckey->priv_key;
271.
272. if (!EC_GROUP_get_order(eckey->group, order, ctx))
^
273. goto err;
274.
crypto/ec/ec_key.c:295:2:
293. ok = 1;
294.
295. > err:
296. BN_free(order);
297. if (eckey->pub_key == NULL)
crypto/ec/ec_key.c:296:5:
294.
295. err:
296. > BN_free(order);
297. if (eckey->pub_key == NULL)
298. EC_POINT_free(pub_key);
crypto/bn/bn_lib.c:252:1: start of procedure BN_free()
250. }
251.
252. > void BN_free(BIGNUM *a)
253. {
254. if (a == NULL)
crypto/bn/bn_lib.c:254:9: Taking false branch
252. void BN_free(BIGNUM *a)
253. {
254. if (a == NULL)
^
255. return;
256. bn_check_top(a);
crypto/bn/bn_lib.c:257:10:
255. return;
256. bn_check_top(a);
257. > if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
258. bn_free_d(a);
259. if (a->flags & BN_FLG_MALLOCED)
crypto/bn/bn_lib.c:965:1: start of procedure BN_get_flags()
963. }
964.
965. > int BN_get_flags(const BIGNUM *b, int n)
966. {
967. return b->flags & n;
crypto/bn/bn_lib.c:967:5:
965. int BN_get_flags(const BIGNUM *b, int n)
966. {
967. > return b->flags & n;
968. }
969.
crypto/bn/bn_lib.c:968:1: return from a call to BN_get_flags
966. {
967. return b->flags & n;
968. > }
969.
970. /* Populate a BN_GENCB structure with an "old"-style callback */
crypto/bn/bn_lib.c:257:10: Taking false branch
255. return;
256. bn_check_top(a);
257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
^
258. bn_free_d(a);
259. if (a->flags & BN_FLG_MALLOCED)
crypto/bn/bn_lib.c:259:9: Taking false branch
257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
258. bn_free_d(a);
259. if (a->flags & BN_FLG_MALLOCED)
^
260. OPENSSL_free(a);
261. else {
crypto/bn/bn_lib.c:263:9:
261. else {
262. #if OPENSSL_API_COMPAT < 0x00908000L
263. > a->flags |= BN_FLG_FREE;
264. #endif
265. a->d = NULL;
crypto/bn/bn_lib.c:265:9:
263. a->flags |= BN_FLG_FREE;
264. #endif
265. > a->d = NULL;
266. }
267. }
crypto/bn/bn_lib.c:259:5:
257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
258. bn_free_d(a);
259. > if (a->flags & BN_FLG_MALLOCED)
260. OPENSSL_free(a);
261. else {
crypto/bn/bn_lib.c:267:1: return from a call to BN_free
265. a->d = NULL;
266. }
267. > }
268.
269. void bn_init(BIGNUM *a)
|
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/crypto/ec/ec_key.c/#L296
|
d2a_code_trace_data_44756
|
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:2408: 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/statem_clnt.c:2407:10: Call
2405. }
2406.
2407. if (!WPACKET_put_bytes_u8(pkt, V_ASN1_SEQUENCE | V_ASN1_CONSTRUCTED)
^
2408. || (msglen >= 0x80 && !WPACKET_put_bytes_u8(pkt, 0x81))
2409. || !WPACKET_sub_memcpy_u8(pkt, tmp, msglen)) {
ssl/packet.c:261:1: Parameter `pkt->buf->length`
259. }
260.
261. > int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size)
262. {
263. unsigned char *data;
ssl/statem/statem_clnt.c:2408:36: Call
2406.
2407. if (!WPACKET_put_bytes_u8(pkt, V_ASN1_SEQUENCE | V_ASN1_CONSTRUCTED)
2408. || (msglen >= 0x80 && !WPACKET_put_bytes_u8(pkt, 0x81))
^
2409. || !WPACKET_sub_memcpy_u8(pkt, tmp, msglen)) {
2410. *al = SSL_AD_INTERNAL_ERROR;
ssl/packet.c:261:1: Parameter `pkt->written`
259. }
260.
261. > int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size)
262. {
263. unsigned char *data;
ssl/packet.c:269:17: Call
267.
268. if (size > sizeof(unsigned int)
269. || !WPACKET_allocate_bytes(pkt, size, &data)
^
270. || !put_value(data, val, size))
271. return 0;
ssl/packet.c:15:1: Parameter `pkt->written`
13. #define DEFAULT_BUF_SIZE 256
14.
15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
16. {
17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes))
ssl/packet.c:17:10: Call
15. int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
16. {
17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes))
^
18. return 0;
19.
ssl/packet.c:36:1: <LHS trace>
34. }
35.
36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
37. {
38. /* Internal API, so should not fail */
ssl/packet.c:36:1: Parameter `pkt->buf->length`
34. }
35.
36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
37. {
38. /* Internal API, so should not fail */
ssl/packet.c:36:1: <RHS trace>
34. }
35.
36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
37. {
38. /* Internal API, so should not fail */
ssl/packet.c:36:1: Parameter `len`
34. }
35.
36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
37. {
38. /* Internal API, so should not fail */
ssl/packet.c:46:9: Binary operation: ([0, +oo] - [pkt->written, pkt->written + 4]):unsigned64 by call to `WPACKET_put_bytes__`
44. return 0;
45.
46. if (pkt->buf->length - pkt->written < len) {
^
47. size_t newlen;
48. size_t reflen;
|
https://github.com/openssl/openssl/blob/e4e1aa903e624044d3319622fc50222f1b2c7328/ssl/packet.c/#L46
|
d2a_code_trace_data_44757
|
int tls13_enc(SSL *s, SSL3_RECORD *recs, size_t n_recs, int send)
{
EVP_CIPHER_CTX *ctx;
unsigned char iv[EVP_MAX_IV_LENGTH];
size_t ivlen, taglen, offset, loop;
unsigned char *staticiv;
unsigned char *seq;
int lenu, lenf;
SSL3_RECORD *rec = &recs[0];
uint32_t alg_enc;
if (n_recs != 1) {
return -1;
}
if (send) {
ctx = s->enc_write_ctx;
staticiv = s->write_iv;
seq = RECORD_LAYER_get_write_sequence(&s->rlayer);
} else {
ctx = s->enc_read_ctx;
staticiv = s->read_iv;
seq = RECORD_LAYER_get_read_sequence(&s->rlayer);
}
if (ctx == NULL) {
memmove(rec->data, rec->input, rec->length);
rec->input = rec->data;
return 1;
}
ivlen = EVP_CIPHER_CTX_iv_length(ctx);
assert(s->s3->tmp.new_cipher != NULL);
if (s->s3->tmp.new_cipher == NULL)
return -1;
alg_enc = s->s3->tmp.new_cipher->algorithm_enc;
if (alg_enc & SSL_AESCCM) {
if (alg_enc & (SSL_AES128CCM8 | SSL_AES256CCM8))
taglen = EVP_CCM8_TLS_TAG_LEN;
else
taglen = EVP_CCM_TLS_TAG_LEN;
if (send && EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG, taglen,
NULL) <= 0)
return -1;
} else if (alg_enc & SSL_AESGCM) {
taglen = EVP_GCM_TLS_TAG_LEN;
} else if (alg_enc & SSL_CHACHA20) {
taglen = EVP_CHACHAPOLY_TLS_TAG_LEN;
} else {
return -1;
}
if (!send) {
if (rec->length < taglen + 1)
return 0;
rec->length -= taglen;
}
if (ivlen < SEQ_NUM_SIZE) {
return -1;
}
offset = ivlen - SEQ_NUM_SIZE;
memcpy(iv, staticiv, offset);
for (loop = 0; loop < SEQ_NUM_SIZE; loop++)
iv[offset + loop] = staticiv[offset + loop] ^ seq[loop];
for (loop = SEQ_NUM_SIZE; loop > 0; loop--) {
++seq[loop - 1];
if (seq[loop - 1] != 0)
break;
}
if (loop == 0) {
return -1;
}
if (EVP_CipherInit_ex(ctx, NULL, NULL, NULL, iv, send) <= 0
|| (!send && EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG,
taglen,
rec->data + rec->length) <= 0)
|| EVP_CipherUpdate(ctx, rec->data, &lenu, rec->input,
(unsigned int)rec->length) <= 0
|| EVP_CipherFinal_ex(ctx, rec->data + lenu, &lenf) <= 0
|| (size_t)(lenu + lenf) != rec->length) {
return -1;
}
if (send) {
if (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_GET_TAG, taglen,
rec->data + rec->length) <= 0)
return -1;
rec->length += taglen;
}
return 1;
}
test/tls13encryptiontest.c:356: error: INTEGER_OVERFLOW_L2
([9, +oo] - [8, 16]):unsigned64 by call to `tls13_enc`.
Showing all 8 steps of the trace
test/tls13encryptiontest.c:336:14: Call
334. /* Load the record */
335. ivlen = EVP_CIPHER_iv_length(ciph);
336. if (!load_record(&rec, &refdata[ctr], &key, s->read_iv, ivlen,
^
337. RECORD_LAYER_get_read_sequence(&s->rlayer))) {
338. fprintf(stderr, "Failed loading key into EVP_CIPHER_CTX\n");
test/tls13encryptiontest.c:224:1: Parameter `rec->length`
222. }
223.
224. > static int load_record(SSL3_RECORD *rec, RECORD_DATA *recd, unsigned char **key,
225. unsigned char *iv, size_t ivlen, unsigned char *seq)
226. {
test/tls13encryptiontest.c:356:13: Call
354.
355. /* Encrypt it */
356. if (tls13_enc(s, &rec, 1, 1) != 1) {
^
357. fprintf(stderr, "Failed to encrypt record %"OSSLzu"\n", ctr);
358. goto err;
ssl/record/ssl3_record_tls13.c:24:1: <LHS trace>
22. * an internal error occurred.
23. */
24. > int tls13_enc(SSL *s, SSL3_RECORD *recs, size_t n_recs, int send)
25. {
26. EVP_CIPHER_CTX *ctx;
ssl/record/ssl3_record_tls13.c:24:1: Parameter `recs->length`
22. * an internal error occurred.
23. */
24. > int tls13_enc(SSL *s, SSL3_RECORD *recs, size_t n_recs, int send)
25. {
26. EVP_CIPHER_CTX *ctx;
ssl/record/ssl3_record_tls13.c:24:1: <RHS trace>
22. * an internal error occurred.
23. */
24. > int tls13_enc(SSL *s, SSL3_RECORD *recs, size_t n_recs, int send)
25. {
26. EVP_CIPHER_CTX *ctx;
ssl/record/ssl3_record_tls13.c:24:1: Parameter `recs->length`
22. * an internal error occurred.
23. */
24. > int tls13_enc(SSL *s, SSL3_RECORD *recs, size_t n_recs, int send)
25. {
26. EVP_CIPHER_CTX *ctx;
ssl/record/ssl3_record_tls13.c:91:9: Binary operation: ([9, +oo] - [8, 16]):unsigned64 by call to `tls13_enc`
89. if (rec->length < taglen + 1)
90. return 0;
91. rec->length -= taglen;
^
92. }
93.
|
https://github.com/openssl/openssl/blob/68a55f3b451060c747986aeffa322d32c770dd62/ssl/record/ssl3_record_tls13.c/#L91
|
d2a_code_trace_data_44758
|
static int select_server_ctx(SSL *s, void *arg, int ignore)
{
const char *servername = SSL_get_servername(s, TLSEXT_NAMETYPE_host_name);
HANDSHAKE_EX_DATA *ex_data =
(HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx));
if (servername == NULL) {
ex_data->servername = SSL_TEST_SERVERNAME_SERVER1;
return SSL_TLSEXT_ERR_NOACK;
}
if (strcmp(servername, "server2") == 0) {
SSL_CTX *new_ctx = (SSL_CTX*)arg;
SSL_set_SSL_CTX(s, new_ctx);
SSL_clear_options(s, 0xFFFFFFFFL);
SSL_set_options(s, SSL_CTX_get_options(new_ctx));
ex_data->servername = SSL_TEST_SERVERNAME_SERVER2;
return SSL_TLSEXT_ERR_OK;
} else if (strcmp(servername, "server1") == 0) {
ex_data->servername = SSL_TEST_SERVERNAME_SERVER1;
return SSL_TLSEXT_ERR_OK;
} else if (ignore) {
ex_data->servername = SSL_TEST_SERVERNAME_SERVER1;
return SSL_TLSEXT_ERR_NOACK;
} else {
return SSL_TLSEXT_ERR_ALERT_FATAL;
}
}
test/handshake_helper.c:131: error: NULL_DEREFERENCE
pointer `ex_data` last assigned on line 109 could be null and is dereferenced at line 131, column 9.
Showing all 21 steps of the trace
test/handshake_helper.c:106:1: start of procedure select_server_ctx()
104. * An empty SNI extension also returns SSL_TSLEXT_ERR_NOACK.
105. */
106. > static int select_server_ctx(SSL *s, void *arg, int ignore)
107. {
108. const char *servername = SSL_get_servername(s, TLSEXT_NAMETYPE_host_name);
test/handshake_helper.c:108:5:
106. static int select_server_ctx(SSL *s, void *arg, int ignore)
107. {
108. > const char *servername = SSL_get_servername(s, TLSEXT_NAMETYPE_host_name);
109. HANDSHAKE_EX_DATA *ex_data =
110. (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx));
ssl/ssl_lib.c:2597:1: start of procedure SSL_get_servername()
2595. */
2596.
2597. > const char *SSL_get_servername(const SSL *s, const int type)
2598. {
2599. if (type != TLSEXT_NAMETYPE_host_name)
ssl/ssl_lib.c:2599:9: Taking false branch
2597. const char *SSL_get_servername(const SSL *s, const int type)
2598. {
2599. if (type != TLSEXT_NAMETYPE_host_name)
^
2600. return NULL;
2601.
ssl/ssl_lib.c:2602:12: Condition is true
2600. return NULL;
2601.
2602. return s->session && !s->ext.hostname ?
^
2603. s->session->ext.hostname : s->ext.hostname;
2604. }
ssl/ssl_lib.c:2602:27: Condition is true
2600. return NULL;
2601.
2602. return s->session && !s->ext.hostname ?
^
2603. s->session->ext.hostname : s->ext.hostname;
2604. }
ssl/ssl_lib.c:2602:12:
2600. return NULL;
2601.
2602. > return s->session && !s->ext.hostname ?
2603. s->session->ext.hostname : s->ext.hostname;
2604. }
ssl/ssl_lib.c:2602:5:
2600. return NULL;
2601.
2602. > return s->session && !s->ext.hostname ?
2603. s->session->ext.hostname : s->ext.hostname;
2604. }
ssl/ssl_lib.c:2604:1: return from a call to SSL_get_servername
2602. return s->session && !s->ext.hostname ?
2603. s->session->ext.hostname : s->ext.hostname;
2604. > }
2605.
2606. int SSL_get_servername_type(const SSL *s)
test/handshake_helper.c:109:5:
107. {
108. const char *servername = SSL_get_servername(s, TLSEXT_NAMETYPE_host_name);
109. > HANDSHAKE_EX_DATA *ex_data =
110. (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx));
111.
ssl/ssl_lib.c:4014:1: start of procedure SSL_get_ex_data()
4012. }
4013.
4014. > void *SSL_get_ex_data(const SSL *s, int idx)
4015. {
4016. return CRYPTO_get_ex_data(&s->ex_data, idx);
ssl/ssl_lib.c:4016:5:
4014. void *SSL_get_ex_data(const SSL *s, int idx)
4015. {
4016. > return CRYPTO_get_ex_data(&s->ex_data, idx);
4017. }
4018.
crypto/ex_data.c:393:1: start of procedure CRYPTO_get_ex_data()
391. * particular index in the class used by this variable
392. */
393. > void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx)
394. {
395. if (ad->sk == NULL || idx >= sk_void_num(ad->sk))
crypto/ex_data.c:395:9: Taking true branch
393. void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx)
394. {
395. if (ad->sk == NULL || idx >= sk_void_num(ad->sk))
^
396. return NULL;
397. return sk_void_value(ad->sk, idx);
crypto/ex_data.c:396:9:
394. {
395. if (ad->sk == NULL || idx >= sk_void_num(ad->sk))
396. > return NULL;
397. return sk_void_value(ad->sk, idx);
398. }
crypto/ex_data.c:398:1: return from a call to CRYPTO_get_ex_data
396. return NULL;
397. return sk_void_value(ad->sk, idx);
398. > }
ssl/ssl_lib.c:4017:1: return from a call to SSL_get_ex_data
4015. {
4016. return CRYPTO_get_ex_data(&s->ex_data, idx);
4017. > }
4018.
4019. int SSL_CTX_set_ex_data(SSL_CTX *s, int idx, void *arg)
test/handshake_helper.c:112:9: Taking false branch
110. (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx));
111.
112. if (servername == NULL) {
^
113. ex_data->servername = SSL_TEST_SERVERNAME_SERVER1;
114. return SSL_TLSEXT_ERR_NOACK;
test/handshake_helper.c:117:9: Taking false branch
115. }
116.
117. if (strcmp(servername, "server2") == 0) {
^
118. SSL_CTX *new_ctx = (SSL_CTX*)arg;
119. SSL_set_SSL_CTX(s, new_ctx);
test/handshake_helper.c:130:16: Taking true branch
128. ex_data->servername = SSL_TEST_SERVERNAME_SERVER2;
129. return SSL_TLSEXT_ERR_OK;
130. } else if (strcmp(servername, "server1") == 0) {
^
131. ex_data->servername = SSL_TEST_SERVERNAME_SERVER1;
132. return SSL_TLSEXT_ERR_OK;
test/handshake_helper.c:131:9:
129. return SSL_TLSEXT_ERR_OK;
130. } else if (strcmp(servername, "server1") == 0) {
131. > ex_data->servername = SSL_TEST_SERVERNAME_SERVER1;
132. return SSL_TLSEXT_ERR_OK;
133. } else if (ignore) {
|
https://github.com/openssl/openssl/blob/e43e6b1951de931ca500c6964496e76651332f5e/test/handshake_helper.c/#L131
|
d2a_code_trace_data_44759
|
static int var_diamond_search(MpegEncContext * s, int *best, int dmin,
int src_index, int ref_index, int const penalty_factor,
int size, int h, int flags)
{
MotionEstContext * const c= &s->me;
me_cmp_func cmpf, chroma_cmpf;
int dia_size;
LOAD_COMMON
LOAD_COMMON2
int map_generation= c->map_generation;
cmpf= s->dsp.me_cmp[size];
chroma_cmpf= s->dsp.me_cmp[size+1];
for(dia_size=1; dia_size<=c->dia_size; dia_size++){
int dir, start, end;
const int x= best[0];
const int y= best[1];
start= FFMAX(0, y + dia_size - ymax);
end = FFMIN(dia_size, xmax - x + 1);
for(dir= start; dir<end; dir++){
int d;
CHECK_MV(x + dir , y + dia_size - dir);
}
start= FFMAX(0, x + dia_size - xmax);
end = FFMIN(dia_size, y - ymin + 1);
for(dir= start; dir<end; dir++){
int d;
CHECK_MV(x + dia_size - dir, y - dir );
}
start= FFMAX(0, -y + dia_size + ymin );
end = FFMIN(dia_size, x - xmin + 1);
for(dir= start; dir<end; dir++){
int d;
CHECK_MV(x - dir , y - dia_size + dir);
}
start= FFMAX(0, -x + dia_size + xmin );
end = FFMIN(dia_size, ymax - y + 1);
for(dir= start; dir<end; dir++){
int d;
CHECK_MV(x - dia_size + dir, y + dir );
}
if(x!=best[0] || y!=best[1])
dia_size=0;
#if 0
{
int dx, dy, i;
static int stats[8*8];
dx= FFABS(x-best[0]);
dy= FFABS(y-best[1]);
stats[dy*8 + dx] ++;
if(256*256*256*64 % (stats[0]+1)==0){
for(i=0; i<64; i++){
if((i&7)==0) printf("\n");
printf("%6d ", stats[i]);
}
printf("\n");
}
}
#endif
}
return dmin;
}
libavcodec/motion_est_template.c:930: error: Uninitialized Value
The value read from ymax was never initialized.
libavcodec/motion_est_template.c:930:13:
928.
929. //check(x + dia_size - dir, y - dir,0, a1)
930. CHECK_MV(x + dia_size - dir, y - dir );
^
931. }
932.
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L930
|
d2a_code_trace_data_44760
|
static dav_error * dav_validate_resource_state(apr_pool_t *p,
const dav_resource *resource,
dav_lockdb *lockdb,
const dav_if_header *if_header,
int flags,
dav_buffer *pbuf,
request_rec *r)
{
dav_error *err;
const char *uri;
const char *etag;
const dav_hooks_locks *locks_hooks = (lockdb ? lockdb->hooks : NULL);
const dav_if_header *ifhdr_scan;
dav_if_state_list *state_list;
dav_lock *lock_list;
dav_lock *lock;
int num_matched;
int num_that_apply;
int seen_locktoken;
apr_size_t uri_len;
const char *reason = NULL;
if (lockdb == NULL) {
lock_list = NULL;
}
else {
if ((err = dav_lock_query(lockdb, resource, &lock_list)) != NULL) {
return dav_push_error(p,
HTTP_INTERNAL_SERVER_ERROR, 0,
"The locks could not be queried for "
"verification against a possible \"If:\" "
"header.",
err);
}
}
if (flags & DAV_LOCKSCOPE_EXCLUSIVE) {
if (lock_list != NULL) {
return dav_new_error(p, HTTP_LOCKED, 0, 0,
"Existing lock(s) on the requested resource "
"prevent an exclusive lock.");
}
seen_locktoken = 1;
}
else if (flags & DAV_LOCKSCOPE_SHARED) {
for (lock = lock_list; lock != NULL; lock = lock->next) {
if (lock->scope == DAV_LOCKSCOPE_EXCLUSIVE) {
return dav_new_error(p, HTTP_LOCKED, 0, 0,
"The requested resource is already "
"locked exclusively.");
}
}
seen_locktoken = 1;
}
else {
seen_locktoken = (lock_list == NULL);
}
if (if_header == NULL) {
if (seen_locktoken)
return NULL;
return dav_new_error(p, HTTP_LOCKED, 0, 0,
"This resource is locked and an \"If:\" header "
"was not supplied to allow access to the "
"resource.");
}
if (lock_list == NULL && if_header->dummy_header) {
if (flags & DAV_VALIDATE_IS_PARENT)
return NULL;
return dav_new_error(p, HTTP_BAD_REQUEST, 0, 0,
"The locktoken specified in the \"Lock-Token:\" "
"header is invalid because this resource has no "
"outstanding locks.");
}
uri = resource->uri;
uri_len = strlen(uri);
if (uri[uri_len - 1] == '/') {
dav_set_bufsize(p, pbuf, uri_len);
memcpy(pbuf->buf, uri, uri_len);
pbuf->buf[--uri_len] = '\0';
uri = pbuf->buf;
}
etag = (*resource->hooks->getetag)(resource);
num_that_apply = 0;
for (ifhdr_scan = if_header;
ifhdr_scan != NULL;
ifhdr_scan = ifhdr_scan->next) {
if (ifhdr_scan->uri != NULL
&& (uri_len != ifhdr_scan->uri_len
|| memcmp(uri, ifhdr_scan->uri, uri_len) != 0)) {
continue;
}
++num_that_apply;
for (state_list = ifhdr_scan->state;
state_list != NULL;
state_list = state_list->next) {
switch(state_list->type) {
case dav_if_etag:
{
const char *given_etag, *current_etag;
int mismatch;
if (state_list->etag[0] == 'W' &&
state_list->etag[1] == '/') {
given_etag = state_list->etag + 2;
}
else {
given_etag = state_list->etag;
}
if (etag[0] == 'W' &&
etag[1] == '/') {
current_etag = etag + 2;
}
else {
current_etag = etag;
}
mismatch = strcmp(given_etag, current_etag);
if (state_list->condition == DAV_IF_COND_NORMAL && mismatch) {
reason =
"an entity-tag was specified, but the resource's "
"actual ETag does not match.";
goto state_list_failed;
}
else if (state_list->condition == DAV_IF_COND_NOT
&& !mismatch) {
reason =
"an entity-tag was specified using the \"Not\" form, "
"but the resource's actual ETag matches the provided "
"entity-tag.";
goto state_list_failed;
}
break;
}
case dav_if_opaquelock:
if (lockdb == NULL) {
if (state_list->condition == DAV_IF_COND_NOT) {
continue;
}
reason =
"a State-token was supplied, but a lock database "
"is not available for to provide the required lock.";
goto state_list_failed;
}
num_matched = 0;
for (lock = lock_list; lock != NULL; lock = lock->next) {
if ((*locks_hooks->compare_locktoken)(state_list->locktoken, lock->locktoken)) {
continue;
}
seen_locktoken = 1;
if (state_list->condition == DAV_IF_COND_NOT) {
reason =
"a State-token was supplied, which used a "
"\"Not\" condition. The State-token was found "
"in the locks on this resource";
goto state_list_failed;
}
if (lock->auth_user &&
(!r->user ||
strcmp(lock->auth_user, r->user))) {
const char *errmsg;
errmsg = apr_pstrcat(p, "User \"",
r->user,
"\" submitted a locktoken created "
"by user \"",
lock->auth_user, "\".", NULL);
return dav_new_error(p, HTTP_FORBIDDEN, 0, 0, errmsg);
}
num_matched = 1;
break;
}
if (num_matched == 0
&& state_list->condition == DAV_IF_COND_NORMAL) {
reason =
"a State-token was supplied, but it was not found "
"in the locks on this resource.";
goto state_list_failed;
}
break;
case dav_if_unknown:
if (state_list->condition == DAV_IF_COND_NORMAL) {
reason =
"an unknown state token was supplied";
goto state_list_failed;
}
break;
}
}
if (seen_locktoken) {
return NULL;
}
break;
state_list_failed:
;
}
if (ifhdr_scan == NULL) {
if (num_that_apply == 0) {
if (seen_locktoken)
return NULL;
if (dav_find_submitted_locktoken(if_header, lock_list,
locks_hooks)) {
return NULL;
}
return dav_new_error(p, HTTP_LOCKED, 0 , 0,
"This resource is locked and the \"If:\" "
"header did not specify one of the "
"locktokens for this resource's lock(s).");
}
if (if_header->dummy_header) {
return dav_new_error(p, HTTP_BAD_REQUEST, 0, 0,
"The locktoken specified in the "
"\"Lock-Token:\" header did not specify one "
"of this resource's locktoken(s).");
}
if (reason == NULL) {
return dav_new_error(p, HTTP_PRECONDITION_FAILED, 0, 0,
"The preconditions specified by the \"If:\" "
"header did not match this resource.");
}
return dav_new_error(p, HTTP_PRECONDITION_FAILED, 0, 0,
apr_psprintf(p,
"The precondition(s) specified by "
"the \"If:\" header did not match "
"this resource. At least one "
"failure is because: %s", reason));
}
if (dav_find_submitted_locktoken(if_header, lock_list, locks_hooks)) {
return NULL;
}
if (if_header->dummy_header) {
return dav_new_error(p, HTTP_BAD_REQUEST, 0, 0,
"The locktoken specified in the "
"\"Lock-Token:\" header did not specify one "
"of this resource's locktoken(s).");
}
return dav_new_error(p, HTTP_LOCKED, 1 , 0,
"This resource is locked and the \"If:\" header "
"did not specify one of the "
"locktokens for this resource's lock(s).");
}
modules/dav/main/mod_dav.c:2310: error: INTEGER_OVERFLOW_L2
([0, +oo] - 1):unsigned64 by call to `dav_validate_request`.
modules/dav/main/mod_dav.c:2295:19: Call
2293. }
2294.
2295. if ((result = ap_xml_parse_input(r, &doc)) != OK) {
^
2296. return result;
2297. }
server/util_xml.c:107:14: Unknown value from: apr_xml_parser_done
105.
106. /* tell the parser that we're done */
107. status = apr_xml_parser_done(parser, pdoc);
^
108. if (status) {
109. /* Some parsers are stupid and return an error on blank documents. */
modules/dav/main/mod_dav.c:2300:25: Call
2298. /* note: doc == NULL if no request body */
2299.
2300. if (doc == NULL || !dav_validate_root(doc, "propertyupdate")) {
^
2301. /* This supplies additional information for the default message. */
2302. ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(00587)
modules/dav/main/util.c:291:1: Parameter `doc->root->ns`
289.
290. /* validate that the root element uses a given DAV: tagname (TRUE==valid) */
291. DAV_DECLARE(int) dav_validate_root(const apr_xml_doc *doc,
^
292. const char *tagname)
293. {
modules/dav/main/mod_dav.c:2310:16: Call
2308. /* Check If-Headers and existing locks */
2309. /* Note: depth == 0. Implies no need for a multistatus response. */
2310. if ((err = dav_validate_request(r, resource, 0, NULL, NULL,
^
2311. DAV_VALIDATE_RESOURCE, NULL)) != NULL) {
2312. /* ### add a higher-level description? */
modules/dav/main/util.c:1455:1: Parameter `resource->uri->strlen`
1453. ** error is necessary, response will point to it, else NULL.
1454. */
1455. DAV_DECLARE(dav_error *) dav_validate_request(request_rec *r,
^
1456. dav_resource *resource,
1457. int depth,
modules/dav/main/util.c:1586:15: Call
1584. }
1585. else {
1586. err = dav_validate_resource_state(r->pool, resource, lockdb,
^
1587. if_header, flags, &work_buf, r);
1588. }
modules/dav/main/util.c:802:1: <LHS trace>
800. * Returns NULL if path/uri meets if-header and lock requirements
801. */
802. static dav_error * dav_validate_resource_state(apr_pool_t *p,
^
803. const dav_resource *resource,
804. dav_lockdb *lockdb,
modules/dav/main/util.c:802:1: Parameter `resource->uri->strlen`
800. * Returns NULL if path/uri meets if-header and lock requirements
801. */
802. static dav_error * dav_validate_resource_state(apr_pool_t *p,
^
803. const dav_resource *resource,
804. dav_lockdb *lockdb,
modules/dav/main/util.c:988:5: Assignment
986. */
987. uri = resource->uri;
988. uri_len = strlen(uri);
^
989. if (uri[uri_len - 1] == '/') {
990. dav_set_bufsize(p, pbuf, uri_len);
modules/dav/main/util.c:989:9: Binary operation: ([0, +oo] - 1):unsigned64 by call to `dav_validate_request`
987. uri = resource->uri;
988. uri_len = strlen(uri);
989. if (uri[uri_len - 1] == '/') {
^
990. dav_set_bufsize(p, pbuf, uri_len);
991. memcpy(pbuf->buf, uri, uri_len);
|
https://github.com/apache/httpd/blob/8b2ec33ac5d314be345814db08e194ffeda6beb0/modules/dav/main/util.c/#L989
|
d2a_code_trace_data_44761
|
int BN_set_word(BIGNUM *a, BN_ULONG w)
{
bn_check_top(a);
if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
return (0);
a->neg = 0;
a->d[0] = w;
a->top = (w ? 1 : 0);
bn_check_top(a);
return (1);
}
test/testutil/tests.c:648: error: BUFFER_OVERRUN_L3
Offset: 0 Size: [0, 8388607] by call to `BN_set_word`.
Showing all 9 steps of the trace
test/testutil/tests.c:646:10: Call
644. return 1;
645. bw = BN_new();
646. aa = BN_dup(a);
^
647. BN_set_negative(aa, 0);
648. BN_set_word(bw, w);
crypto/bn/bn_lib.c:315:10: Call
313. if (t == NULL)
314. return NULL;
315. if (!BN_copy(t, a)) {
^
316. BN_free(t);
317. return NULL;
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);
test/testutil/tests.c:648:5: Call
646. aa = BN_dup(a);
647. BN_set_negative(aa, 0);
648. BN_set_word(bw, w);
^
649. test_fail_bignum_message(NULL, file, line, "BIGNUM", bns, ws, "abs==",
650. aa, bw);
crypto/bn/bn_lib.c:395:1: <Length trace>
393. }
394.
395. > int BN_set_word(BIGNUM *a, BN_ULONG w)
396. {
397. bn_check_top(a);
crypto/bn/bn_lib.c:395:1: Parameter `*a->d`
393. }
394.
395. > int BN_set_word(BIGNUM *a, BN_ULONG w)
396. {
397. bn_check_top(a);
crypto/bn/bn_lib.c:398:9: Call
396. {
397. bn_check_top(a);
398. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
^
399. return (0);
400. a->neg = 0;
crypto/bn/bn_lcl.h:660:1: Parameter `*a->d`
658. const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx);
659.
660. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits)
661. {
662. if (bits > (INT_MAX - BN_BITS2 + 1))
crypto/bn/bn_lib.c:401:5: Array access: Offset: 0 Size: [0, 8388607] by call to `BN_set_word`
399. return (0);
400. a->neg = 0;
401. a->d[0] = w;
^
402. a->top = (w ? 1 : 0);
403. bn_check_top(a);
|
https://github.com/openssl/openssl/blob/3f97052392cb10fca5309212bf720685262ad4a6/crypto/bn/bn_lib.c/#L401
|
d2a_code_trace_data_44762
|
static void mov_create_chapter_track(AVFormatContext *s, int tracknum)
{
MOVMuxContext *mov = s->priv_data;
MOVTrack *track = &mov->tracks[tracknum];
AVPacket pkt = { .stream_index = tracknum, .flags = AV_PKT_FLAG_KEY };
int i, len;
track->mode = mov->mode;
track->tag = MKTAG('t','e','x','t');
track->timescale = MOV_TIMESCALE;
track->enc = avcodec_alloc_context3(NULL);
track->enc->codec_type = AVMEDIA_TYPE_SUBTITLE;
for (i = 0; i < s->nb_chapters; i++) {
AVChapter *c = s->chapters[i];
AVDictionaryEntry *t;
int64_t end = av_rescale_q(c->end, c->time_base, (AVRational){1,MOV_TIMESCALE});
pkt.pts = pkt.dts = av_rescale_q(c->start, c->time_base, (AVRational){1,MOV_TIMESCALE});
pkt.duration = end - pkt.dts;
if ((t = av_dict_get(c->metadata, "title", NULL, 0))) {
len = strlen(t->value);
pkt.size = len+2;
pkt.data = av_malloc(pkt.size);
AV_WB16(pkt.data, len);
memcpy(pkt.data+2, t->value, len);
ff_mov_write_packet(s, &pkt);
av_freep(&pkt.data);
}
}
}
libavformat/movenc.c:2770: error: Null Dereference
pointer `pkt.data` last assigned on line 2769 could be null and is dereferenced at line 2770, column 13.
libavformat/movenc.c:2745:1: start of procedure mov_create_chapter_track()
2743. // QuickTime chapters involve an additional text track with the chapter names
2744. // as samples, and a tref pointing from the other tracks to the chapter one.
2745. static void mov_create_chapter_track(AVFormatContext *s, int tracknum)
^
2746. {
2747. MOVMuxContext *mov = s->priv_data;
libavformat/movenc.c:2747:5:
2745. static void mov_create_chapter_track(AVFormatContext *s, int tracknum)
2746. {
2747. MOVMuxContext *mov = s->priv_data;
^
2748. MOVTrack *track = &mov->tracks[tracknum];
2749. AVPacket pkt = { .stream_index = tracknum, .flags = AV_PKT_FLAG_KEY };
libavformat/movenc.c:2748:5:
2746. {
2747. MOVMuxContext *mov = s->priv_data;
2748. MOVTrack *track = &mov->tracks[tracknum];
^
2749. AVPacket pkt = { .stream_index = tracknum, .flags = AV_PKT_FLAG_KEY };
2750. int i, len;
libavformat/movenc.c:2749:5:
2747. MOVMuxContext *mov = s->priv_data;
2748. MOVTrack *track = &mov->tracks[tracknum];
2749. AVPacket pkt = { .stream_index = tracknum, .flags = AV_PKT_FLAG_KEY };
^
2750. int i, len;
2751.
libavformat/movenc.c:2752:5:
2750. int i, len;
2751.
2752. track->mode = mov->mode;
^
2753. track->tag = MKTAG('t','e','x','t');
2754. track->timescale = MOV_TIMESCALE;
libavformat/movenc.c:2753:5:
2751.
2752. track->mode = mov->mode;
2753. track->tag = MKTAG('t','e','x','t');
^
2754. track->timescale = MOV_TIMESCALE;
2755. track->enc = avcodec_alloc_context3(NULL);
libavformat/movenc.c:2754:5:
2752. track->mode = mov->mode;
2753. track->tag = MKTAG('t','e','x','t');
2754. track->timescale = MOV_TIMESCALE;
^
2755. track->enc = avcodec_alloc_context3(NULL);
2756. track->enc->codec_type = AVMEDIA_TYPE_SUBTITLE;
libavformat/movenc.c:2755:5:
2753. track->tag = MKTAG('t','e','x','t');
2754. track->timescale = MOV_TIMESCALE;
2755. track->enc = avcodec_alloc_context3(NULL);
^
2756. track->enc->codec_type = AVMEDIA_TYPE_SUBTITLE;
2757.
libavcodec/options.c:473:1: start of procedure avcodec_alloc_context3()
471. }
472.
473. AVCodecContext *avcodec_alloc_context3(AVCodec *codec){
^
474. AVCodecContext *avctx= av_malloc(sizeof(AVCodecContext));
475.
libavcodec/options.c:474:5:
472.
473. AVCodecContext *avcodec_alloc_context3(AVCodec *codec){
474. AVCodecContext *avctx= av_malloc(sizeof(AVCodecContext));
^
475.
476. if(avctx==NULL) return NULL;
libavutil/mem.c:64:1: start of procedure av_malloc()
62. linker will do it automatically. */
63.
64. void *av_malloc(size_t size)
^
65. {
66. void *ptr = NULL;
libavutil/mem.c:66:5:
64. void *av_malloc(size_t size)
65. {
66. void *ptr = NULL;
^
67. #if CONFIG_MEMALIGN_HACK
68. long diff;
libavutil/mem.c:72:8: Taking false branch
70.
71. /* let's disallow possible ambiguous cases */
72. if(size > (INT_MAX-32) )
^
73. return NULL;
74.
libavutil/mem.c:83:9: Taking false branch
81. ((char*)ptr)[-1]= diff;
82. #elif HAVE_POSIX_MEMALIGN
83. if (posix_memalign(&ptr,32,size))
^
84. ptr = NULL;
85. #elif HAVE_MEMALIGN
libavutil/mem.c:114:5:
112. ptr = malloc(size);
113. #endif
114. return ptr;
^
115. }
116.
libavutil/mem.c:115:1: return from a call to av_malloc
113. #endif
114. return ptr;
115. }
^
116.
117. void *av_realloc(void *ptr, size_t size)
libavcodec/options.c:476:8: Taking false branch
474. AVCodecContext *avctx= av_malloc(sizeof(AVCodecContext));
475.
476. if(avctx==NULL) return NULL;
^
477.
478. if(avcodec_get_context_defaults3(avctx, codec) < 0){
libavcodec/options.c:478:8: Taking false branch
476. if(avctx==NULL) return NULL;
477.
478. if(avcodec_get_context_defaults3(avctx, codec) < 0){
^
479. av_free(avctx);
480. return NULL;
libavcodec/options.c:483:5:
481. }
482.
483. return avctx;
^
484. }
485.
libavcodec/options.c:484:1: return from a call to avcodec_alloc_context3
482.
483. return avctx;
484. }
^
485.
486. int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src)
libavformat/movenc.c:2756:5:
2754. track->timescale = MOV_TIMESCALE;
2755. track->enc = avcodec_alloc_context3(NULL);
2756. track->enc->codec_type = AVMEDIA_TYPE_SUBTITLE;
^
2757.
2758. for (i = 0; i < s->nb_chapters; i++) {
libavformat/movenc.c:2758:10:
2756. track->enc->codec_type = AVMEDIA_TYPE_SUBTITLE;
2757.
2758. for (i = 0; i < s->nb_chapters; i++) {
^
2759. AVChapter *c = s->chapters[i];
2760. AVDictionaryEntry *t;
libavformat/movenc.c:2758:17: Loop condition is true. Entering loop body
2756. track->enc->codec_type = AVMEDIA_TYPE_SUBTITLE;
2757.
2758. for (i = 0; i < s->nb_chapters; i++) {
^
2759. AVChapter *c = s->chapters[i];
2760. AVDictionaryEntry *t;
libavformat/movenc.c:2759:9:
2757.
2758. for (i = 0; i < s->nb_chapters; i++) {
2759. AVChapter *c = s->chapters[i];
^
2760. AVDictionaryEntry *t;
2761.
libavformat/movenc.c:2762:9:
2760. AVDictionaryEntry *t;
2761.
2762. int64_t end = av_rescale_q(c->end, c->time_base, (AVRational){1,MOV_TIMESCALE});
^
2763. pkt.pts = pkt.dts = av_rescale_q(c->start, c->time_base, (AVRational){1,MOV_TIMESCALE});
2764. pkt.duration = end - pkt.dts;
libavutil/mathematics.c:133:1: start of procedure av_rescale_q()
131. }
132.
133. int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq){
^
134. int64_t b= bq.num * (int64_t)cq.den;
135. int64_t c= cq.num * (int64_t)bq.den;
libavutil/mathematics.c:134:5:
132.
133. int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq){
134. int64_t b= bq.num * (int64_t)cq.den;
^
135. int64_t c= cq.num * (int64_t)bq.den;
136. return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF);
libavutil/mathematics.c:135:5:
133. int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq){
134. int64_t b= bq.num * (int64_t)cq.den;
135. int64_t c= cq.num * (int64_t)bq.den;
^
136. return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF);
137. }
libavutil/mathematics.c:136:5: Skipping av_rescale_rnd(): empty list of specs
134. int64_t b= bq.num * (int64_t)cq.den;
135. int64_t c= cq.num * (int64_t)bq.den;
136. return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF);
^
137. }
138.
libavutil/mathematics.c:137:1: return from a call to av_rescale_q
135. int64_t c= cq.num * (int64_t)bq.den;
136. return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF);
137. }
^
138.
139. int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b){
libavformat/movenc.c:2763:9:
2761.
2762. int64_t end = av_rescale_q(c->end, c->time_base, (AVRational){1,MOV_TIMESCALE});
2763. pkt.pts = pkt.dts = av_rescale_q(c->start, c->time_base, (AVRational){1,MOV_TIMESCALE});
^
2764. pkt.duration = end - pkt.dts;
2765.
libavutil/mathematics.c:133:1: start of procedure av_rescale_q()
131. }
132.
133. int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq){
^
134. int64_t b= bq.num * (int64_t)cq.den;
135. int64_t c= cq.num * (int64_t)bq.den;
libavutil/mathematics.c:134:5:
132.
133. int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq){
134. int64_t b= bq.num * (int64_t)cq.den;
^
135. int64_t c= cq.num * (int64_t)bq.den;
136. return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF);
libavutil/mathematics.c:135:5:
133. int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq){
134. int64_t b= bq.num * (int64_t)cq.den;
135. int64_t c= cq.num * (int64_t)bq.den;
^
136. return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF);
137. }
libavutil/mathematics.c:136:5: Skipping av_rescale_rnd(): empty list of specs
134. int64_t b= bq.num * (int64_t)cq.den;
135. int64_t c= cq.num * (int64_t)bq.den;
136. return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF);
^
137. }
138.
libavutil/mathematics.c:137:1: return from a call to av_rescale_q
135. int64_t c= cq.num * (int64_t)bq.den;
136. return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF);
137. }
^
138.
139. int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b){
libavformat/movenc.c:2764:9:
2762. int64_t end = av_rescale_q(c->end, c->time_base, (AVRational){1,MOV_TIMESCALE});
2763. pkt.pts = pkt.dts = av_rescale_q(c->start, c->time_base, (AVRational){1,MOV_TIMESCALE});
2764. pkt.duration = end - pkt.dts;
^
2765.
2766. if ((t = av_dict_get(c->metadata, "title", NULL, 0))) {
libavformat/movenc.c:2766:14: Taking true branch
2764. pkt.duration = end - pkt.dts;
2765.
2766. if ((t = av_dict_get(c->metadata, "title", NULL, 0))) {
^
2767. len = strlen(t->value);
2768. pkt.size = len+2;
libavformat/movenc.c:2767:13:
2765.
2766. if ((t = av_dict_get(c->metadata, "title", NULL, 0))) {
2767. len = strlen(t->value);
^
2768. pkt.size = len+2;
2769. pkt.data = av_malloc(pkt.size);
libavformat/movenc.c:2768:13:
2766. if ((t = av_dict_get(c->metadata, "title", NULL, 0))) {
2767. len = strlen(t->value);
2768. pkt.size = len+2;
^
2769. pkt.data = av_malloc(pkt.size);
2770. AV_WB16(pkt.data, len);
libavformat/movenc.c:2769:13:
2767. len = strlen(t->value);
2768. pkt.size = len+2;
2769. pkt.data = av_malloc(pkt.size);
^
2770. AV_WB16(pkt.data, len);
2771. memcpy(pkt.data+2, t->value, len);
libavutil/mem.c:64:1: start of procedure av_malloc()
62. linker will do it automatically. */
63.
64. void *av_malloc(size_t size)
^
65. {
66. void *ptr = NULL;
libavutil/mem.c:66:5:
64. void *av_malloc(size_t size)
65. {
66. void *ptr = NULL;
^
67. #if CONFIG_MEMALIGN_HACK
68. long diff;
libavutil/mem.c:72:8: Taking true branch
70.
71. /* let's disallow possible ambiguous cases */
72. if(size > (INT_MAX-32) )
^
73. return NULL;
74.
libavutil/mem.c:73:9:
71. /* let's disallow possible ambiguous cases */
72. if(size > (INT_MAX-32) )
73. return NULL;
^
74.
75. #if CONFIG_MEMALIGN_HACK
libavutil/mem.c:115:1: return from a call to av_malloc
113. #endif
114. return ptr;
115. }
^
116.
117. void *av_realloc(void *ptr, size_t size)
libavformat/movenc.c:2770:13:
2768. pkt.size = len+2;
2769. pkt.data = av_malloc(pkt.size);
2770. AV_WB16(pkt.data, len);
^
2771. memcpy(pkt.data+2, t->value, len);
2772. ff_mov_write_packet(s, &pkt);
libavutil/bswap.h:58:1: start of procedure av_bswap16()
56.
57. #ifndef av_bswap16
58. static av_always_inline av_const uint16_t av_bswap16(uint16_t x)
^
59. {
60. x= (x>>8) | (x<<8);
libavutil/bswap.h:60:5:
58. static av_always_inline av_const uint16_t av_bswap16(uint16_t x)
59. {
60. x= (x>>8) | (x<<8);
^
61. return x;
62. }
libavutil/bswap.h:61:5:
59. {
60. x= (x>>8) | (x<<8);
61. return x;
^
62. }
63. #endif
libavutil/bswap.h:62:1: return from a call to av_bswap16
60. x= (x>>8) | (x<<8);
61. return x;
62. }
^
63. #endif
64.
|
https://github.com/libav/libav/blob/f53221049933627a31fb4a530c290802715ccf65/libavformat/movenc.c/#L2770
|
d2a_code_trace_data_44763
|
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:1078: error: Uninitialized Value
The value read from xmin was never initialized.
libavcodec/motion_est_template.c:1078:17:
1076. (last_mv[ref_mv_xy+1][1]*ref_mv_scale + (1<<15))>>16)
1077. if(s->mb_y+1<s->end_mb_y) //FIXME replace at least with last_slice_line
1078. CHECK_CLIPPED_MV((last_mv[ref_mv_xy+ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16,
^
1079. (last_mv[ref_mv_xy+ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16)
1080. }
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1078
|
d2a_code_trace_data_44764
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
crypto/ec/ecp_mont.c:241: error: BUFFER_OVERRUN_L3
Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_exp_mont`.
Showing all 36 steps of the trace
crypto/ec/ecp_mont.c:215:1: Parameter `ctx->stack.depth`
213. * We have a Mont structure, so SCA hardening is FLT inversion.
214. */
215. > int ec_GFp_mont_field_inv(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a,
216. BN_CTX *ctx)
217. {
crypto/ec/ecp_mont.c:228:5: Call
226. return 0;
227.
228. BN_CTX_start(ctx);
^
229. if ((e = BN_CTX_get(ctx)) == NULL)
230. goto err;
crypto/bn/bn_ctx.c:181:1: Parameter `ctx->stack.depth`
179. }
180.
181. > void BN_CTX_start(BN_CTX *ctx)
182. {
183. CTXDBG_ENTRY("BN_CTX_start", ctx);
crypto/ec/ecp_mont.c:241:10: Call
239. * No need for scatter-gather or BN_FLG_CONSTTIME.
240. */
241. if (!BN_mod_exp_mont(r, a, e, group->field, ctx, group->field_data1))
^
242. goto err;
243.
crypto/bn/bn_exp.c:296:1: Parameter `ctx->stack.depth`
294. }
295.
296. > int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
297. const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
298. {
crypto/bn/bn_exp.c:310:16: Call
308. || BN_get_flags(a, BN_FLG_CONSTTIME) != 0
309. || BN_get_flags(m, BN_FLG_CONSTTIME) != 0) {
310. return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont);
^
311. }
312.
crypto/bn/bn_exp.c:592:1: Parameter `ctx->stack.depth`
590. * http://www.daemonology.net/hyperthreading-considered-harmful/)
591. */
592. > int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
593. const BIGNUM *m, BN_CTX *ctx,
594. BN_MONT_CTX *in_mont)
crypto/bn/bn_exp.c:636:5: Call
634. }
635.
636. BN_CTX_start(ctx);
^
637.
638. /*
crypto/bn/bn_ctx.c:181:1: Parameter `ctx->stack.depth`
179. }
180.
181. > void BN_CTX_start(BN_CTX *ctx)
182. {
183. CTXDBG_ENTRY("BN_CTX_start", ctx);
crypto/bn/bn_exp.c:647:14: Call
645. if ((mont = BN_MONT_CTX_new()) == NULL)
646. goto err;
647. if (!BN_MONT_CTX_set(mont, m, ctx))
^
648. goto err;
649. }
crypto/bn/bn_mont.c:263:1: Parameter `ctx->stack.depth`
261. }
262.
263. > int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
264. {
265. int i, ret = 0;
crypto/bn/bn_mont.c:271:5: Call
269. return 0;
270.
271. BN_CTX_start(ctx);
^
272. if ((Ri = BN_CTX_get(ctx)) == NULL)
273. goto err;
crypto/bn/bn_ctx.c:181:1: Parameter `ctx->stack.depth`
179. }
180.
181. > void BN_CTX_start(BN_CTX *ctx)
182. {
183. CTXDBG_ENTRY("BN_CTX_start", ctx);
crypto/bn/bn_mont.c:351:19: Call
349. if (BN_is_one(&tmod))
350. BN_zero(Ri);
351. else if ((BN_mod_inverse(Ri, R, &tmod, ctx)) == NULL)
^
352. goto err;
353. if (!BN_lshift(Ri, Ri, BN_BITS2))
crypto/bn/bn_gcd.c:124:1: Parameter `ctx->stack.depth`
122. BN_CTX *ctx);
123.
124. > BIGNUM *BN_mod_inverse(BIGNUM *in,
125. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx)
126. {
crypto/bn/bn_gcd.c:129:10: Call
127. BIGNUM *rv;
128. int noinv;
129. rv = int_bn_mod_inverse(in, a, n, ctx, &noinv);
^
130. if (noinv)
131. BNerr(BN_F_BN_MOD_INVERSE, BN_R_NO_INVERSE);
crypto/bn/bn_gcd.c:135:1: Parameter `ctx->stack.depth`
133. }
134.
135. > BIGNUM *int_bn_mod_inverse(BIGNUM *in,
136. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx,
137. int *pnoinv)
crypto/bn/bn_gcd.c:155:16: Call
153. if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0)
154. || (BN_get_flags(n, BN_FLG_CONSTTIME) != 0)) {
155. return BN_mod_inverse_no_branch(in, a, n, ctx);
^
156. }
157.
crypto/bn/bn_gcd.c:458:1: Parameter `ctx->stack.depth`
456. * not contain branches that may leak sensitive information.
457. */
458. > static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
459. const BIGNUM *a, const BIGNUM *n,
460. BN_CTX *ctx)
crypto/bn/bn_gcd.c:469:5: Call
467. bn_check_top(n);
468.
469. BN_CTX_start(ctx);
^
470. A = BN_CTX_get(ctx);
471. B = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:181:1: Parameter `ctx->stack.depth`
179. }
180.
181. > void BN_CTX_start(BN_CTX *ctx)
182. {
183. CTXDBG_ENTRY("BN_CTX_start", ctx);
crypto/bn/bn_gcd.c:504:18: Call
502. bn_init(&local_B);
503. BN_with_flags(&local_B, B, BN_FLG_CONSTTIME);
504. if (!BN_nnmod(B, &local_B, A, ctx))
^
505. goto err;
506. /* Ensure local_B goes out of scope before any further use of B */
crypto/bn/bn_mod.c:13:1: Parameter `ctx->stack.depth`
11. #include "bn_lcl.h"
12.
13. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx)
14. {
15. /*
crypto/bn/bn_mod.c:20:11: Call
18. */
19.
20. if (!(BN_mod(r, m, d, ctx)))
^
21. return 0;
22. if (!r->neg)
crypto/bn/bn_div.c:209:1: Parameter `ctx->stack.depth`
207. * If 'dv' or 'rm' is NULL, the respective value is not returned.
208. */
209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
210. BN_CTX *ctx)
211. {
crypto/bn/bn_div.c:229:11: Call
227. }
228.
229. ret = bn_div_fixed_top(dv, rm, num, divisor, ctx);
^
230.
231. if (ret) {
crypto/bn/bn_div.c:280:5: Call
278. bn_check_top(rm);
279.
280. BN_CTX_start(ctx);
^
281. res = (dv == NULL) ? BN_CTX_get(ctx) : dv;
282. tmp = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c: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_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:195:1: Parameter `*ctx->stack.indexes`
193. }
194.
195. > void BN_CTX_end(BN_CTX *ctx)
196. {
197. CTXDBG_ENTRY("BN_CTX_end", ctx);
crypto/bn/bn_ctx.c:201:27: Call
199. ctx->err_stack--;
200. else {
201. unsigned int fp = BN_STACK_pop(&ctx->stack);
^
202. /* Does this stack frame have anything to release? */
203. if (fp < ctx->used)
crypto/bn/bn_ctx.c:274:1: <Offset trace>
272. }
273.
274. > static unsigned int BN_STACK_pop(BN_STACK *st)
275. {
276. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:274:1: Parameter `st->depth`
272. }
273.
274. > static unsigned int BN_STACK_pop(BN_STACK *st)
275. {
276. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:274:1: <Length trace>
272. }
273.
274. > static unsigned int BN_STACK_pop(BN_STACK *st)
275. {
276. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:274:1: Parameter `*st->indexes`
272. }
273.
274. > static unsigned int BN_STACK_pop(BN_STACK *st)
275. {
276. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:276:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_exp_mont`
274. static unsigned int BN_STACK_pop(BN_STACK *st)
275. {
276. return st->indexes[--(st->depth)];
^
277. }
278.
|
https://github.com/openssl/openssl/blob/8f58ede09572dcc6a7e6c01280dd348240199568/crypto/bn/bn_ctx.c/#L276
|
d2a_code_trace_data_44765
|
static ossl_inline void packet_forward(PACKET *pkt, size_t len)
{
pkt->curr += len;
pkt->remaining -= len;
}
test/servername_test.c:53: error: INTEGER_OVERFLOW_L2
([0, +oo] - 4):unsigned64 by call to `PACKET_forward`.
Showing all 12 steps of the trace
test/servername_test.c:49:10: Call
47.
48. len = BIO_get_mem_data(bio, (char **)&data);
49. if (!TEST_true(PACKET_buf_init(&pkt, data, len))
^
50. /* Skip the record header */
51. || !PACKET_forward(&pkt, SSL3_RT_HEADER_LENGTH)
ssl/packet_locl.h:68:8: Parameter `pkt->remaining`
66. * is being used.
67. */
68. __owur static ossl_inline int PACKET_buf_init(PACKET *pkt,
^
69. const unsigned char *buf,
70. size_t len)
test/servername_test.c:51:17: Call
49. if (!TEST_true(PACKET_buf_init(&pkt, data, len))
50. /* Skip the record header */
51. || !PACKET_forward(&pkt, SSL3_RT_HEADER_LENGTH)
^
52. /* Skip the handshake message header */
53. || !TEST_true(PACKET_forward(&pkt, SSL3_HM_HEADER_LENGTH))
ssl/packet_locl.h:463:8: Parameter `len`
461.
462. /* Move the current reading position forward |len| bytes */
463. __owur static ossl_inline int PACKET_forward(PACKET *pkt, size_t len)
^
464. {
465. if (PACKET_remaining(pkt) < len)
test/servername_test.c:53:17: Call
51. || !PACKET_forward(&pkt, SSL3_RT_HEADER_LENGTH)
52. /* Skip the handshake message header */
53. || !TEST_true(PACKET_forward(&pkt, SSL3_HM_HEADER_LENGTH))
^
54. /* Skip client version and random */
55. || !TEST_true(PACKET_forward(&pkt, CLIENT_VERSION_LEN
ssl/packet_locl.h:463:8: Parameter `len`
461.
462. /* Move the current reading position forward |len| bytes */
463. __owur static ossl_inline int PACKET_forward(PACKET *pkt, size_t len)
^
464. {
465. if (PACKET_remaining(pkt) < len)
ssl/packet_locl.h:468:5: Call
466. return 0;
467.
468. packet_forward(pkt, len);
^
469.
470. return 1;
ssl/packet_locl.h:29:1: <LHS trace>
27.
28. /* Internal unchecked shorthand; don't use outside this file. */
29. > static ossl_inline void packet_forward(PACKET *pkt, size_t len)
30. {
31. pkt->curr += len;
ssl/packet_locl.h:29:1: Parameter `pkt->remaining`
27.
28. /* Internal unchecked shorthand; don't use outside this file. */
29. > static ossl_inline void packet_forward(PACKET *pkt, size_t len)
30. {
31. pkt->curr += len;
ssl/packet_locl.h:29:1: <RHS trace>
27.
28. /* Internal unchecked shorthand; don't use outside this file. */
29. > static ossl_inline void packet_forward(PACKET *pkt, size_t len)
30. {
31. pkt->curr += len;
ssl/packet_locl.h:29:1: Parameter `len`
27.
28. /* Internal unchecked shorthand; don't use outside this file. */
29. > static ossl_inline void packet_forward(PACKET *pkt, size_t len)
30. {
31. pkt->curr += len;
ssl/packet_locl.h:32:5: Binary operation: ([0, +oo] - 4):unsigned64 by call to `PACKET_forward`
30. {
31. pkt->curr += len;
32. pkt->remaining -= len;
^
33. }
34.
|
https://github.com/openssl/openssl/blob/2e6b615f795e8ca8ae830a00079c4ea064eaae42/ssl/packet_locl.h/#L32
|
d2a_code_trace_data_44766
|
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:107: error: BUFFER_OVERRUN_L3
Offset: [-529, +oo] Size: 12 by call to `ASN1_TIME_print`.
Showing all 19 steps of the trace
crypto/x509/t_crl.c:96:9: Call
94.
95. BIO_printf(out, "Certificate Revocation List (CRL):\n");
96. l = X509_CRL_get_version(x);
^
97. BIO_printf(out, "%8sVersion %lu (0x%lx)\n", "", l + 1, l);
98. X509_CRL_get0_signature(&sig, &sig_alg, x);
crypto/x509/x509cset.c:141:1: Parameter `*crl->crl.version->data`
139. }
140.
141. > long X509_CRL_get_version(X509_CRL *crl)
142. {
143. return ASN1_INTEGER_get(crl->crl.version);
crypto/x509/x509cset.c:143:12: Call
141. long X509_CRL_get_version(X509_CRL *crl)
142. {
143. return ASN1_INTEGER_get(crl->crl.version);
^
144. }
145.
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/x509/t_crl.c:99:5: Call
97. BIO_printf(out, "%8sVersion %lu (0x%lx)\n", "", l + 1, l);
98. X509_CRL_get0_signature(&sig, &sig_alg, x);
99. X509_signature_print(out, sig_alg, NULL);
^
100. p = X509_NAME_oneline(X509_CRL_get_issuer(x), NULL, 0);
101. BIO_printf(out, "%8sIssuer: %s\n", "", p);
crypto/x509/t_x509.c:326:1: Parameter `*sig->data`
324. }
325.
326. > int X509_signature_print(BIO *bp, X509_ALGOR *sigalg, ASN1_STRING *sig)
327. {
328. int sig_nid;
crypto/x509/t_crl.c:100:9: Call
98. X509_CRL_get0_signature(&sig, &sig_alg, x);
99. X509_signature_print(out, sig_alg, NULL);
100. p = X509_NAME_oneline(X509_CRL_get_issuer(x), NULL, 0);
^
101. BIO_printf(out, "%8sIssuer: %s\n", "", p);
102. OPENSSL_free(p);
crypto/x509/x509_obj.c:67:1: Parameter `*buf`
65. #include "internal/x509_int.h"
66.
67. > char *X509_NAME_oneline(X509_NAME *a, char *buf, int len)
68. {
69. X509_NAME_ENTRY *ne;
crypto/x509/t_crl.c:104:5: Call
102. OPENSSL_free(p);
103. BIO_printf(out, "%8sLast Update: ", "");
104. ASN1_TIME_print(out, X509_CRL_get_lastUpdate(x));
^
105. BIO_printf(out, "\n%8sNext Update: ", "");
106. if (X509_CRL_get_nextUpdate(x))
crypto/asn1/a_time.c:202:1: Parameter `*tm->data`
200. }
201.
202. > int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm)
203. {
204. if (tm->type == V_ASN1_UTCTIME)
crypto/x509/t_crl.c:107:9: Call
105. BIO_printf(out, "\n%8sNext Update: ", "");
106. if (X509_CRL_get_nextUpdate(x))
107. ASN1_TIME_print(out, X509_CRL_get_nextUpdate(x));
^
108. else
109. BIO_printf(out, "NONE");
crypto/asn1/a_time.c:202:1: Parameter `*tm->data`
200. }
201.
202. > int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm)
203. {
204. if (tm->type == V_ASN1_UTCTIME)
crypto/asn1/a_time.c:207:16: Call
205. return ASN1_UTCTIME_print(bp, tm);
206. if (tm->type == V_ASN1_GENERALIZEDTIME)
207. return ASN1_GENERALIZEDTIME_print(bp, tm);
^
208. BIO_write(bp, "Bad time value", 14);
209. return (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_TIME_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/84cf97af0691290d53c0a51807fa15f0843219ef/crypto/asn1/a_gentm.c/#L308
|
d2a_code_trace_data_44767
|
void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
{
int i, j, max;
const BN_ULONG *ap;
BN_ULONG *rp;
max = n * 2;
ap = a;
rp = r;
rp[0] = rp[max - 1] = 0;
rp++;
j = n;
if (--j > 0) {
ap++;
rp[j] = bn_mul_words(rp, ap, j, ap[-1]);
rp += 2;
}
for (i = n - 2; i > 0; i--) {
j--;
ap++;
rp[j] = bn_mul_add_words(rp, ap, j, ap[-1]);
rp += 2;
}
bn_add_words(r, r, r, max);
bn_sqr_words(tmp, a, n);
bn_add_words(r, r, tmp, max);
}
test/dhtest.c:60: 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
test/dhtest.c:56:17: Call
54. BN_GENCB_set(_cb, &cb, NULL);
55. if (!TEST_ptr(a = DH_new())
56. || !TEST_true(DH_generate_parameters_ex(a, 64,
^
57. DH_GENERATOR_5, _cb)))
58. goto 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. {
test/dhtest.c:60:10: Call
58. goto err;
59.
60. if (!DH_check(a, &i))
^
61. goto err;
62. if (!TEST_false(i & DH_CHECK_P_NOT_PRIME)
crypto/dh/dh_check.c:65:1: Parameter `dh->g->top`
63. */
64.
65. > int DH_check(const DH *dh, int *ret)
66. {
67. int ok = 0, r;
crypto/dh/dh_check.c:85:13: Call
83.
84. if (dh->q) {
85. if (BN_cmp(dh->g, BN_value_one()) <= 0)
^
86. *ret |= DH_NOT_SUITABLE_GENERATOR;
87. else if (BN_cmp(dh->g, dh->p) >= 0)
crypto/bn/bn_lib.c:577:1: Parameter `a->top`
575. }
576.
577. > int BN_cmp(const BIGNUM *a, const BIGNUM *b)
578. {
579. int i;
crypto/dh/dh_check.c:87:18: Call
85. if (BN_cmp(dh->g, BN_value_one()) <= 0)
86. *ret |= DH_NOT_SUITABLE_GENERATOR;
87. else if (BN_cmp(dh->g, dh->p) >= 0)
^
88. *ret |= DH_NOT_SUITABLE_GENERATOR;
89. else {
crypto/bn/bn_lib.c:577:1: Parameter `a->top`
575. }
576.
577. > int BN_cmp(const BIGNUM *a, const BIGNUM *b)
578. {
579. int i;
crypto/dh/dh_check.c:91:18: Call
89. else {
90. /* Check g^q == 1 mod p */
91. if (!BN_mod_exp(t1, dh->g, dh->q, dh->p, ctx))
^
92. goto err;
93. if (!BN_is_one(t1))
crypto/bn/bn_exp.c:91:1: Parameter `a->top`
89. }
90.
91. > int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
92. BN_CTX *ctx)
93. {
crypto/bn/bn_exp.c:144:19: Call
142. } else
143. # endif
144. ret = BN_mod_exp_mont(r, a, p, m, ctx, NULL);
^
145. } else
146. #endif
crypto/bn/bn_exp.c:294:1: Parameter `a->top`
292. }
293.
294. > int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
295. const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
296. {
crypto/bn/bn_exp.c:306:16: Call
304.
305. if (BN_get_flags(p, BN_FLG_CONSTTIME) != 0) {
306. return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont);
^
307. }
308.
crypto/bn/bn_exp.c:594:1: Parameter `a->top`
592. * http://www.daemonology.net/hyperthreading-considered-harmful/)
593. */
594. > int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
595. const BIGNUM *m, BN_CTX *ctx,
596. BN_MONT_CTX *in_mont)
crypto/bn/bn_exp.c:751:17: Call
749. if (!BN_to_montgomery(&am, &am, mont, ctx))
750. goto err;
751. } else if (!BN_to_montgomery(&am, a, mont, ctx))
^
752. goto err;
753.
crypto/bn/bn_lib.c:877:1: Parameter `a->top`
875. }
876.
877. > int BN_to_montgomery(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont,
878. BN_CTX *ctx)
879. {
crypto/bn/bn_lib.c:880:12: Call
878. BN_CTX *ctx)
879. {
880. return BN_mod_mul_montgomery(r, a, &(mont->RR), mont, ctx);
^
881. }
882.
crypto/bn/bn_mont.c:26:1: Parameter `a->top`
24. #endif
25.
26. > int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
27. BN_MONT_CTX *mont, BN_CTX *ctx)
28. {
crypto/bn/bn_mont.c:53:14: Call
51. bn_check_top(tmp);
52. if (a == b) {
53. if (!BN_sqr(tmp, a, ctx))
^
54. goto err;
55. } else {
crypto/bn/bn_sqr.c:17:1: Parameter `a->top`
15. * I've just gone over this and it is now %20 faster on x86 - eay - 27 Jun 96
16. */
17. > int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx)
18. {
19. int max, al;
crypto/bn/bn_sqr.c:25:5: Assignment
23. bn_check_top(a);
24.
25. al = a->top;
^
26. if (al <= 0) {
27. r->top = 0;
crypto/bn/bn_sqr.c:74:17: Call
72. if (bn_wexpand(tmp, max) == NULL)
73. goto err;
74. bn_sqr_normal(rr->d, a->d, al, tmp->d);
^
75. }
76. }
crypto/bn/bn_sqr.c:105:1: <Offset trace>
103.
104. /* tmp must have 2*n words */
105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
106. {
107. int i, j, max;
crypto/bn/bn_sqr.c:105:1: Parameter `n`
103.
104. /* tmp must have 2*n words */
105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
106. {
107. int i, j, max;
crypto/bn/bn_sqr.c:116:5: Assignment
114. rp[0] = rp[max - 1] = 0;
115. rp++;
116. j = n;
^
117.
118. if (--j > 0) {
crypto/bn/bn_sqr.c:118:9: Assignment
116. j = n;
117.
118. if (--j > 0) {
^
119. ap++;
120. rp[j] = bn_mul_words(rp, ap, j, ap[-1]);
crypto/bn/bn_sqr.c:105:1: <Length trace>
103.
104. /* tmp must have 2*n words */
105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
106. {
107. int i, j, max;
crypto/bn/bn_sqr.c:105:1: Parameter `*r`
103.
104. /* tmp must have 2*n words */
105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
106. {
107. int i, j, max;
crypto/bn/bn_sqr.c:113:5: Assignment
111. max = n * 2;
112. ap = a;
113. rp = r;
^
114. rp[0] = rp[max - 1] = 0;
115. rp++;
crypto/bn/bn_sqr.c:115:5: Assignment
113. rp = r;
114. rp[0] = rp[max - 1] = 0;
115. rp++;
^
116. j = n;
117.
crypto/bn/bn_sqr.c:120:9: Array access: Offset: [16, +oo] (⇐ 1 + [15, +oo]) Size: [0, 8388607] by call to `DH_check`
118. if (--j > 0) {
119. ap++;
120. rp[j] = bn_mul_words(rp, ap, j, ap[-1]);
^
121. rp += 2;
122. }
|
https://github.com/openssl/openssl/blob/dc99b885ded3cbc586d5ffec779f0e75a269bda3/crypto/bn/bn_sqr.c/#L120
|
d2a_code_trace_data_44768
|
static void
ngx_slab_free_pages(ngx_slab_pool_t *pool, ngx_slab_page_t *page,
ngx_uint_t pages)
{
ngx_uint_t type;
ngx_slab_page_t *prev, *join;
page->slab = pages--;
if (pages) {
ngx_memzero(&page[1], pages * sizeof(ngx_slab_page_t));
}
if (page->next) {
prev = (ngx_slab_page_t *) (page->prev & ~NGX_SLAB_PAGE_MASK);
prev->next = page->next;
page->next->prev = page->prev;
}
join = page + page->slab;
if (join < pool->last) {
type = join->prev & NGX_SLAB_PAGE_MASK;
if (type == NGX_SLAB_PAGE) {
if (join->next != NULL) {
pages += join->slab;
page->slab += join->slab;
prev = (ngx_slab_page_t *) (join->prev & ~NGX_SLAB_PAGE_MASK);
prev->next = join->next;
join->next->prev = join->prev;
join->slab = NGX_SLAB_PAGE_FREE;
join->next = NULL;
join->prev = NGX_SLAB_PAGE;
}
}
}
if (page > pool->pages) {
join = page - 1;
type = join->prev & NGX_SLAB_PAGE_MASK;
if (type == NGX_SLAB_PAGE) {
if (join->slab == NGX_SLAB_PAGE_FREE) {
join = (ngx_slab_page_t *) (join->prev & ~NGX_SLAB_PAGE_MASK);
}
if (join->next != NULL) {
pages += join->slab;
join->slab += page->slab;
prev = (ngx_slab_page_t *) (join->prev & ~NGX_SLAB_PAGE_MASK);
prev->next = join->next;
join->next->prev = join->prev;
page->slab = NGX_SLAB_PAGE_FREE;
page->next = NULL;
page->prev = NGX_SLAB_PAGE;
page = join;
}
}
}
if (pages) {
page[pages].prev = (uintptr_t) page;
}
page->prev = (uintptr_t) &pool->free;
page->next = pool->free.next;
page->next->prev = (uintptr_t) page;
pool->free.next = page;
}
src/core/ngx_slab.c:586: error: Integer Overflow L2
([0, `pool->pages->slab`] - 1):unsigned64 by call to `ngx_slab_free_pages`.
src/core/ngx_slab.c:412:1: Parameter `pool->pages->slab`
410.
411.
412. void
^
413. ngx_slab_free_locked(ngx_slab_pool_t *pool, void *p)
414. {
src/core/ngx_slab.c:429:5: Assignment
427. n = ((u_char *) p - pool->start) >> ngx_pagesize_shift;
428. page = &pool->pages[n];
429. slab = page->slab;
^
430. type = page->prev & NGX_SLAB_PAGE_MASK;
431.
src/core/ngx_slab.c:584:9: Assignment
582.
583. n = ((u_char *) p - pool->start) >> ngx_pagesize_shift;
584. size = slab & ~NGX_SLAB_PAGE_START;
^
585.
586. ngx_slab_free_pages(pool, &pool->pages[n], size);
src/core/ngx_slab.c:586:9: Call
584. size = slab & ~NGX_SLAB_PAGE_START;
585.
586. ngx_slab_free_pages(pool, &pool->pages[n], size);
^
587.
588. ngx_slab_junk(p, size << ngx_pagesize_shift);
src/core/ngx_slab.c:675:1: <LHS trace>
673.
674.
675. static void
^
676. ngx_slab_free_pages(ngx_slab_pool_t *pool, ngx_slab_page_t *page,
677. ngx_uint_t pages)
src/core/ngx_slab.c:675:1: Parameter `pages`
673.
674.
675. static void
^
676. ngx_slab_free_pages(ngx_slab_pool_t *pool, ngx_slab_page_t *page,
677. ngx_uint_t pages)
src/core/ngx_slab.c:682:18: Binary operation: ([0, pool->pages->slab] - 1):unsigned64 by call to `ngx_slab_free_pages`
680. ngx_slab_page_t *prev, *join;
681.
682. page->slab = pages--;
^
683.
684. if (pages) {
|
https://github.com/nginx/nginx/blob/afb4aafc6e42781068ce3f23d22fd6e2012787c7/src/core/ngx_slab.c/#L682
|
d2a_code_trace_data_44769
|
static int check_chain_extensions(X509_STORE_CTX *ctx)
{
int i, ok = 0, must_be_ca, plen = 0;
X509 *x;
int (*cb) (int xok, X509_STORE_CTX *xctx);
int proxy_path_length = 0;
int purpose;
int allow_proxy_certs;
cb = ctx->verify_cb;
must_be_ca = -1;
if (ctx->parent) {
allow_proxy_certs = 0;
purpose = X509_PURPOSE_CRL_SIGN;
} else {
allow_proxy_certs =
! !(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS);
if (getenv("OPENSSL_ALLOW_PROXY_CERTS"))
allow_proxy_certs = 1;
purpose = ctx->param->purpose;
}
for (i = 0; i == 0 || i < ctx->num_untrusted; i++) {
int ret;
x = sk_X509_value(ctx->chain, i);
if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL)
&& (x->ex_flags & EXFLAG_CRITICAL)) {
ctx->error = X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION;
ctx->error_depth = i;
ctx->current_cert = x;
ok = cb(0, ctx);
if (!ok)
goto end;
}
if (!allow_proxy_certs && (x->ex_flags & EXFLAG_PROXY)) {
ctx->error = X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED;
ctx->error_depth = i;
ctx->current_cert = x;
ok = cb(0, ctx);
if (!ok)
goto end;
}
ret = X509_check_ca(x);
switch (must_be_ca) {
case -1:
if ((ctx->param->flags & X509_V_FLAG_X509_STRICT)
&& (ret != 1) && (ret != 0)) {
ret = 0;
ctx->error = X509_V_ERR_INVALID_CA;
} else
ret = 1;
break;
case 0:
if (ret != 0) {
ret = 0;
ctx->error = X509_V_ERR_INVALID_NON_CA;
} else
ret = 1;
break;
default:
if ((ret == 0)
|| ((ctx->param->flags & X509_V_FLAG_X509_STRICT)
&& (ret != 1))) {
ret = 0;
ctx->error = X509_V_ERR_INVALID_CA;
} else
ret = 1;
break;
}
if (ret == 0) {
ctx->error_depth = i;
ctx->current_cert = x;
ok = cb(0, ctx);
if (!ok)
goto end;
}
if (ctx->param->purpose > 0) {
ret = X509_check_purpose(x, purpose, must_be_ca > 0);
if ((ret == 0)
|| ((ctx->param->flags & X509_V_FLAG_X509_STRICT)
&& (ret != 1))) {
ctx->error = X509_V_ERR_INVALID_PURPOSE;
ctx->error_depth = i;
ctx->current_cert = x;
ok = cb(0, ctx);
if (!ok)
goto end;
}
}
if ((i > 1) && !(x->ex_flags & EXFLAG_SI)
&& (x->ex_pathlen != -1)
&& (plen > (x->ex_pathlen + proxy_path_length + 1))) {
ctx->error = X509_V_ERR_PATH_LENGTH_EXCEEDED;
ctx->error_depth = i;
ctx->current_cert = x;
ok = cb(0, ctx);
if (!ok)
goto end;
}
if (!(x->ex_flags & EXFLAG_SI))
plen++;
if (x->ex_flags & EXFLAG_PROXY) {
if (x->ex_pcpathlen != -1 && i > x->ex_pcpathlen) {
ctx->error = X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED;
ctx->error_depth = i;
ctx->current_cert = x;
ok = cb(0, ctx);
if (!ok)
goto end;
}
proxy_path_length++;
must_be_ca = 0;
} else
must_be_ca = 1;
}
ok = 1;
end:
return ok;
}
crypto/x509/x509_vfy.c:430: error: NULL_DEREFERENCE
pointer `x` last assigned on line 412 could be null and is dereferenced by call to `X509_check_ca()` at line 430, column 15.
Showing all 25 steps of the trace
crypto/x509/x509_vfy.c:372:1: start of procedure check_chain_extensions()
370. */
371.
372. > static int check_chain_extensions(X509_STORE_CTX *ctx)
373. {
374. int i, ok = 0, must_be_ca, plen = 0;
crypto/x509/x509_vfy.c:374:5:
372. static int check_chain_extensions(X509_STORE_CTX *ctx)
373. {
374. > int i, ok = 0, must_be_ca, plen = 0;
375. X509 *x;
376. int (*cb) (int xok, X509_STORE_CTX *xctx);
crypto/x509/x509_vfy.c:377:5:
375. X509 *x;
376. int (*cb) (int xok, X509_STORE_CTX *xctx);
377. > int proxy_path_length = 0;
378. int purpose;
379. int allow_proxy_certs;
crypto/x509/x509_vfy.c:380:5:
378. int purpose;
379. int allow_proxy_certs;
380. > cb = ctx->verify_cb;
381.
382. /*-
crypto/x509/x509_vfy.c:391:5:
389. * all certificates in the chain except the leaf certificate.
390. */
391. > must_be_ca = -1;
392.
393. /* CRL path validation */
crypto/x509/x509_vfy.c:394:9: Taking false branch
392.
393. /* CRL path validation */
394. if (ctx->parent) {
^
395. allow_proxy_certs = 0;
396. purpose = X509_PURPOSE_CRL_SIGN;
crypto/x509/x509_vfy.c:399:17: Condition is true
397. } else {
398. allow_proxy_certs =
399. ! !(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS);
^
400. /*
401. * A hack to keep people who don't want to modify their software
crypto/x509/x509_vfy.c:399:13:
397. } else {
398. allow_proxy_certs =
399. > ! !(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS);
400. /*
401. * A hack to keep people who don't want to modify their software
crypto/x509/x509_vfy.c:398:9:
396. purpose = X509_PURPOSE_CRL_SIGN;
397. } else {
398. > allow_proxy_certs =
399. ! !(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS);
400. /*
crypto/x509/x509_vfy.c:404:13: Taking false branch
402. * happy
403. */
404. if (getenv("OPENSSL_ALLOW_PROXY_CERTS"))
^
405. allow_proxy_certs = 1;
406. purpose = ctx->param->purpose;
crypto/x509/x509_vfy.c:406:9:
404. if (getenv("OPENSSL_ALLOW_PROXY_CERTS"))
405. allow_proxy_certs = 1;
406. > purpose = ctx->param->purpose;
407. }
408.
crypto/x509/x509_vfy.c:410:10:
408.
409. /* Check all untrusted certificates */
410. > for (i = 0; i == 0 || i < ctx->num_untrusted; i++) {
411. int ret;
412. x = sk_X509_value(ctx->chain, i);
crypto/x509/x509_vfy.c:410:17: Loop condition is true. Entering loop body
408.
409. /* Check all untrusted certificates */
410. for (i = 0; i == 0 || i < ctx->num_untrusted; i++) {
^
411. int ret;
412. x = sk_X509_value(ctx->chain, i);
crypto/x509/x509_vfy.c:412:9:
410. for (i = 0; i == 0 || i < ctx->num_untrusted; i++) {
411. int ret;
412. > x = sk_X509_value(ctx->chain, i);
413. if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL)
414. && (x->ex_flags & EXFLAG_CRITICAL)) {
include/openssl/x509.h:170:1: start of procedure sk_X509_value()
168. typedef struct x509_cinf_st X509_CINF;
169.
170. > DEFINE_STACK_OF(X509)
171.
172. /* This is used for a table of trust checking functions */
crypto/stack/stack.c:324:1: start of procedure sk_value()
322. }
323.
324. > void *sk_value(const _STACK *st, int i)
325. {
326. if (!st || (i < 0) || (i >= st->num))
crypto/stack/stack.c:326:10: Taking true branch
324. void *sk_value(const _STACK *st, int i)
325. {
326. if (!st || (i < 0) || (i >= st->num))
^
327. return NULL;
328. return st->data[i];
crypto/stack/stack.c:327:9:
325. {
326. if (!st || (i < 0) || (i >= st->num))
327. > return NULL;
328. return st->data[i];
329. }
crypto/stack/stack.c:329:1: return from a call to sk_value
327. return NULL;
328. return st->data[i];
329. > }
330.
331. void *sk_set(_STACK *st, int i, void *value)
include/openssl/x509.h:170:1: return from a call to sk_X509_value
168. typedef struct x509_cinf_st X509_CINF;
169.
170. > DEFINE_STACK_OF(X509)
171.
172. /* This is used for a table of trust checking functions */
crypto/x509/x509_vfy.c:413:15: Taking false branch
411. int ret;
412. x = sk_X509_value(ctx->chain, i);
413. if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL)
^
414. && (x->ex_flags & EXFLAG_CRITICAL)) {
415. ctx->error = X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION;
crypto/x509/x509_vfy.c:422:14: Taking false branch
420. goto end;
421. }
422. if (!allow_proxy_certs && (x->ex_flags & EXFLAG_PROXY)) {
^
423. ctx->error = X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED;
424. ctx->error_depth = i;
crypto/x509/x509_vfy.c:430:9:
428. goto end;
429. }
430. > ret = X509_check_ca(x);
431. switch (must_be_ca) {
432. case -1:
crypto/x509v3/v3_purp.c:576:1: start of procedure X509_check_ca()
574. }
575.
576. > int X509_check_ca(X509 *x)
577. {
578. if (!(x->ex_flags & EXFLAG_SET)) {
crypto/x509v3/v3_purp.c:578:11:
576. int X509_check_ca(X509 *x)
577. {
578. > if (!(x->ex_flags & EXFLAG_SET)) {
579. CRYPTO_w_lock(CRYPTO_LOCK_X509);
580. x509v3_cache_extensions(x);
|
https://github.com/openssl/openssl/blob/25be7a0feacdbd3326774f0da8aaeb966c1f57f8/crypto/x509/x509_vfy.c/#L430
|
d2a_code_trace_data_44770
|
static void copy_parameter_set(void **to, void **from, int count, int size)
{
int i;
for (i = 0; i < count; i++) {
if (to[i] && !from[i])
av_freep(&to[i]);
else if (from[i] && !to[i])
to[i] = av_malloc(size);
if (from[i])
memcpy(to[i], from[i], size);
}
}
libavcodec/h264.c:1524: error: Null Dereference
pointer `*to[i]` last assigned on line 1521 could be null and is dereferenced by call to `memcpy()` at line 1524, column 13.
libavcodec/h264.c:1513:1: start of procedure copy_parameter_set()
1511. }
1512.
1513. static void copy_parameter_set(void **to, void **from, int count, int size)
^
1514. {
1515. int i;
libavcodec/h264.c:1517:10:
1515. int i;
1516.
1517. for (i = 0; i < count; i++) {
^
1518. if (to[i] && !from[i])
1519. av_freep(&to[i]);
libavcodec/h264.c:1517:17: Loop condition is true. Entering loop body
1515. int i;
1516.
1517. for (i = 0; i < count; i++) {
^
1518. if (to[i] && !from[i])
1519. av_freep(&to[i]);
libavcodec/h264.c:1518:13: Taking false branch
1516.
1517. for (i = 0; i < count; i++) {
1518. if (to[i] && !from[i])
^
1519. av_freep(&to[i]);
1520. else if (from[i] && !to[i])
libavcodec/h264.c:1520:18: Taking true branch
1518. if (to[i] && !from[i])
1519. av_freep(&to[i]);
1520. else if (from[i] && !to[i])
^
1521. to[i] = av_malloc(size);
1522.
libavcodec/h264.c:1520:30: Taking true branch
1518. if (to[i] && !from[i])
1519. av_freep(&to[i]);
1520. else if (from[i] && !to[i])
^
1521. to[i] = av_malloc(size);
1522.
libavcodec/h264.c:1521:13:
1519. av_freep(&to[i]);
1520. else if (from[i] && !to[i])
1521. to[i] = av_malloc(size);
^
1522.
1523. if (from[i])
libavutil/mem.c:61:1: start of procedure av_malloc()
59. * linker will do it automatically. */
60.
61. void *av_malloc(size_t size)
^
62. {
63. void *ptr = NULL;
libavutil/mem.c:63:5:
61. void *av_malloc(size_t size)
62. {
63. void *ptr = NULL;
^
64. #if CONFIG_MEMALIGN_HACK
65. long diff;
libavutil/mem.c:69:9: Taking true branch
67.
68. /* let's disallow possible ambiguous cases */
69. if (size > (INT_MAX - 32) || !size)
^
70. return NULL;
71.
libavutil/mem.c:70:9:
68. /* let's disallow possible ambiguous cases */
69. if (size > (INT_MAX - 32) || !size)
70. return NULL;
^
71.
72. #if CONFIG_MEMALIGN_HACK
libavutil/mem.c:114:1: return from a call to av_malloc
112. #endif
113. return ptr;
114. }
^
115.
116. void *av_realloc(void *ptr, size_t size)
libavcodec/h264.c:1523:13: Taking true branch
1521. to[i] = av_malloc(size);
1522.
1523. if (from[i])
^
1524. memcpy(to[i], from[i], size);
1525. }
libavcodec/h264.c:1524:13:
1522.
1523. if (from[i])
1524. memcpy(to[i], from[i], size);
^
1525. }
1526. }
|
https://github.com/libav/libav/blob/2852740e23f91d6775714d7cc29b9a73e1111ce0/libavcodec/h264.c/#L1524
|
d2a_code_trace_data_44771
|
int BN_set_word(BIGNUM *a, BN_ULONG w)
{
bn_check_top(a);
if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
return (0);
a->neg = 0;
a->d[0] = w;
a->top = (w ? 1 : 0);
bn_check_top(a);
return (1);
}
test/bntest.c:1934: error: BUFFER_OVERRUN_L3
Offset: 0 Size: [0, 8388607] by call to `BN_bntest_rand`.
Showing all 14 steps of the trace
test/bntest.c:1928:5: Call
1926. c = BN_new();
1927. d = BN_new();
1928. BN_one(c);
^
1929.
1930. if (a_)
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:1934:9: Call
1932. else {
1933. a = BN_new();
1934. BN_bntest_rand(a, 200, 0, 0);
^
1935. a->neg = rand_neg();
1936. }
crypto/bn/bn_rand.c:106:1: Parameter `*rnd->d`
104. }
105.
106. > int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom)
107. {
108. return bnrand(2, rnd, bits, top, bottom);
crypto/bn/bn_rand.c:108:12: Call
106. int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom)
107. {
108. return bnrand(2, rnd, bits, top, bottom);
^
109. }
110.
crypto/bn/bn_rand.c:17:1: Parameter `*rnd->d`
15. #include <openssl/sha.h>
16.
17. > static int bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom)
18. {
19. unsigned char *buf = NULL;
crypto/bn/bn_rand.c:26:9: Call
24. if (top != BN_RAND_TOP_ANY || bottom != BN_RAND_BOTTOM_ANY)
25. goto toosmall;
26. BN_zero(rnd);
^
27. return 1;
28. }
crypto/bn/bn_lib.c:463:1: <Length trace>
461. }
462.
463. > int BN_set_word(BIGNUM *a, BN_ULONG w)
464. {
465. bn_check_top(a);
crypto/bn/bn_lib.c:463:1: Parameter `*a->d`
461. }
462.
463. > int BN_set_word(BIGNUM *a, BN_ULONG w)
464. {
465. bn_check_top(a);
crypto/bn/bn_lib.c:466:9: Call
464. {
465. bn_check_top(a);
466. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
^
467. return (0);
468. a->neg = 0;
crypto/bn/bn_lcl.h:676:1: Parameter `*a->d`
674. int bn_probable_prime_dh_coprime(BIGNUM *rnd, int bits, BN_CTX *ctx);
675.
676. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits)
677. {
678. if (bits > (INT_MAX - BN_BITS2 + 1))
crypto/bn/bn_lib.c:469:5: Array access: Offset: 0 Size: [0, 8388607] by call to `BN_bntest_rand`
467. return (0);
468. a->neg = 0;
469. a->d[0] = w;
^
470. a->top = (w ? 1 : 0);
471. bn_check_top(a);
|
https://github.com/openssl/openssl/blob/b3618f44a7b8504bfb0a64e8a33e6b8e56d4d516/crypto/bn/bn_lib.c/#L469
|
d2a_code_trace_data_44772
|
static int
_dopr(char **sbuffer,
char **buffer,
size_t *maxlen,
size_t *retlen, int *truncated, const char *format, va_list args)
{
char ch;
int64_t value;
LDOUBLE fvalue;
char *strvalue;
int min;
int max;
int state;
int flags;
int cflags;
size_t currlen;
state = DP_S_DEFAULT;
flags = currlen = cflags = min = 0;
max = -1;
ch = *format++;
while (state != DP_S_DONE) {
if (ch == '\0' || (buffer == NULL && currlen >= *maxlen))
state = DP_S_DONE;
switch (state) {
case DP_S_DEFAULT:
if (ch == '%')
state = DP_S_FLAGS;
else
if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, ch))
return 0;
ch = *format++;
break;
case DP_S_FLAGS:
switch (ch) {
case '-':
flags |= DP_F_MINUS;
ch = *format++;
break;
case '+':
flags |= DP_F_PLUS;
ch = *format++;
break;
case ' ':
flags |= DP_F_SPACE;
ch = *format++;
break;
case '#':
flags |= DP_F_NUM;
ch = *format++;
break;
case '0':
flags |= DP_F_ZERO;
ch = *format++;
break;
default:
state = DP_S_MIN;
break;
}
break;
case DP_S_MIN:
if (ossl_isdigit(ch)) {
min = 10 * min + char_to_int(ch);
ch = *format++;
} else if (ch == '*') {
min = va_arg(args, int);
ch = *format++;
state = DP_S_DOT;
} else
state = DP_S_DOT;
break;
case DP_S_DOT:
if (ch == '.') {
state = DP_S_MAX;
ch = *format++;
} else
state = DP_S_MOD;
break;
case DP_S_MAX:
if (ossl_isdigit(ch)) {
if (max < 0)
max = 0;
max = 10 * max + char_to_int(ch);
ch = *format++;
} else if (ch == '*') {
max = va_arg(args, int);
ch = *format++;
state = DP_S_MOD;
} else
state = DP_S_MOD;
break;
case DP_S_MOD:
switch (ch) {
case 'h':
cflags = DP_C_SHORT;
ch = *format++;
break;
case 'l':
if (*format == 'l') {
cflags = DP_C_LLONG;
format++;
} else
cflags = DP_C_LONG;
ch = *format++;
break;
case 'q':
case 'j':
cflags = DP_C_LLONG;
ch = *format++;
break;
case 'L':
cflags = DP_C_LDOUBLE;
ch = *format++;
break;
case 'z':
cflags = DP_C_SIZE;
ch = *format++;
break;
default:
break;
}
state = DP_S_CONV;
break;
case DP_S_CONV:
switch (ch) {
case 'd':
case 'i':
switch (cflags) {
case DP_C_SHORT:
value = (short int)va_arg(args, int);
break;
case DP_C_LONG:
value = va_arg(args, long int);
break;
case DP_C_LLONG:
value = va_arg(args, int64_t);
break;
case DP_C_SIZE:
value = va_arg(args, ossl_ssize_t);
break;
default:
value = va_arg(args, int);
break;
}
if (!fmtint(sbuffer, buffer, &currlen, maxlen, value, 10, min,
max, flags))
return 0;
break;
case 'X':
flags |= DP_F_UP;
case 'x':
case 'o':
case 'u':
flags |= DP_F_UNSIGNED;
switch (cflags) {
case DP_C_SHORT:
value = (unsigned short int)va_arg(args, unsigned int);
break;
case DP_C_LONG:
value = va_arg(args, unsigned long int);
break;
case DP_C_LLONG:
value = va_arg(args, uint64_t);
break;
case DP_C_SIZE:
value = va_arg(args, size_t);
break;
default:
value = va_arg(args, unsigned int);
break;
}
if (!fmtint(sbuffer, buffer, &currlen, maxlen, value,
ch == 'o' ? 8 : (ch == 'u' ? 10 : 16),
min, max, flags))
return 0;
break;
case 'f':
if (cflags == DP_C_LDOUBLE)
fvalue = va_arg(args, LDOUBLE);
else
fvalue = va_arg(args, double);
if (!fmtfp(sbuffer, buffer, &currlen, maxlen, fvalue, min, max,
flags, F_FORMAT))
return 0;
break;
case 'E':
flags |= DP_F_UP;
case 'e':
if (cflags == DP_C_LDOUBLE)
fvalue = va_arg(args, LDOUBLE);
else
fvalue = va_arg(args, double);
if (!fmtfp(sbuffer, buffer, &currlen, maxlen, fvalue, min, max,
flags, E_FORMAT))
return 0;
break;
case 'G':
flags |= DP_F_UP;
case 'g':
if (cflags == DP_C_LDOUBLE)
fvalue = va_arg(args, LDOUBLE);
else
fvalue = va_arg(args, double);
if (!fmtfp(sbuffer, buffer, &currlen, maxlen, fvalue, min, max,
flags, G_FORMAT))
return 0;
break;
case 'c':
if (!doapr_outch(sbuffer, buffer, &currlen, maxlen,
va_arg(args, int)))
return 0;
break;
case 's':
strvalue = va_arg(args, char *);
if (max < 0) {
if (buffer)
max = INT_MAX;
else
max = *maxlen;
}
if (!fmtstr(sbuffer, buffer, &currlen, maxlen, strvalue,
flags, min, max))
return 0;
break;
case 'p':
value = (size_t)va_arg(args, void *);
if (!fmtint(sbuffer, buffer, &currlen, maxlen,
value, 16, min, max, flags | DP_F_NUM))
return 0;
break;
case 'n':
{
int *num;
num = va_arg(args, int *);
*num = currlen;
}
break;
case '%':
if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, ch))
return 0;
break;
case 'w':
ch = *format++;
break;
default:
break;
}
ch = *format++;
state = DP_S_DEFAULT;
flags = cflags = min = 0;
max = -1;
break;
case DP_S_DONE:
break;
default:
break;
}
}
if (buffer == NULL) {
*truncated = (currlen > *maxlen - 1);
if (*truncated)
currlen = *maxlen - 1;
}
if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, '\0'))
return 0;
*retlen = currlen - 1;
return 1;
}
apps/lib/app_params.c:90: error: INTEGER_OVERFLOW_L2
([0, 2147483647] - 1):unsigned64 by call to `describe_param_type`.
Showing all 10 steps of the trace
apps/lib/app_params.c:90:13: Call
88. char buf[200]; /* This should be ample space */
89.
90. describe_param_type(buf, sizeof(buf), pdefs);
^
91. BIO_printf(bio_out, "%*s %s\n", indent, "", buf);
92. }
apps/lib/app_params.c:13:1: Parameter `bufsz`
11. #include "app_params.h"
12.
13. > static int describe_param_type(char *buf, size_t bufsz, const OSSL_PARAM *param)
14. {
15. const char *type_mod = "";
apps/lib/app_params.c:50:19: Call
48. bufsz -= printed_len;
49. }
50. printed_len = BIO_snprintf(buf, bufsz, "%s%s", type_mod, type);
^
51. if (printed_len > 0) {
52. buf += printed_len;
crypto/bio/b_print.c:899:1: Parameter `n`
897. * function should be renamed, but to what?)
898. */
899. > int BIO_snprintf(char *buf, size_t n, const char *format, ...)
900. {
901. va_list args;
crypto/bio/b_print.c:906:11: Call
904. va_start(args, format);
905.
906. ret = BIO_vsnprintf(buf, n, format, args);
^
907.
908. va_end(args);
crypto/bio/b_print.c:912:1: Parameter `n`
910. }
911.
912. > int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args)
913. {
914. size_t retlen;
crypto/bio/b_print.c:917:10: Call
915. int truncated;
916.
917. if (!_dopr(&buf, NULL, &n, &retlen, &truncated, format, args))
^
918. return -1;
919.
crypto/bio/b_print.c:83:1: <LHS trace>
81. #define OSSL_MAX(p,q) ((p >= q) ? p : q)
82.
83. > static int
84. _dopr(char **sbuffer,
85. char **buffer,
crypto/bio/b_print.c:83:1: Parameter `*maxlen`
81. #define OSSL_MAX(p,q) ((p >= q) ? p : q)
82.
83. > static int
84. _dopr(char **sbuffer,
85. char **buffer,
crypto/bio/b_print.c:353:23: Binary operation: ([0, 2147483647] - 1):unsigned64 by call to `describe_param_type`
351. */
352. if (buffer == NULL) {
353. *truncated = (currlen > *maxlen - 1);
^
354. if (*truncated)
355. currlen = *maxlen - 1;
|
https://github.com/openssl/openssl/blob/2d9007587c5072a513c84f22db7be55767b4c63d/crypto/bio/b_print.c/#L353
|
d2a_code_trace_data_44773
|
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/ssltestlib.c:597: error: INTEGER_OVERFLOW_L2
([0, +oo] - 1):unsigned64 by call to `SSL_free`.
Showing all 16 steps of the trace
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/ssltestlib.c:597:5: Call
595.
596. error:
597. SSL_free(serverssl);
^
598. SSL_free(clientssl);
599. BIO_free(s_to_c_bio);
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_44774
|
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/mpegvideo_enc.c:1315: error: Integer Overflow L2
([1, 2147483616] + 32):signed32 by call to `ff_alloc_picture`.
libavcodec/mpegvideo_enc.c:1315:17: Call
1313.
1314. pic->reference = s->reordered_input_picture[0]->reference;
1315. if (ff_alloc_picture(s, pic, 0) < 0) {
^
1316. return -1;
1317. }
libavcodec/mpegvideo.c:587:1: Parameter `pic->f.nb_samples`
585. * The pixels are allocated/set by calling get_buffer() if shared = 0
586. */
587. int ff_alloc_picture(MpegEncContext *s, Picture *pic, int shared)
^
588. {
589. int i, ret;
libavcodec/mpegvideo.c:597:13: Call
595. assert(!pic->f.buf[0]);
596.
597. if (alloc_frame_buffer(s, pic) < 0)
^
598. return -1;
599.
libavcodec/mpegvideo.c:424:1: Parameter `pic->f.nb_samples`
422. * Allocate a frame buffer
423. */
424. static int alloc_frame_buffer(MpegEncContext *s, Picture *pic)
^
425. {
426. int edges_needed = av_codec_is_encoder(s->avctx->codec);
libavcodec/mpegvideo.c:444:13: Call
442. pic->f.height = s->avctx->height;
443. pic->f.format = s->avctx->pix_fmt;
444. r = avcodec_default_get_buffer2(s->avctx, &pic->f, 0);
^
445. }
446.
libavcodec/utils.c:524:1: Parameter `frame->nb_samples`
522. }
523.
524. int avcodec_default_get_buffer2(AVCodecContext *avctx, AVFrame *frame, int flags)
^
525. {
526. int ret;
libavcodec/utils.c:528:16: Call
526. int ret;
527.
528. if ((ret = update_frame_pool(avctx, frame)) < 0)
^
529. return ret;
530.
libavcodec/utils.c:327:1: Parameter `frame->nb_samples`
325. }
326.
327. static int update_frame_pool(AVCodecContext *avctx, AVFrame *frame)
^
328. {
329. FramePool *pool = avctx->internal->pool;
libavcodec/utils.c:399:15: Call
397.
398. av_buffer_pool_uninit(&pool->pools[0]);
399. ret = av_samples_get_buffer_size(&pool->linesize[0], ch,
^
400. frame->nb_samples, frame->format, 0);
401. if (ret < 0)
libavutil/samplefmt.c:108:1: <LHS trace>
106. }
107.
108. int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
^
109. enum AVSampleFormat sample_fmt, int align)
110. {
libavutil/samplefmt.c:108:1: Parameter `nb_samples`
106. }
107.
108. int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
^
109. enum AVSampleFormat sample_fmt, int align)
110. {
libavutil/samplefmt.c:124:9: Binary operation: ([1, 2147483616] + 32):signed32 by call to `ff_alloc_picture`
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_44775
|
char *X509_NAME_oneline(const X509_NAME *a, char *buf, int len)
{
const X509_NAME_ENTRY *ne;
int i;
int n, lold, l, l1, l2, num, j, type;
const char *s;
char *p;
unsigned char *q;
BUF_MEM *b = NULL;
static const char hex[17] = "0123456789ABCDEF";
int gs_doit[4];
char tmp_buf[80];
#ifdef CHARSET_EBCDIC
unsigned char ebcdic_buf[1024];
#endif
if (buf == NULL) {
if ((b = BUF_MEM_new()) == NULL)
goto err;
if (!BUF_MEM_grow(b, 200))
goto err;
b->data[0] = '\0';
len = 200;
} else if (len == 0) {
return NULL;
}
if (a == NULL) {
if (b) {
buf = b->data;
OPENSSL_free(b);
}
strncpy(buf, "NO X509_NAME", len);
buf[len - 1] = '\0';
return buf;
}
len--;
l = 0;
for (i = 0; i < sk_X509_NAME_ENTRY_num(a->entries); i++) {
ne = sk_X509_NAME_ENTRY_value(a->entries, i);
n = OBJ_obj2nid(ne->object);
if ((n == NID_undef) || ((s = OBJ_nid2sn(n)) == NULL)) {
i2t_ASN1_OBJECT(tmp_buf, sizeof(tmp_buf), ne->object);
s = tmp_buf;
}
l1 = strlen(s);
type = ne->value->type;
num = ne->value->length;
if (num > NAME_ONELINE_MAX) {
X509err(X509_F_X509_NAME_ONELINE, X509_R_NAME_TOO_LONG);
goto end;
}
q = ne->value->data;
#ifdef CHARSET_EBCDIC
if (type == V_ASN1_GENERALSTRING ||
type == V_ASN1_VISIBLESTRING ||
type == V_ASN1_PRINTABLESTRING ||
type == V_ASN1_TELETEXSTRING ||
type == V_ASN1_IA5STRING) {
if (num > (int)sizeof(ebcdic_buf))
num = sizeof(ebcdic_buf);
ascii2ebcdic(ebcdic_buf, q, num);
q = ebcdic_buf;
}
#endif
if ((type == V_ASN1_GENERALSTRING) && ((num % 4) == 0)) {
gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 0;
for (j = 0; j < num; j++)
if (q[j] != 0)
gs_doit[j & 3] = 1;
if (gs_doit[0] | gs_doit[1] | gs_doit[2])
gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 1;
else {
gs_doit[0] = gs_doit[1] = gs_doit[2] = 0;
gs_doit[3] = 1;
}
} else
gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 1;
for (l2 = j = 0; j < num; j++) {
if (!gs_doit[j & 3])
continue;
l2++;
#ifndef CHARSET_EBCDIC
if ((q[j] < ' ') || (q[j] > '~'))
l2 += 3;
#else
if ((os_toascii[q[j]] < os_toascii[' ']) ||
(os_toascii[q[j]] > os_toascii['~']))
l2 += 3;
#endif
}
lold = l;
l += 1 + l1 + 1 + l2;
if (l > NAME_ONELINE_MAX) {
X509err(X509_F_X509_NAME_ONELINE, X509_R_NAME_TOO_LONG);
goto end;
}
if (b != NULL) {
if (!BUF_MEM_grow(b, l + 1))
goto err;
p = &(b->data[lold]);
} else if (l > len) {
break;
} else
p = &(buf[lold]);
*(p++) = '/';
memcpy(p, s, (unsigned int)l1);
p += l1;
*(p++) = '=';
#ifndef CHARSET_EBCDIC
q = ne->value->data;
#endif
for (j = 0; j < num; j++) {
if (!gs_doit[j & 3])
continue;
#ifndef CHARSET_EBCDIC
n = q[j];
if ((n < ' ') || (n > '~')) {
*(p++) = '\\';
*(p++) = 'x';
*(p++) = hex[(n >> 4) & 0x0f];
*(p++) = hex[n & 0x0f];
} else
*(p++) = n;
#else
n = os_toascii[q[j]];
if ((n < os_toascii[' ']) || (n > os_toascii['~'])) {
*(p++) = '\\';
*(p++) = 'x';
*(p++) = hex[(n >> 4) & 0x0f];
*(p++) = hex[n & 0x0f];
} else
*(p++) = q[j];
#endif
}
*p = '\0';
}
if (b != NULL) {
p = b->data;
OPENSSL_free(b);
} else
p = buf;
if (i == 0)
*p = '\0';
return (p);
err:
X509err(X509_F_X509_NAME_ONELINE, ERR_R_MALLOC_FAILURE);
end:
BUF_MEM_free(b);
return (NULL);
}
crypto/x509v3/v3_alt.c:97: error: BUFFER_OVERRUN_L2
Offset: [-oo, 1048576] Size: 256 by call to `X509_NAME_oneline`.
Showing all 8 steps of the trace
crypto/x509v3/v3_alt.c:64:1: Array declaration
62. }
63.
64. > STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method,
65. GENERAL_NAME *gen,
66. STACK_OF(CONF_VALUE) *ret)
crypto/x509v3/v3_alt.c:97:9: Call
95.
96. case GEN_DIRNAME:
97. X509_NAME_oneline(gen->d.dirn, oline, 256);
^
98. X509V3_add_value("DirName", oline, &ret);
99. break;
crypto/x509/x509_obj.c:62:5: <Offset trace>
60.
61. len--; /* space for '\0' */
62. l = 0;
^
63. for (i = 0; i < sk_X509_NAME_ENTRY_num(a->entries); i++) {
64. ne = sk_X509_NAME_ENTRY_value(a->entries, i);
crypto/x509/x509_obj.c:62:5: Assignment
60.
61. len--; /* space for '\0' */
62. l = 0;
^
63. for (i = 0; i < sk_X509_NAME_ENTRY_num(a->entries); i++) {
64. ne = sk_X509_NAME_ENTRY_value(a->entries, i);
crypto/x509/x509_obj.c:121:9: Assignment
119. }
120.
121. lold = l;
^
122. l += 1 + l1 + 1 + l2;
123. if (l > NAME_ONELINE_MAX) {
crypto/x509/x509_obj.c:25:1: <Length trace>
23. #define NAME_ONELINE_MAX (1024 * 1024)
24.
25. > char *X509_NAME_oneline(const X509_NAME *a, char *buf, int len)
26. {
27. const X509_NAME_ENTRY *ne;
crypto/x509/x509_obj.c:25:1: Parameter `*buf`
23. #define NAME_ONELINE_MAX (1024 * 1024)
24.
25. > char *X509_NAME_oneline(const X509_NAME *a, char *buf, int len)
26. {
27. const X509_NAME_ENTRY *ne;
crypto/x509/x509_obj.c:134:13: Array access: Offset: [-oo, 1048576] Size: 256 by call to `X509_NAME_oneline`
132. break;
133. } else
134. p = &(buf[lold]);
^
135. *(p++) = '/';
136. memcpy(p, s, (unsigned int)l1);
|
https://github.com/openssl/openssl/blob/cdb2a60347f988037d29adc7e4415e9c66c8a5a5/crypto/x509/x509_obj.c/#L134
|
d2a_code_trace_data_44776
|
void *lh_delete(LHASH *lh, 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;
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_pkt.c:959: error: INTEGER_OVERFLOW_L2
([0, `s->ctx->sessions->num_items`] - 1):unsigned64 by call to `SSL_CTX_remove_session`.
Showing all 9 steps of the trace
ssl/s3_pkt.c:707:1: Parameter `s->ctx->sessions->num_items`
705. * none of our business
706. */
707. > int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len)
708. {
709. int al,i,j,ret;
ssl/s3_pkt.c:959:4: Call
957. ERR_add_error_data(2,"SSL alert number ",tmp);
958. s->shutdown|=SSL_RECEIVED_SHUTDOWN;
959. SSL_CTX_remove_session(s->ctx,s->session);
^
960. return(0);
961. }
ssl/ssl_sess.c:413:1: Parameter `ctx->sessions->num_items`
411. }
412.
413. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
414. {
415. return remove_session_lock(ctx, c, 1);
ssl/ssl_sess.c:415:9: Call
413. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
414. {
415. return remove_session_lock(ctx, c, 1);
^
416. }
417.
ssl/ssl_sess.c:418:1: Parameter `ctx->sessions->num_items`
416. }
417.
418. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck)
419. {
420. SSL_SESSION *r;
ssl/ssl_sess.c:426:20: Call
424. {
425. if(lck) CRYPTO_w_lock(CRYPTO_LOCK_SSL_CTX);
426. r=(SSL_SESSION *)lh_delete(ctx->sessions,c);
^
427. if (r != NULL)
428. {
crypto/lhash/lhash.c:217:1: <LHS trace>
215. }
216.
217. > void *lh_delete(LHASH *lh, 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, 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 `SSL_CTX_remove_session`
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/1c890fa86415d7f739509701e213a2093fe53438/crypto/lhash/lhash.c/#L240
|
d2a_code_trace_data_44777
|
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:2409: error: INTEGER_OVERFLOW_L2
([0, +oo] - [`pkt->written`, `pkt->written` + 9]):unsigned64 by call to `WPACKET_sub_memcpy__`.
Showing all 16 steps of the trace
ssl/statem/statem_clnt.c:2316:1: Parameter `pkt->written`
2314. }
2315.
2316. > static int tls_construct_cke_gost(SSL *s, WPACKET *pkt, int *al)
2317. {
2318. #ifndef OPENSSL_NO_GOST
ssl/statem/statem_clnt.c:2407:10: Call
2405. }
2406.
2407. if (!WPACKET_put_bytes_u8(pkt, V_ASN1_SEQUENCE | V_ASN1_CONSTRUCTED)
^
2408. || (msglen >= 0x80 && !WPACKET_put_bytes_u8(pkt, 0x81))
2409. || !WPACKET_sub_memcpy_u8(pkt, tmp, msglen)) {
ssl/packet.c:261:1: Parameter `pkt->written`
259. }
260.
261. > int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size)
262. {
263. unsigned char *data;
ssl/statem/statem_clnt.c:2409:17: Call
2407. if (!WPACKET_put_bytes_u8(pkt, V_ASN1_SEQUENCE | V_ASN1_CONSTRUCTED)
2408. || (msglen >= 0x80 && !WPACKET_put_bytes_u8(pkt, 0x81))
2409. || !WPACKET_sub_memcpy_u8(pkt, tmp, msglen)) {
^
2410. *al = SSL_AD_INTERNAL_ERROR;
2411. SSLerr(SSL_F_TLS_CONSTRUCT_CKE_GOST, ERR_R_INTERNAL_ERROR);
ssl/packet.c:320:10: Call
318. size_t lenbytes)
319. {
320. if (!WPACKET_start_sub_packet_len__(pkt, lenbytes)
^
321. || !WPACKET_memcpy(pkt, src, len)
322. || !WPACKET_close(pkt))
ssl/packet.c:224:1: Parameter `pkt->buf->length`
222. }
223.
224. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes)
225. {
226. WPACKET_SUB *sub;
ssl/packet.c:321:17: Call
319. {
320. if (!WPACKET_start_sub_packet_len__(pkt, lenbytes)
321. || !WPACKET_memcpy(pkt, src, len)
^
322. || !WPACKET_close(pkt))
323. return 0;
ssl/packet.c:302:1: Parameter `pkt->written`
300. }
301.
302. > int WPACKET_memcpy(WPACKET *pkt, const void *src, size_t len)
303. {
304. unsigned char *dest;
ssl/packet.c:309:10: Call
307. return 1;
308.
309. if (!WPACKET_allocate_bytes(pkt, len, &dest))
^
310. return 0;
311.
ssl/packet.c:15:1: Parameter `pkt->written`
13. #define DEFAULT_BUF_SIZE 256
14.
15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
16. {
17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes))
ssl/packet.c:17:10: Call
15. int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
16. {
17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes))
^
18. return 0;
19.
ssl/packet.c:36:1: <LHS trace>
34. }
35.
36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
37. {
38. /* Internal API, so should not fail */
ssl/packet.c:36:1: Parameter `pkt->buf->length`
34. }
35.
36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
37. {
38. /* Internal API, so should not fail */
ssl/packet.c:36:1: <RHS trace>
34. }
35.
36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
37. {
38. /* Internal API, so should not fail */
ssl/packet.c:36:1: Parameter `len`
34. }
35.
36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
37. {
38. /* Internal API, so should not fail */
ssl/packet.c:46:9: Binary operation: ([0, +oo] - [pkt->written, pkt->written + 9]):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_44778
|
int test_mod_exp_mont_consttime(BIO *bp, BN_CTX *ctx)
{
BIGNUM *a, *b, *c, *d, *e;
int i;
a = BN_new();
b = BN_new();
c = BN_new();
d = BN_new();
e = BN_new();
BN_one(a);
BN_one(b);
BN_zero(c);
if (BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL)) {
fprintf(stderr, "BN_mod_exp_mont_consttime with zero modulus "
"succeeded\n");
return 0;
}
BN_set_word(c, 16);
if (BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL)) {
fprintf(stderr, "BN_mod_exp_mont_consttime with even modulus "
"succeeded\n");
return 0;
}
BN_bntest_rand(c, 30, 0, 1);
for (i = 0; i < num2; i++) {
BN_bntest_rand(a, 20 + i * 5, 0, 0);
BN_bntest_rand(b, 2 + i, 0, 0);
if (!BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL))
return (00);
if (bp != NULL) {
if (!results) {
BN_print(bp, a);
BIO_puts(bp, " ^ ");
BN_print(bp, b);
BIO_puts(bp, " % ");
BN_print(bp, c);
BIO_puts(bp, " - ");
}
BN_print(bp, d);
BIO_puts(bp, "\n");
}
BN_exp(e, a, b, ctx);
BN_sub(e, e, d);
BN_div(a, b, e, c, ctx);
if (!BN_is_zero(b)) {
fprintf(stderr, "Modulo exponentiation test failed!\n");
return 0;
}
}
BN_free(a);
BN_free(b);
BN_free(c);
BN_free(d);
BN_free(e);
return (1);
}
test/bntest.c:1067: error: MEMORY_LEAK
memory dynamically allocated by call to `BN_new()` at line 1058, column 9 is not reachable after line 1067, column 17.
Showing all 143 steps of the trace
test/bntest.c:1052:1: start of procedure test_mod_exp_mont_consttime()
1050. }
1051.
1052. > int test_mod_exp_mont_consttime(BIO *bp, BN_CTX *ctx)
1053. {
1054. BIGNUM *a, *b, *c, *d, *e;
test/bntest.c:1057:5:
1055. int i;
1056.
1057. > a = BN_new();
1058. b = BN_new();
1059. c = BN_new();
crypto/bn/bn_lib.c:277:1: start of procedure BN_new()
275. }
276.
277. > BIGNUM *BN_new(void)
278. {
279. BIGNUM *ret;
crypto/bn/bn_lib.c:281:9:
279. BIGNUM *ret;
280.
281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
155. }
156.
157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:159:5:
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. > void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:161:9: Taking true branch
159. void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
^
162. memset(ret, 0, num);
163. return ret;
crypto/mem.c:162:9:
160.
161. if (ret != NULL)
162. > memset(ret, 0, num);
163. return ret;
164. }
crypto/mem.c:163:5:
161. if (ret != NULL)
162. memset(ret, 0, num);
163. > return ret;
164. }
165.
crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
162. memset(ret, 0, num);
163. return ret;
164. > }
165.
166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/bn/bn_lib.c:281:9: Taking false branch
279. BIGNUM *ret;
280.
281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
^
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/bn/bn_lib.c:285:5:
283. return (NULL);
284. }
285. > ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. return (ret);
crypto/bn/bn_lib.c:287:5:
285. ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. > return (ret);
288. }
289.
crypto/bn/bn_lib.c:288:1: return from a call to BN_new
286. bn_check_top(ret);
287. return (ret);
288. > }
289.
290. BIGNUM *BN_secure_new(void)
test/bntest.c:1058:5:
1056.
1057. a = BN_new();
1058. > b = BN_new();
1059. c = BN_new();
1060. d = BN_new();
crypto/bn/bn_lib.c:277:1: start of procedure BN_new()
275. }
276.
277. > BIGNUM *BN_new(void)
278. {
279. BIGNUM *ret;
crypto/bn/bn_lib.c:281:9:
279. BIGNUM *ret;
280.
281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
155. }
156.
157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:159:5:
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. > void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:161:9: Taking true branch
159. void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
^
162. memset(ret, 0, num);
163. return ret;
crypto/mem.c:162:9:
160.
161. if (ret != NULL)
162. > memset(ret, 0, num);
163. return ret;
164. }
crypto/mem.c:163:5:
161. if (ret != NULL)
162. memset(ret, 0, num);
163. > return ret;
164. }
165.
crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
162. memset(ret, 0, num);
163. return ret;
164. > }
165.
166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/bn/bn_lib.c:281:9: Taking false branch
279. BIGNUM *ret;
280.
281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
^
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/bn/bn_lib.c:285:5:
283. return (NULL);
284. }
285. > ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. return (ret);
crypto/bn/bn_lib.c:287:5:
285. ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. > return (ret);
288. }
289.
crypto/bn/bn_lib.c:288:1: return from a call to BN_new
286. bn_check_top(ret);
287. return (ret);
288. > }
289.
290. BIGNUM *BN_secure_new(void)
test/bntest.c:1059:5:
1057. a = BN_new();
1058. b = BN_new();
1059. > c = BN_new();
1060. d = BN_new();
1061. e = BN_new();
crypto/bn/bn_lib.c:277:1: start of procedure BN_new()
275. }
276.
277. > BIGNUM *BN_new(void)
278. {
279. BIGNUM *ret;
crypto/bn/bn_lib.c:281:9:
279. BIGNUM *ret;
280.
281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
155. }
156.
157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:159:5:
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. > void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:161:9: Taking true branch
159. void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
^
162. memset(ret, 0, num);
163. return ret;
crypto/mem.c:162:9:
160.
161. if (ret != NULL)
162. > memset(ret, 0, num);
163. return ret;
164. }
crypto/mem.c:163:5:
161. if (ret != NULL)
162. memset(ret, 0, num);
163. > return ret;
164. }
165.
crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
162. memset(ret, 0, num);
163. return ret;
164. > }
165.
166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/bn/bn_lib.c:281:9: Taking false branch
279. BIGNUM *ret;
280.
281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
^
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/bn/bn_lib.c:285:5:
283. return (NULL);
284. }
285. > ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. return (ret);
crypto/bn/bn_lib.c:287:5:
285. ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. > return (ret);
288. }
289.
crypto/bn/bn_lib.c:288:1: return from a call to BN_new
286. bn_check_top(ret);
287. return (ret);
288. > }
289.
290. BIGNUM *BN_secure_new(void)
test/bntest.c:1060:5:
1058. b = BN_new();
1059. c = BN_new();
1060. > d = BN_new();
1061. e = BN_new();
1062.
crypto/bn/bn_lib.c:277:1: start of procedure BN_new()
275. }
276.
277. > BIGNUM *BN_new(void)
278. {
279. BIGNUM *ret;
crypto/bn/bn_lib.c:281:9:
279. BIGNUM *ret;
280.
281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
155. }
156.
157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:159:5:
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. > void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:161:9: Taking true branch
159. void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
^
162. memset(ret, 0, num);
163. return ret;
crypto/mem.c:162:9:
160.
161. if (ret != NULL)
162. > memset(ret, 0, num);
163. return ret;
164. }
crypto/mem.c:163:5:
161. if (ret != NULL)
162. memset(ret, 0, num);
163. > return ret;
164. }
165.
crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
162. memset(ret, 0, num);
163. return ret;
164. > }
165.
166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/bn/bn_lib.c:281:9: Taking false branch
279. BIGNUM *ret;
280.
281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
^
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/bn/bn_lib.c:285:5:
283. return (NULL);
284. }
285. > ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. return (ret);
crypto/bn/bn_lib.c:287:5:
285. ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. > return (ret);
288. }
289.
crypto/bn/bn_lib.c:288:1: return from a call to BN_new
286. bn_check_top(ret);
287. return (ret);
288. > }
289.
290. BIGNUM *BN_secure_new(void)
test/bntest.c:1061:5:
1059. c = BN_new();
1060. d = BN_new();
1061. > e = BN_new();
1062.
1063. BN_one(a);
crypto/bn/bn_lib.c:277:1: start of procedure BN_new()
275. }
276.
277. > BIGNUM *BN_new(void)
278. {
279. BIGNUM *ret;
crypto/bn/bn_lib.c:281:9:
279. BIGNUM *ret;
280.
281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
155. }
156.
157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:159:5:
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. > void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:161:9: Taking true branch
159. void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
^
162. memset(ret, 0, num);
163. return ret;
crypto/mem.c:162:9:
160.
161. if (ret != NULL)
162. > memset(ret, 0, num);
163. return ret;
164. }
crypto/mem.c:163:5:
161. if (ret != NULL)
162. memset(ret, 0, num);
163. > return ret;
164. }
165.
crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
162. memset(ret, 0, num);
163. return ret;
164. > }
165.
166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/bn/bn_lib.c:281:9: Taking false branch
279. BIGNUM *ret;
280.
281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
^
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/bn/bn_lib.c:285:5:
283. return (NULL);
284. }
285. > ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. return (ret);
crypto/bn/bn_lib.c:287:5:
285. ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. > return (ret);
288. }
289.
crypto/bn/bn_lib.c:288:1: return from a call to BN_new
286. bn_check_top(ret);
287. return (ret);
288. > }
289.
290. BIGNUM *BN_secure_new(void)
test/bntest.c:1063:5:
1061. e = BN_new();
1062.
1063. > BN_one(a);
1064. BN_one(b);
1065. BN_zero(c);
crypto/bn/bn_lib.c:530:1: start of procedure BN_set_word()
528. }
529.
530. > int BN_set_word(BIGNUM *a, BN_ULONG w)
531. {
532. bn_check_top(a);
crypto/bn/bn_lib.c:533:9: Condition is true
531. {
532. bn_check_top(a);
533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
^
534. return (0);
535. a->neg = 0;
crypto/bn/bn_lib.c:533:9: Taking false branch
531. {
532. bn_check_top(a);
533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
^
534. return (0);
535. a->neg = 0;
crypto/bn/bn_lib.c:535:5:
533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
534. return (0);
535. > a->neg = 0;
536. a->d[0] = w;
537. a->top = (w ? 1 : 0);
crypto/bn/bn_lib.c:536:5:
534. return (0);
535. a->neg = 0;
536. > a->d[0] = w;
537. a->top = (w ? 1 : 0);
538. bn_check_top(a);
crypto/bn/bn_lib.c:537:15: Condition is true
535. a->neg = 0;
536. a->d[0] = w;
537. a->top = (w ? 1 : 0);
^
538. bn_check_top(a);
539. return (1);
crypto/bn/bn_lib.c:537:5:
535. a->neg = 0;
536. a->d[0] = w;
537. > a->top = (w ? 1 : 0);
538. bn_check_top(a);
539. return (1);
crypto/bn/bn_lib.c:539:5:
537. a->top = (w ? 1 : 0);
538. bn_check_top(a);
539. > return (1);
540. }
541.
crypto/bn/bn_lib.c:540:1: return from a call to BN_set_word
538. bn_check_top(a);
539. return (1);
540. > }
541.
542. BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret)
test/bntest.c:1064:5:
1062.
1063. BN_one(a);
1064. > BN_one(b);
1065. BN_zero(c);
1066. if (BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL)) {
crypto/bn/bn_lib.c:530:1: start of procedure BN_set_word()
528. }
529.
530. > int BN_set_word(BIGNUM *a, BN_ULONG w)
531. {
532. bn_check_top(a);
crypto/bn/bn_lib.c:533:9: Condition is true
531. {
532. bn_check_top(a);
533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
^
534. return (0);
535. a->neg = 0;
crypto/bn/bn_lib.c:533:9: Taking false branch
531. {
532. bn_check_top(a);
533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
^
534. return (0);
535. a->neg = 0;
crypto/bn/bn_lib.c:535:5:
533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
534. return (0);
535. > a->neg = 0;
536. a->d[0] = w;
537. a->top = (w ? 1 : 0);
crypto/bn/bn_lib.c:536:5:
534. return (0);
535. a->neg = 0;
536. > a->d[0] = w;
537. a->top = (w ? 1 : 0);
538. bn_check_top(a);
crypto/bn/bn_lib.c:537:15: Condition is true
535. a->neg = 0;
536. a->d[0] = w;
537. a->top = (w ? 1 : 0);
^
538. bn_check_top(a);
539. return (1);
crypto/bn/bn_lib.c:537:5:
535. a->neg = 0;
536. a->d[0] = w;
537. > a->top = (w ? 1 : 0);
538. bn_check_top(a);
539. return (1);
crypto/bn/bn_lib.c:539:5:
537. a->top = (w ? 1 : 0);
538. bn_check_top(a);
539. > return (1);
540. }
541.
crypto/bn/bn_lib.c:540:1: return from a call to BN_set_word
538. bn_check_top(a);
539. return (1);
540. > }
541.
542. BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret)
test/bntest.c:1065:5:
1063. BN_one(a);
1064. BN_one(b);
1065. > BN_zero(c);
1066. if (BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL)) {
1067. fprintf(stderr, "BN_mod_exp_mont_consttime with zero modulus "
crypto/bn/bn_lib.c:530:1: start of procedure BN_set_word()
528. }
529.
530. > int BN_set_word(BIGNUM *a, BN_ULONG w)
531. {
532. bn_check_top(a);
crypto/bn/bn_lib.c:533:9: Condition is true
531. {
532. bn_check_top(a);
533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
^
534. return (0);
535. a->neg = 0;
crypto/bn/bn_lib.c:533:9: Taking false branch
531. {
532. bn_check_top(a);
533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
^
534. return (0);
535. a->neg = 0;
crypto/bn/bn_lib.c:535:5:
533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
534. return (0);
535. > a->neg = 0;
536. a->d[0] = w;
537. a->top = (w ? 1 : 0);
crypto/bn/bn_lib.c:536:5:
534. return (0);
535. a->neg = 0;
536. > a->d[0] = w;
537. a->top = (w ? 1 : 0);
538. bn_check_top(a);
crypto/bn/bn_lib.c:537:15: Condition is false
535. a->neg = 0;
536. a->d[0] = w;
537. a->top = (w ? 1 : 0);
^
538. bn_check_top(a);
539. return (1);
crypto/bn/bn_lib.c:537:5:
535. a->neg = 0;
536. a->d[0] = w;
537. > a->top = (w ? 1 : 0);
538. bn_check_top(a);
539. return (1);
crypto/bn/bn_lib.c:539:5:
537. a->top = (w ? 1 : 0);
538. bn_check_top(a);
539. > return (1);
540. }
541.
crypto/bn/bn_lib.c:540:1: return from a call to BN_set_word
538. bn_check_top(a);
539. return (1);
540. > }
541.
542. BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret)
test/bntest.c:1066:9: Taking true branch
1064. BN_one(b);
1065. BN_zero(c);
1066. if (BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL)) {
^
1067. fprintf(stderr, "BN_mod_exp_mont_consttime with zero modulus "
1068. "succeeded\n");
test/bntest.c:1067:9:
1065. BN_zero(c);
1066. if (BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL)) {
1067. > fprintf(stderr, "BN_mod_exp_mont_consttime with zero modulus "
1068. "succeeded\n");
1069. return 0;
|
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/test/bntest.c/#L1067
|
d2a_code_trace_data_44779
|
static void opt_input_ts_scale(const char *arg)
{
unsigned int stream;
double scale;
char *p;
stream = strtol(arg, &p, 0);
if (*p)
p++;
scale= strtod(p, &p);
if(stream >= MAX_STREAMS)
ffmpeg_exit(1);
input_files_ts_scale[nb_input_files] = grow_array(input_files_ts_scale[nb_input_files], sizeof(*input_files_ts_scale[nb_input_files]), &nb_input_files_ts_scale[nb_input_files], stream + 1);
input_files_ts_scale[nb_input_files][stream]= scale;
}
ffmpeg.c:3086: error: Null Dereference
pointer `input_files_ts_scale[nb_input_files]` last assigned on line 3085 could be null and is dereferenced at line 3086, column 5.
ffmpeg.c:3071:1: start of procedure opt_input_ts_scale()
3069. }
3070.
3071. static void opt_input_ts_scale(const char *arg)
^
3072. {
3073. unsigned int stream;
ffmpeg.c:3077:5:
3075. char *p;
3076.
3077. stream = strtol(arg, &p, 0);
^
3078. if (*p)
3079. p++;
ffmpeg.c:3078:9: Taking true branch
3076.
3077. stream = strtol(arg, &p, 0);
3078. if (*p)
^
3079. p++;
3080. scale= strtod(p, &p);
ffmpeg.c:3079:9:
3077. stream = strtol(arg, &p, 0);
3078. if (*p)
3079. p++;
^
3080. scale= strtod(p, &p);
3081.
ffmpeg.c:3080:5:
3078. if (*p)
3079. p++;
3080. scale= strtod(p, &p);
^
3081.
3082. if(stream >= MAX_STREAMS)
ffmpeg.c:3082:8: Taking true branch
3080. scale= strtod(p, &p);
3081.
3082. if(stream >= MAX_STREAMS)
^
3083. ffmpeg_exit(1);
3084.
ffmpeg.c:3083:9: Skipping ffmpeg_exit(): empty list of specs
3081.
3082. if(stream >= MAX_STREAMS)
3083. ffmpeg_exit(1);
^
3084.
3085. input_files_ts_scale[nb_input_files] = grow_array(input_files_ts_scale[nb_input_files], sizeof(*input_files_ts_scale[nb_input_files]), &nb_input_files_ts_scale[nb_input_files], stream + 1);
ffmpeg.c:3085:5:
3083. ffmpeg_exit(1);
3084.
3085. input_files_ts_scale[nb_input_files] = grow_array(input_files_ts_scale[nb_input_files], sizeof(*input_files_ts_scale[nb_input_files]), &nb_input_files_ts_scale[nb_input_files], stream + 1);
^
3086. input_files_ts_scale[nb_input_files][stream]= scale;
3087. }
ffmpeg.c:512:1: start of procedure grow_array()
510.
511. /* similar to ff_dynarray_add() and av_fast_realloc() */
512. static void *grow_array(void *array, int elem_size, int *size, int new_size)
^
513. {
514. if (new_size >= INT_MAX / elem_size) {
ffmpeg.c:514:9: Taking true branch
512. static void *grow_array(void *array, int elem_size, int *size, int new_size)
513. {
514. if (new_size >= INT_MAX / elem_size) {
^
515. fprintf(stderr, "Array too big.\n");
516. ffmpeg_exit(1);
ffmpeg.c:515:9:
513. {
514. if (new_size >= INT_MAX / elem_size) {
515. fprintf(stderr, "Array too big.\n");
^
516. ffmpeg_exit(1);
517. }
ffmpeg.c:516:9: Skipping ffmpeg_exit(): empty list of specs
514. if (new_size >= INT_MAX / elem_size) {
515. fprintf(stderr, "Array too big.\n");
516. ffmpeg_exit(1);
^
517. }
518. if (*size < new_size) {
ffmpeg.c:518:9: Taking true branch
516. ffmpeg_exit(1);
517. }
518. if (*size < new_size) {
^
519. uint8_t *tmp = av_realloc(array, new_size*elem_size);
520. if (!tmp) {
ffmpeg.c:519:9:
517. }
518. if (*size < new_size) {
519. uint8_t *tmp = av_realloc(array, new_size*elem_size);
^
520. if (!tmp) {
521. fprintf(stderr, "Could not alloc buffer.\n");
libavutil/mem.c:117:1: start of procedure av_realloc()
115. }
116.
117. void *av_realloc(void *ptr, size_t size)
^
118. {
119. #if CONFIG_MEMALIGN_HACK
libavutil/mem.c:124:8: Taking false branch
122.
123. /* let's disallow possible ambiguous cases */
124. if(size > (INT_MAX-16) )
^
125. return NULL;
126.
libavutil/mem.c:133:5:
131. return (char*)realloc((char*)ptr - diff, size + diff) + diff;
132. #else
133. return realloc(ptr, size);
^
134. #endif
135. }
libavutil/mem.c:135:1: return from a call to av_realloc
133. return realloc(ptr, size);
134. #endif
135. }
^
136.
137. void av_free(void *ptr)
ffmpeg.c:520:14: Taking true branch
518. if (*size < new_size) {
519. uint8_t *tmp = av_realloc(array, new_size*elem_size);
520. if (!tmp) {
^
521. fprintf(stderr, "Could not alloc buffer.\n");
522. ffmpeg_exit(1);
ffmpeg.c:521:13:
519. uint8_t *tmp = av_realloc(array, new_size*elem_size);
520. if (!tmp) {
521. fprintf(stderr, "Could not alloc buffer.\n");
^
522. ffmpeg_exit(1);
523. }
ffmpeg.c:522:13: Skipping ffmpeg_exit(): empty list of specs
520. if (!tmp) {
521. fprintf(stderr, "Could not alloc buffer.\n");
522. ffmpeg_exit(1);
^
523. }
524. memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
ffmpeg.c:524:9:
522. ffmpeg_exit(1);
523. }
524. memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
^
525. *size = new_size;
526. return tmp;
ffmpeg.c:525:9:
523. }
524. memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
525. *size = new_size;
^
526. return tmp;
527. }
ffmpeg.c:526:9:
524. memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
525. *size = new_size;
526. return tmp;
^
527. }
528. return array;
ffmpeg.c:529:1: return from a call to grow_array
527. }
528. return array;
529. }
^
530.
531. static void choose_sample_fmt(AVStream *st, AVCodec *codec)
ffmpeg.c:3086:5:
3084.
3085. input_files_ts_scale[nb_input_files] = grow_array(input_files_ts_scale[nb_input_files], sizeof(*input_files_ts_scale[nb_input_files]), &nb_input_files_ts_scale[nb_input_files], stream + 1);
3086. input_files_ts_scale[nb_input_files][stream]= scale;
^
3087. }
3088.
|
https://github.com/libav/libav/blob/6465c820da7b104150366a8cdd837c00cf364235/ffmpeg.c/#L3086
|
d2a_code_trace_data_44780
|
static int encode_thread(AVCodecContext *c, void *arg){
MpegEncContext *s= arg;
int mb_x, mb_y, pdif = 0;
int i, j;
MpegEncContext best_s, backup_s;
uint8_t bit_buf[2][MAX_MB_BYTES];
uint8_t bit_buf2[2][MAX_MB_BYTES];
uint8_t bit_buf_tex[2][MAX_MB_BYTES];
PutBitContext pb[2], pb2[2], tex_pb[2];
ff_check_alignment();
for(i=0; i<2; i++){
init_put_bits(&pb [i], bit_buf [i], MAX_MB_BYTES);
init_put_bits(&pb2 [i], bit_buf2 [i], MAX_MB_BYTES);
init_put_bits(&tex_pb[i], bit_buf_tex[i], MAX_MB_BYTES);
}
s->last_bits= put_bits_count(&s->pb);
s->mv_bits=0;
s->misc_bits=0;
s->i_tex_bits=0;
s->p_tex_bits=0;
s->i_count=0;
s->f_count=0;
s->b_count=0;
s->skip_count=0;
for(i=0; i<3; i++){
s->last_dc[i] = 128 << s->intra_dc_precision;
s->current_picture.error[i] = 0;
}
s->mb_skip_run = 0;
memset(s->last_mv, 0, sizeof(s->last_mv));
s->last_mv_dir = 0;
switch(s->codec_id){
case CODEC_ID_H263:
case CODEC_ID_H263P:
case CODEC_ID_FLV1:
if (ENABLE_H263_ENCODER || ENABLE_H263P_ENCODER || ENABLE_FLV_ENCODER)
s->gob_index = ff_h263_get_gob_height(s);
break;
case CODEC_ID_MPEG4:
if(ENABLE_MPEG4_ENCODER && s->partitioned_frame)
ff_mpeg4_init_partitions(s);
break;
}
s->resync_mb_x=0;
s->resync_mb_y=0;
s->first_slice_line = 1;
s->ptr_lastgob = s->pb.buf;
for(mb_y= s->start_mb_y; mb_y < s->end_mb_y; mb_y++) {
s->mb_x=0;
s->mb_y= mb_y;
ff_set_qscale(s, s->qscale);
ff_init_block_index(s);
for(mb_x=0; mb_x < s->mb_width; mb_x++) {
int xy= mb_y*s->mb_stride + mb_x;
int mb_type= s->mb_type[xy];
int dmin= INT_MAX;
int dir;
if(s->pb.buf_end - s->pb.buf - (put_bits_count(&s->pb)>>3) < MAX_MB_BYTES){
av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n");
return -1;
}
if(s->data_partitioning){
if( s->pb2 .buf_end - s->pb2 .buf - (put_bits_count(&s-> pb2)>>3) < MAX_MB_BYTES
|| s->tex_pb.buf_end - s->tex_pb.buf - (put_bits_count(&s->tex_pb )>>3) < MAX_MB_BYTES){
av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n");
return -1;
}
}
s->mb_x = mb_x;
s->mb_y = mb_y;
ff_update_block_index(s);
if(ENABLE_H261_ENCODER && s->codec_id == CODEC_ID_H261){
ff_h261_reorder_mb_index(s);
xy= s->mb_y*s->mb_stride + s->mb_x;
mb_type= s->mb_type[xy];
}
if(s->rtp_mode){
int current_packet_size, is_gob_start;
current_packet_size= ((put_bits_count(&s->pb)+7)>>3) - (s->ptr_lastgob - s->pb.buf);
is_gob_start= s->avctx->rtp_payload_size && current_packet_size >= s->avctx->rtp_payload_size && mb_y + mb_x>0;
if(s->start_mb_y == mb_y && mb_y > 0 && mb_x==0) is_gob_start=1;
switch(s->codec_id){
case CODEC_ID_H263:
case CODEC_ID_H263P:
if(!s->h263_slice_structured)
if(s->mb_x || s->mb_y%s->gob_index) is_gob_start=0;
break;
case CODEC_ID_MPEG2VIDEO:
if(s->mb_x==0 && s->mb_y!=0) is_gob_start=1;
case CODEC_ID_MPEG1VIDEO:
if(s->mb_skip_run) is_gob_start=0;
break;
}
if(is_gob_start){
if(s->start_mb_y != mb_y || mb_x!=0){
write_slice_end(s);
if(ENABLE_MPEG4_ENCODER && s->codec_id==CODEC_ID_MPEG4 && s->partitioned_frame){
ff_mpeg4_init_partitions(s);
}
}
assert((put_bits_count(&s->pb)&7) == 0);
current_packet_size= pbBufPtr(&s->pb) - s->ptr_lastgob;
if(s->avctx->error_rate && s->resync_mb_x + s->resync_mb_y > 0){
int r= put_bits_count(&s->pb)/8 + s->picture_number + 16 + s->mb_x + s->mb_y;
int d= 100 / s->avctx->error_rate;
if(r % d == 0){
current_packet_size=0;
#ifndef ALT_BITSTREAM_WRITER
s->pb.buf_ptr= s->ptr_lastgob;
#endif
assert(pbBufPtr(&s->pb) == s->ptr_lastgob);
}
}
if (s->avctx->rtp_callback){
int number_mb = (mb_y - s->resync_mb_y)*s->mb_width + mb_x - s->resync_mb_x;
s->avctx->rtp_callback(s->avctx, s->ptr_lastgob, current_packet_size, number_mb);
}
switch(s->codec_id){
case CODEC_ID_MPEG4:
if (ENABLE_MPEG4_ENCODER) {
ff_mpeg4_encode_video_packet_header(s);
ff_mpeg4_clean_buffers(s);
}
break;
case CODEC_ID_MPEG1VIDEO:
case CODEC_ID_MPEG2VIDEO:
if (ENABLE_MPEG1VIDEO_ENCODER || ENABLE_MPEG2VIDEO_ENCODER) {
ff_mpeg1_encode_slice_header(s);
ff_mpeg1_clean_buffers(s);
}
break;
case CODEC_ID_H263:
case CODEC_ID_H263P:
if (ENABLE_H263_ENCODER || ENABLE_H263P_ENCODER)
h263_encode_gob_header(s, mb_y);
break;
}
if(s->flags&CODEC_FLAG_PASS1){
int bits= put_bits_count(&s->pb);
s->misc_bits+= bits - s->last_bits;
s->last_bits= bits;
}
s->ptr_lastgob += current_packet_size;
s->first_slice_line=1;
s->resync_mb_x=mb_x;
s->resync_mb_y=mb_y;
}
}
if( (s->resync_mb_x == s->mb_x)
&& s->resync_mb_y+1 == s->mb_y){
s->first_slice_line=0;
}
s->mb_skipped=0;
s->dquant=0;
if(mb_type & (mb_type-1) || (s->flags & CODEC_FLAG_QP_RD)){
int next_block=0;
int pb_bits_count, pb2_bits_count, tex_pb_bits_count;
copy_context_before_encode(&backup_s, s, -1);
backup_s.pb= s->pb;
best_s.data_partitioning= s->data_partitioning;
best_s.partitioned_frame= s->partitioned_frame;
if(s->data_partitioning){
backup_s.pb2= s->pb2;
backup_s.tex_pb= s->tex_pb;
}
if(mb_type&CANDIDATE_MB_TYPE_INTER){
s->mv_dir = MV_DIR_FORWARD;
s->mv_type = MV_TYPE_16X16;
s->mb_intra= 0;
s->mv[0][0][0] = s->p_mv_table[xy][0];
s->mv[0][0][1] = s->p_mv_table[xy][1];
encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_INTER, pb, pb2, tex_pb,
&dmin, &next_block, s->mv[0][0][0], s->mv[0][0][1]);
}
if(mb_type&CANDIDATE_MB_TYPE_INTER_I){
s->mv_dir = MV_DIR_FORWARD;
s->mv_type = MV_TYPE_FIELD;
s->mb_intra= 0;
for(i=0; i<2; i++){
j= s->field_select[0][i] = s->p_field_select_table[i][xy];
s->mv[0][i][0] = s->p_field_mv_table[i][j][xy][0];
s->mv[0][i][1] = s->p_field_mv_table[i][j][xy][1];
}
encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_INTER_I, pb, pb2, tex_pb,
&dmin, &next_block, 0, 0);
}
if(mb_type&CANDIDATE_MB_TYPE_SKIPPED){
s->mv_dir = MV_DIR_FORWARD;
s->mv_type = MV_TYPE_16X16;
s->mb_intra= 0;
s->mv[0][0][0] = 0;
s->mv[0][0][1] = 0;
encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_SKIPPED, pb, pb2, tex_pb,
&dmin, &next_block, s->mv[0][0][0], s->mv[0][0][1]);
}
if(mb_type&CANDIDATE_MB_TYPE_INTER4V){
s->mv_dir = MV_DIR_FORWARD;
s->mv_type = MV_TYPE_8X8;
s->mb_intra= 0;
for(i=0; i<4; i++){
s->mv[0][i][0] = s->current_picture.motion_val[0][s->block_index[i]][0];
s->mv[0][i][1] = s->current_picture.motion_val[0][s->block_index[i]][1];
}
encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_INTER4V, pb, pb2, tex_pb,
&dmin, &next_block, 0, 0);
}
if(mb_type&CANDIDATE_MB_TYPE_FORWARD){
s->mv_dir = MV_DIR_FORWARD;
s->mv_type = MV_TYPE_16X16;
s->mb_intra= 0;
s->mv[0][0][0] = s->b_forw_mv_table[xy][0];
s->mv[0][0][1] = s->b_forw_mv_table[xy][1];
encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_FORWARD, pb, pb2, tex_pb,
&dmin, &next_block, s->mv[0][0][0], s->mv[0][0][1]);
}
if(mb_type&CANDIDATE_MB_TYPE_BACKWARD){
s->mv_dir = MV_DIR_BACKWARD;
s->mv_type = MV_TYPE_16X16;
s->mb_intra= 0;
s->mv[1][0][0] = s->b_back_mv_table[xy][0];
s->mv[1][0][1] = s->b_back_mv_table[xy][1];
encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_BACKWARD, pb, pb2, tex_pb,
&dmin, &next_block, s->mv[1][0][0], s->mv[1][0][1]);
}
if(mb_type&CANDIDATE_MB_TYPE_BIDIR){
s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD;
s->mv_type = MV_TYPE_16X16;
s->mb_intra= 0;
s->mv[0][0][0] = s->b_bidir_forw_mv_table[xy][0];
s->mv[0][0][1] = s->b_bidir_forw_mv_table[xy][1];
s->mv[1][0][0] = s->b_bidir_back_mv_table[xy][0];
s->mv[1][0][1] = s->b_bidir_back_mv_table[xy][1];
encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_BIDIR, pb, pb2, tex_pb,
&dmin, &next_block, 0, 0);
}
if(mb_type&CANDIDATE_MB_TYPE_FORWARD_I){
s->mv_dir = MV_DIR_FORWARD;
s->mv_type = MV_TYPE_FIELD;
s->mb_intra= 0;
for(i=0; i<2; i++){
j= s->field_select[0][i] = s->b_field_select_table[0][i][xy];
s->mv[0][i][0] = s->b_field_mv_table[0][i][j][xy][0];
s->mv[0][i][1] = s->b_field_mv_table[0][i][j][xy][1];
}
encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_FORWARD_I, pb, pb2, tex_pb,
&dmin, &next_block, 0, 0);
}
if(mb_type&CANDIDATE_MB_TYPE_BACKWARD_I){
s->mv_dir = MV_DIR_BACKWARD;
s->mv_type = MV_TYPE_FIELD;
s->mb_intra= 0;
for(i=0; i<2; i++){
j= s->field_select[1][i] = s->b_field_select_table[1][i][xy];
s->mv[1][i][0] = s->b_field_mv_table[1][i][j][xy][0];
s->mv[1][i][1] = s->b_field_mv_table[1][i][j][xy][1];
}
encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_BACKWARD_I, pb, pb2, tex_pb,
&dmin, &next_block, 0, 0);
}
if(mb_type&CANDIDATE_MB_TYPE_BIDIR_I){
s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD;
s->mv_type = MV_TYPE_FIELD;
s->mb_intra= 0;
for(dir=0; dir<2; dir++){
for(i=0; i<2; i++){
j= s->field_select[dir][i] = s->b_field_select_table[dir][i][xy];
s->mv[dir][i][0] = s->b_field_mv_table[dir][i][j][xy][0];
s->mv[dir][i][1] = s->b_field_mv_table[dir][i][j][xy][1];
}
}
encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_BIDIR_I, pb, pb2, tex_pb,
&dmin, &next_block, 0, 0);
}
if(mb_type&CANDIDATE_MB_TYPE_INTRA){
s->mv_dir = 0;
s->mv_type = MV_TYPE_16X16;
s->mb_intra= 1;
s->mv[0][0][0] = 0;
s->mv[0][0][1] = 0;
encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_INTRA, pb, pb2, tex_pb,
&dmin, &next_block, 0, 0);
if(s->h263_pred || s->h263_aic){
if(best_s.mb_intra)
s->mbintra_table[mb_x + mb_y*s->mb_stride]=1;
else
ff_clean_intra_table_entries(s);
}
}
if((s->flags & CODEC_FLAG_QP_RD) && dmin < INT_MAX){
if(best_s.mv_type==MV_TYPE_16X16){
const int last_qp= backup_s.qscale;
int qpi, qp, dc[6];
DCTELEM ac[6][16];
const int mvdir= (best_s.mv_dir&MV_DIR_BACKWARD) ? 1 : 0;
static const int dquant_tab[4]={-1,1,-2,2};
assert(backup_s.dquant == 0);
s->mv_dir= best_s.mv_dir;
s->mv_type = MV_TYPE_16X16;
s->mb_intra= best_s.mb_intra;
s->mv[0][0][0] = best_s.mv[0][0][0];
s->mv[0][0][1] = best_s.mv[0][0][1];
s->mv[1][0][0] = best_s.mv[1][0][0];
s->mv[1][0][1] = best_s.mv[1][0][1];
qpi = s->pict_type == FF_B_TYPE ? 2 : 0;
for(; qpi<4; qpi++){
int dquant= dquant_tab[qpi];
qp= last_qp + dquant;
if(qp < s->avctx->qmin || qp > s->avctx->qmax)
continue;
backup_s.dquant= dquant;
if(s->mb_intra && s->dc_val[0]){
for(i=0; i<6; i++){
dc[i]= s->dc_val[0][ s->block_index[i] ];
memcpy(ac[i], s->ac_val[0][s->block_index[i]], sizeof(DCTELEM)*16);
}
}
encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_INTER , pb, pb2, tex_pb,
&dmin, &next_block, s->mv[mvdir][0][0], s->mv[mvdir][0][1]);
if(best_s.qscale != qp){
if(s->mb_intra && s->dc_val[0]){
for(i=0; i<6; i++){
s->dc_val[0][ s->block_index[i] ]= dc[i];
memcpy(s->ac_val[0][s->block_index[i]], ac[i], sizeof(DCTELEM)*16);
}
}
}
}
}
}
if(ENABLE_MPEG4_ENCODER && mb_type&CANDIDATE_MB_TYPE_DIRECT){
int mx= s->b_direct_mv_table[xy][0];
int my= s->b_direct_mv_table[xy][1];
backup_s.dquant = 0;
s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD | MV_DIRECT;
s->mb_intra= 0;
ff_mpeg4_set_direct_mv(s, mx, my);
encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_DIRECT, pb, pb2, tex_pb,
&dmin, &next_block, mx, my);
}
if(ENABLE_MPEG4_ENCODER && mb_type&CANDIDATE_MB_TYPE_DIRECT0){
backup_s.dquant = 0;
s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD | MV_DIRECT;
s->mb_intra= 0;
ff_mpeg4_set_direct_mv(s, 0, 0);
encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_DIRECT, pb, pb2, tex_pb,
&dmin, &next_block, 0, 0);
}
if(!best_s.mb_intra && s->flags2&CODEC_FLAG2_SKIP_RD){
int coded=0;
for(i=0; i<6; i++)
coded |= s->block_last_index[i];
if(coded){
int mx,my;
memcpy(s->mv, best_s.mv, sizeof(s->mv));
if(ENABLE_MPEG4_ENCODER && best_s.mv_dir & MV_DIRECT){
mx=my=0;
ff_mpeg4_set_direct_mv(s, mx, my);
}else if(best_s.mv_dir&MV_DIR_BACKWARD){
mx= s->mv[1][0][0];
my= s->mv[1][0][1];
}else{
mx= s->mv[0][0][0];
my= s->mv[0][0][1];
}
s->mv_dir= best_s.mv_dir;
s->mv_type = best_s.mv_type;
s->mb_intra= 0;
backup_s.dquant= 0;
s->skipdct=1;
encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_INTER , pb, pb2, tex_pb,
&dmin, &next_block, mx, my);
s->skipdct=0;
}
}
s->current_picture.qscale_table[xy]= best_s.qscale;
copy_context_after_encode(s, &best_s, -1);
pb_bits_count= put_bits_count(&s->pb);
flush_put_bits(&s->pb);
ff_copy_bits(&backup_s.pb, bit_buf[next_block^1], pb_bits_count);
s->pb= backup_s.pb;
if(s->data_partitioning){
pb2_bits_count= put_bits_count(&s->pb2);
flush_put_bits(&s->pb2);
ff_copy_bits(&backup_s.pb2, bit_buf2[next_block^1], pb2_bits_count);
s->pb2= backup_s.pb2;
tex_pb_bits_count= put_bits_count(&s->tex_pb);
flush_put_bits(&s->tex_pb);
ff_copy_bits(&backup_s.tex_pb, bit_buf_tex[next_block^1], tex_pb_bits_count);
s->tex_pb= backup_s.tex_pb;
}
s->last_bits= put_bits_count(&s->pb);
if (ENABLE_ANY_H263_ENCODER &&
s->out_format == FMT_H263 && s->pict_type!=FF_B_TYPE)
ff_h263_update_motion_val(s);
if(next_block==0){
s->dsp.put_pixels_tab[0][0](s->dest[0], s->rd_scratchpad , s->linesize ,16);
s->dsp.put_pixels_tab[1][0](s->dest[1], s->rd_scratchpad + 16*s->linesize , s->uvlinesize, 8);
s->dsp.put_pixels_tab[1][0](s->dest[2], s->rd_scratchpad + 16*s->linesize + 8, s->uvlinesize, 8);
}
if(s->avctx->mb_decision == FF_MB_DECISION_BITS)
MPV_decode_mb(s, s->block);
} else {
int motion_x = 0, motion_y = 0;
s->mv_type=MV_TYPE_16X16;
switch(mb_type){
case CANDIDATE_MB_TYPE_INTRA:
s->mv_dir = 0;
s->mb_intra= 1;
motion_x= s->mv[0][0][0] = 0;
motion_y= s->mv[0][0][1] = 0;
break;
case CANDIDATE_MB_TYPE_INTER:
s->mv_dir = MV_DIR_FORWARD;
s->mb_intra= 0;
motion_x= s->mv[0][0][0] = s->p_mv_table[xy][0];
motion_y= s->mv[0][0][1] = s->p_mv_table[xy][1];
break;
case CANDIDATE_MB_TYPE_INTER_I:
s->mv_dir = MV_DIR_FORWARD;
s->mv_type = MV_TYPE_FIELD;
s->mb_intra= 0;
for(i=0; i<2; i++){
j= s->field_select[0][i] = s->p_field_select_table[i][xy];
s->mv[0][i][0] = s->p_field_mv_table[i][j][xy][0];
s->mv[0][i][1] = s->p_field_mv_table[i][j][xy][1];
}
break;
case CANDIDATE_MB_TYPE_INTER4V:
s->mv_dir = MV_DIR_FORWARD;
s->mv_type = MV_TYPE_8X8;
s->mb_intra= 0;
for(i=0; i<4; i++){
s->mv[0][i][0] = s->current_picture.motion_val[0][s->block_index[i]][0];
s->mv[0][i][1] = s->current_picture.motion_val[0][s->block_index[i]][1];
}
break;
case CANDIDATE_MB_TYPE_DIRECT:
if (ENABLE_MPEG4_ENCODER) {
s->mv_dir = MV_DIR_FORWARD|MV_DIR_BACKWARD|MV_DIRECT;
s->mb_intra= 0;
motion_x=s->b_direct_mv_table[xy][0];
motion_y=s->b_direct_mv_table[xy][1];
ff_mpeg4_set_direct_mv(s, motion_x, motion_y);
}
break;
case CANDIDATE_MB_TYPE_DIRECT0:
if (ENABLE_MPEG4_ENCODER) {
s->mv_dir = MV_DIR_FORWARD|MV_DIR_BACKWARD|MV_DIRECT;
s->mb_intra= 0;
ff_mpeg4_set_direct_mv(s, 0, 0);
}
break;
case CANDIDATE_MB_TYPE_BIDIR:
s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD;
s->mb_intra= 0;
s->mv[0][0][0] = s->b_bidir_forw_mv_table[xy][0];
s->mv[0][0][1] = s->b_bidir_forw_mv_table[xy][1];
s->mv[1][0][0] = s->b_bidir_back_mv_table[xy][0];
s->mv[1][0][1] = s->b_bidir_back_mv_table[xy][1];
break;
case CANDIDATE_MB_TYPE_BACKWARD:
s->mv_dir = MV_DIR_BACKWARD;
s->mb_intra= 0;
motion_x= s->mv[1][0][0] = s->b_back_mv_table[xy][0];
motion_y= s->mv[1][0][1] = s->b_back_mv_table[xy][1];
break;
case CANDIDATE_MB_TYPE_FORWARD:
s->mv_dir = MV_DIR_FORWARD;
s->mb_intra= 0;
motion_x= s->mv[0][0][0] = s->b_forw_mv_table[xy][0];
motion_y= s->mv[0][0][1] = s->b_forw_mv_table[xy][1];
break;
case CANDIDATE_MB_TYPE_FORWARD_I:
s->mv_dir = MV_DIR_FORWARD;
s->mv_type = MV_TYPE_FIELD;
s->mb_intra= 0;
for(i=0; i<2; i++){
j= s->field_select[0][i] = s->b_field_select_table[0][i][xy];
s->mv[0][i][0] = s->b_field_mv_table[0][i][j][xy][0];
s->mv[0][i][1] = s->b_field_mv_table[0][i][j][xy][1];
}
break;
case CANDIDATE_MB_TYPE_BACKWARD_I:
s->mv_dir = MV_DIR_BACKWARD;
s->mv_type = MV_TYPE_FIELD;
s->mb_intra= 0;
for(i=0; i<2; i++){
j= s->field_select[1][i] = s->b_field_select_table[1][i][xy];
s->mv[1][i][0] = s->b_field_mv_table[1][i][j][xy][0];
s->mv[1][i][1] = s->b_field_mv_table[1][i][j][xy][1];
}
break;
case CANDIDATE_MB_TYPE_BIDIR_I:
s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD;
s->mv_type = MV_TYPE_FIELD;
s->mb_intra= 0;
for(dir=0; dir<2; dir++){
for(i=0; i<2; i++){
j= s->field_select[dir][i] = s->b_field_select_table[dir][i][xy];
s->mv[dir][i][0] = s->b_field_mv_table[dir][i][j][xy][0];
s->mv[dir][i][1] = s->b_field_mv_table[dir][i][j][xy][1];
}
}
break;
default:
av_log(s->avctx, AV_LOG_ERROR, "illegal MB type\n");
}
encode_mb(s, motion_x, motion_y);
s->last_mv_dir = s->mv_dir;
if (ENABLE_ANY_H263_ENCODER &&
s->out_format == FMT_H263 && s->pict_type!=FF_B_TYPE)
ff_h263_update_motion_val(s);
MPV_decode_mb(s, s->block);
}
if(s->mb_intra ){
s->p_mv_table[xy][0]=0;
s->p_mv_table[xy][1]=0;
}
if(s->flags&CODEC_FLAG_PSNR){
int w= 16;
int h= 16;
if(s->mb_x*16 + 16 > s->width ) w= s->width - s->mb_x*16;
if(s->mb_y*16 + 16 > s->height) h= s->height- s->mb_y*16;
s->current_picture.error[0] += sse(
s, s->new_picture.data[0] + s->mb_x*16 + s->mb_y*s->linesize*16,
s->dest[0], w, h, s->linesize);
s->current_picture.error[1] += sse(
s, s->new_picture.data[1] + s->mb_x*8 + s->mb_y*s->uvlinesize*8,
s->dest[1], w>>1, h>>1, s->uvlinesize);
s->current_picture.error[2] += sse(
s, s->new_picture .data[2] + s->mb_x*8 + s->mb_y*s->uvlinesize*8,
s->dest[2], w>>1, h>>1, s->uvlinesize);
}
if(s->loop_filter){
if(ENABLE_ANY_H263_ENCODER && s->out_format == FMT_H263)
ff_h263_loop_filter(s);
}
}
}
if (ENABLE_MSMPEG4_ENCODER && s->msmpeg4_version && s->msmpeg4_version<4 && s->pict_type == FF_I_TYPE)
msmpeg4_encode_ext_header(s);
write_slice_end(s);
if (s->avctx->rtp_callback) {
int number_mb = (mb_y - s->resync_mb_y)*s->mb_width - s->resync_mb_x;
pdif = pbBufPtr(&s->pb) - s->ptr_lastgob;
emms_c();
s->avctx->rtp_callback(s->avctx, s->ptr_lastgob, pdif, number_mb);
}
return 0;
}
libavcodec/mpegvideo_enc.c:2338: error: Uninitialized Value
The value read from best_s.mv_dir was never initialized.
libavcodec/mpegvideo_enc.c:2338:43:
2336. int qpi, qp, dc[6];
2337. DCTELEM ac[6][16];
2338. const int mvdir= (best_s.mv_dir&MV_DIR_BACKWARD) ? 1 : 0;
^
2339. static const int dquant_tab[4]={-1,1,-2,2};
2340.
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/mpegvideo_enc.c/#L2338
|
d2a_code_trace_data_44781
|
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 = ff_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:1959: error: Null Dereference
pointer `content` last assigned on line 1953 could be null and is dereferenced at line 1959, column 5.
libavformat/rtsp.c:1937:1: start of procedure sdp_read_header()
1935. }
1936.
1937. static int sdp_read_header(AVFormatContext *s)
^
1938. {
1939. RTSPState *rt = s->priv_data;
libavformat/rtsp.c:1939:5:
1937. static int sdp_read_header(AVFormatContext *s)
1938. {
1939. RTSPState *rt = s->priv_data;
^
1940. RTSPStream *rtsp_st;
1941. int size, i, err;
libavformat/rtsp.c:1945:10:
1943. char url[1024];
1944.
1945. if (!ff_network_init())
^
1946. return AVERROR(EIO);
1947.
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:1945:10: Taking false branch
1943. char url[1024];
1944.
1945. if (!ff_network_init())
^
1946. return AVERROR(EIO);
1947.
libavformat/rtsp.c:1948:9: Taking false branch
1946. return AVERROR(EIO);
1947.
1948. if (s->max_delay < 0) /* Not set by the caller */
^
1949. s->max_delay = DEFAULT_REORDERING_DELAY;
1950.
libavformat/rtsp.c:1953:5:
1951. /* read the whole sdp file */
1952. /* XXX: better loading */
1953. content = av_malloc(SDP_MAX_SIZE);
^
1954. size = avio_read(s->pb, content, SDP_MAX_SIZE - 1);
1955. 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:9: Taking false branch
70.
71. /* let's disallow possible ambiguous cases */
72. if (size > (INT_MAX-32) || !size)
^
73. return NULL;
74.
libavutil/mem.c:72:33: Taking false branch
70.
71. /* let's disallow possible ambiguous cases */
72. if (size > (INT_MAX-32) || !size)
^
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_ALIGNED_MALLOC
libavutil/mem.c:84:9:
82. #elif HAVE_POSIX_MEMALIGN
83. if (posix_memalign(&ptr,32,size))
84. ptr = NULL;
^
85. #elif HAVE_ALIGNED_MALLOC
86. ptr = _aligned_malloc(size, 32);
libavutil/mem.c:116:5:
114. ptr = malloc(size);
115. #endif
116. return ptr;
^
117. }
118.
libavutil/mem.c:117:1: return from a call to av_malloc
115. #endif
116. return ptr;
117. }
^
118.
119. void *av_realloc(void *ptr, size_t size)
libavformat/rtsp.c:1954:5: Skipping avio_read(): empty list of specs
1952. /* XXX: better loading */
1953. content = av_malloc(SDP_MAX_SIZE);
1954. size = avio_read(s->pb, content, SDP_MAX_SIZE - 1);
^
1955. if (size <= 0) {
1956. av_free(content);
libavformat/rtsp.c:1955:9: Taking false branch
1953. content = av_malloc(SDP_MAX_SIZE);
1954. size = avio_read(s->pb, content, SDP_MAX_SIZE - 1);
1955. if (size <= 0) {
^
1956. av_free(content);
1957. return AVERROR_INVALIDDATA;
libavformat/rtsp.c:1959:5:
1957. return AVERROR_INVALIDDATA;
1958. }
1959. content[size] ='\0';
^
1960.
1961. err = ff_sdp_parse(s, content);
|
https://github.com/libav/libav/blob/f89584ca4458c84467e9fb27567e33891d1c7cd5/libavformat/rtsp.c/#L1959
|
d2a_code_trace_data_44782
|
static int wpacket_intern_close(WPACKET *pkt, WPACKET_SUB *sub, int doclose)
{
size_t packlen = pkt->written - sub->pwritten;
if (packlen == 0
&& (sub->flags & WPACKET_FLAGS_NON_ZERO_LENGTH) != 0)
return 0;
if (packlen == 0
&& sub->flags & WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH) {
if (!doclose)
return 0;
if ((pkt->curr - sub->lenbytes) == sub->packet_len) {
pkt->written -= sub->lenbytes;
pkt->curr -= sub->lenbytes;
}
sub->packet_len = 0;
sub->lenbytes = 0;
}
if (sub->lenbytes > 0
&& !put_value(&GETBUF(pkt)[sub->packet_len], packlen,
sub->lenbytes))
return 0;
if (doclose) {
pkt->subs = sub->parent;
OPENSSL_free(sub);
}
return 1;
}
test/wpackettest.c:79: error: INTEGER_OVERFLOW_L2
([0, +oo] - [0, 4]):unsigned64 by call to `WPACKET_finish`.
Showing all 10 steps of the trace
test/wpackettest.c:55:17: Call
53. || !TEST_true(WPACKET_put_bytes_u8(&pkt, 0xff))
54. /* Closing a top level WPACKET should fail */
55. || !TEST_false(WPACKET_close(&pkt))
^
56. /* Finishing a top level WPACKET should succeed */
57. || !TEST_true(WPACKET_finish(&pkt))
ssl/packet.c:243:1: Parameter `pkt->subs->lenbytes`
241. }
242.
243. > int WPACKET_close(WPACKET *pkt)
244. {
245. /*
test/wpackettest.c:79:17: Call
77. if (!TEST_true(WPACKET_init_len(&pkt, buf, 4))
78. || !TEST_true(WPACKET_put_bytes_u8(&pkt, 0xff))
79. || !TEST_true(WPACKET_finish(&pkt))
^
80. || !TEST_true(WPACKET_get_total_written(&pkt, &written))
81. || !TEST_mem_eq(buf->data, written, simple3, sizeof(simple3)))
ssl/packet.c:255:1: Parameter `pkt->curr`
253. }
254.
255. > int WPACKET_finish(WPACKET *pkt)
256. {
257. int ret;
ssl/packet.c:266:11: Call
264. return 0;
265.
266. ret = wpacket_intern_close(pkt, pkt->subs, 1);
^
267. if (ret) {
268. OPENSSL_free(pkt->subs);
ssl/packet.c:188:1: <LHS trace>
186. * (i.e. it fills in all the lengths), but doesn't actually close anything.
187. */
188. > static int wpacket_intern_close(WPACKET *pkt, WPACKET_SUB *sub, int doclose)
189. {
190. size_t packlen = pkt->written - sub->pwritten;
ssl/packet.c:188:1: Parameter `pkt->curr`
186. * (i.e. it fills in all the lengths), but doesn't actually close anything.
187. */
188. > static int wpacket_intern_close(WPACKET *pkt, WPACKET_SUB *sub, int doclose)
189. {
190. size_t packlen = pkt->written - sub->pwritten;
ssl/packet.c:188:1: <RHS trace>
186. * (i.e. it fills in all the lengths), but doesn't actually close anything.
187. */
188. > static int wpacket_intern_close(WPACKET *pkt, WPACKET_SUB *sub, int doclose)
189. {
190. size_t packlen = pkt->written - sub->pwritten;
ssl/packet.c:188:1: Parameter `sub->lenbytes`
186. * (i.e. it fills in all the lengths), but doesn't actually close anything.
187. */
188. > static int wpacket_intern_close(WPACKET *pkt, WPACKET_SUB *sub, int doclose)
189. {
190. size_t packlen = pkt->written - sub->pwritten;
ssl/packet.c:203:13: Binary operation: ([0, +oo] - [0, 4]):unsigned64 by call to `WPACKET_finish`
201.
202. /* Deallocate any bytes allocated for the length of the WPACKET */
203. if ((pkt->curr - sub->lenbytes) == sub->packet_len) {
^
204. pkt->written -= sub->lenbytes;
205. pkt->curr -= sub->lenbytes;
|
https://github.com/openssl/openssl/blob/424aa352458486d67e1e9cd3d3990dc06a60ba4a/ssl/packet.c/#L203
|
d2a_code_trace_data_44783
|
static void test_fail_bignum_common(const char *prefix, const char *file,
int line, const char *type,
const char *left, const char *right,
const char *op,
const BIGNUM *bn1, const BIGNUM *bn2)
{
const size_t bytes = bn_bytes;
char b1[MAX_STRING_WIDTH + 1], b2[MAX_STRING_WIDTH + 1];
char *p, bdiff[MAX_STRING_WIDTH + 1];
size_t l1, l2, n1, n2, i, len;
unsigned int cnt, diff, real_diff;
unsigned char *m1 = NULL, *m2 = NULL;
int lz1 = 1, lz2 = 1;
unsigned char buffer[MEM_BUFFER_SIZE * 2], *bufp = buffer;
test_fail_message_prefix(prefix, file, line, type, left, right, op);
l1 = bn1 == NULL ? 0 : (BN_num_bytes(bn1) + (BN_is_negative(bn1) ? 1 : 0));
l2 = bn2 == NULL ? 0 : (BN_num_bytes(bn2) + (BN_is_negative(bn2) ? 1 : 0));
if (l1 == 0 && l2 == 0) {
if ((bn1 == NULL) == (bn2 == NULL)) {
test_bignum_header_line();
test_bignum_zero_print(bn1, ' ');
} else {
test_diff_header(left, right);
test_bignum_header_line();
test_bignum_zero_print(bn1, '-');
test_bignum_zero_print(bn2, '+');
}
goto fin;
}
if (l1 != l2 || bn1 == NULL || bn2 == NULL || BN_cmp(bn1, bn2) != 0)
test_diff_header(left, right);
test_bignum_header_line();
len = ((l1 > l2 ? l1 : l2) + bytes - 1) / bytes * bytes;
if (len > MEM_BUFFER_SIZE && (bufp = OPENSSL_malloc(len * 2)) == NULL) {
bufp = buffer;
len = MEM_BUFFER_SIZE;
test_printf_stderr("WARNING: these BIGNUMs have been truncated\n");
}
if (bn1 != NULL) {
m1 = bufp;
BN_bn2binpad(bn1, m1, len);
}
if (bn2 != NULL) {
m2 = bufp + len;
BN_bn2binpad(bn2, m2, len);
}
while (len > 0) {
cnt = 8 * (len - bytes);
n1 = convert_bn_memory(m1, bytes, b1, &lz1, bn1);
n2 = convert_bn_memory(m2, bytes, b2, &lz2, bn2);
diff = real_diff = 0;
i = 0;
p = bdiff;
for (i=0; b1[i] != '\0'; i++)
if (b1[i] == b2[i] || b1[i] == ' ' || b2[i] == ' ') {
*p++ = ' ';
diff |= b1[i] != b2[i];
} else {
*p++ = '^';
real_diff = diff = 1;
}
*p++ = '\0';
if (!diff) {
test_printf_stderr(" %s:% 5d\n", n2 > n1 ? b2 : b1, cnt);
} else {
if (cnt == 0 && bn1 == NULL)
test_printf_stderr("-%s\n", b1);
else if (cnt == 0 || n1 > 0)
test_printf_stderr("-%s:% 5d\n", b1, cnt);
if (cnt == 0 && bn2 == NULL)
test_printf_stderr("+%s\n", b2);
else if (cnt == 0 || n2 > 0)
test_printf_stderr("+%s:% 5d\n", b2, cnt);
if (real_diff && (cnt == 0 || (n1 > 0 && n2 > 0))
&& bn1 != NULL && bn2 != NULL)
test_printf_stderr(" %s\n", bdiff);
}
if (m1 != NULL)
m1 += bytes;
if (m2 != NULL)
m2 += bytes;
len -= bytes;
}
fin:
test_flush_stderr();
if (bufp != buffer)
OPENSSL_free(bufp);
}
test/testutil/format_output.c:315: error: INTEGER_OVERFLOW_L2
([1, +oo] - 32):unsigned64.
Showing all 6 steps of the trace
test/testutil/format_output.c:301:9: <LHS trace>
299. if (len > MEM_BUFFER_SIZE && (bufp = OPENSSL_malloc(len * 2)) == NULL) {
300. bufp = buffer;
301. len = MEM_BUFFER_SIZE;
^
302. test_printf_stderr("WARNING: these BIGNUMs have been truncated\n");
303. }
test/testutil/format_output.c:301:9: Assignment
299. if (len > MEM_BUFFER_SIZE && (bufp = OPENSSL_malloc(len * 2)) == NULL) {
300. bufp = buffer;
301. len = MEM_BUFFER_SIZE;
^
302. test_printf_stderr("WARNING: these BIGNUMs have been truncated\n");
303. }
test/testutil/format_output.c:168:1: <RHS trace>
166. * of characters these take.
167. */
168. > static const int bn_bytes = (MAX_STRING_WIDTH - 9) / (BN_OUTPUT_SIZE * 2 + 1)
169. * BN_OUTPUT_SIZE;
170. static const int bn_chars = (MAX_STRING_WIDTH - 9) / (BN_OUTPUT_SIZE * 2 + 1)
test/testutil/format_output.c:168:1: Assignment
166. * of characters these take.
167. */
168. > static const int bn_bytes = (MAX_STRING_WIDTH - 9) / (BN_OUTPUT_SIZE * 2 + 1)
169. * BN_OUTPUT_SIZE;
170. static const int bn_chars = (MAX_STRING_WIDTH - 9) / (BN_OUTPUT_SIZE * 2 + 1)
test/testutil/format_output.c:268:5: Assignment
266. const BIGNUM *bn1, const BIGNUM *bn2)
267. {
268. const size_t bytes = bn_bytes;
^
269. char b1[MAX_STRING_WIDTH + 1], b2[MAX_STRING_WIDTH + 1];
270. char *p, bdiff[MAX_STRING_WIDTH + 1];
test/testutil/format_output.c:315:9: Binary operation: ([1, +oo] - 32):unsigned64
313.
314. while (len > 0) {
315. cnt = 8 * (len - bytes);
^
316. n1 = convert_bn_memory(m1, bytes, b1, &lz1, bn1);
317. n2 = convert_bn_memory(m2, bytes, b2, &lz2, bn2);
|
https://github.com/openssl/openssl/blob/633a8829ffc01952aed1f5040d481a5eeef1670c/test/testutil/format_output.c/#L315
|
d2a_code_trace_data_44784
|
static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
{
BN_ULONG *a = NULL;
if (words > (INT_MAX / (4 * BN_BITS2))) {
BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_BIGNUM_TOO_LONG);
return NULL;
}
if (BN_get_flags(b, BN_FLG_STATIC_DATA)) {
BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA);
return NULL;
}
if (BN_get_flags(b, BN_FLG_SECURE))
a = OPENSSL_secure_zalloc(words * sizeof(*a));
else
a = OPENSSL_zalloc(words * sizeof(*a));
if (a == NULL) {
BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE);
return NULL;
}
assert(b->top <= words);
if (b->top > 0)
memcpy(a, b->d, sizeof(*a) * b->top);
return a;
}
test/bntest.c:616: error: BUFFER_OVERRUN_L3
Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_rand`.
Showing all 18 steps of the trace
test/bntest.c:617:20: Call
615. for (i = 0; i < NUM0; i++) {
616. if (!(TEST_true(BN_rand(a, 512, 0, 0))
617. && TEST_ptr(BN_copy(b, BN_value_one()))))
^
618. goto err;
619. BN_set_negative(a, rand_neg());
crypto/bn/bn_lib.c:281:1: Parameter `a->top`
279. }
280.
281. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
282. {
283. bn_check_top(b);
test/bntest.c:616:15: Call
614.
615. for (i = 0; i < NUM0; i++) {
616. if (!(TEST_true(BN_rand(a, 512, 0, 0))
^
617. && TEST_ptr(BN_copy(b, BN_value_one()))))
618. goto err;
crypto/bn/bn_rand.c:106:1: Parameter `*rnd->d`
104. return bnrand(NORMAL, rnd, bits, top, bottom, ctx);
105. }
106. > int BN_rand(BIGNUM *rnd, int bits, int top, int bottom)
107. {
108. return bnrand(NORMAL, rnd, bits, top, bottom, NULL);
crypto/bn/bn_rand.c:108:12: Call
106. int BN_rand(BIGNUM *rnd, int bits, int top, int bottom)
107. {
108. return bnrand(NORMAL, rnd, bits, top, bottom, NULL);
^
109. }
110.
crypto/bn/bn_rand.c:23:1: Parameter `*rnd->d`
21. } BNRAND_FLAG;
22.
23. > static int bnrand(BNRAND_FLAG flag, BIGNUM *rnd, int bits, int top, int bottom,
24. BN_CTX *ctx)
25. {
crypto/bn/bn_rand.c:33:9: Call
31. if (top != BN_RAND_TOP_ANY || bottom != BN_RAND_BOTTOM_ANY)
32. goto toosmall;
33. BN_zero(rnd);
^
34. return 1;
35. }
crypto/bn/bn_lib.c:361:1: Parameter `*a->d`
359. }
360.
361. > int BN_set_word(BIGNUM *a, BN_ULONG w)
362. {
363. bn_check_top(a);
crypto/bn/bn_lib.c:364:9: Call
362. {
363. bn_check_top(a);
364. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
^
365. return 0;
366. a->neg = 0;
crypto/bn/bn_lcl.h:660:1: Parameter `*a->d`
658. const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx);
659.
660. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits)
661. {
662. if (bits > (INT_MAX - BN_BITS2 + 1))
crypto/bn/bn_lcl.h:668:12: Call
666. return a;
667.
668. return bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2);
^
669. }
670.
crypto/bn/bn_lib.c:245:1: Parameter `*b->d`
243. */
244.
245. > BIGNUM *bn_expand2(BIGNUM *b, int words)
246. {
247. if (words > b->dmax) {
crypto/bn/bn_lib.c:248:23: Call
246. {
247. if (words > b->dmax) {
248. BN_ULONG *a = bn_expand_internal(b, words);
^
249. if (!a)
250. return NULL;
crypto/bn/bn_lib.c:209:1: <Offset trace>
207. /* This is used by bn_expand2() */
208. /* The caller MUST check that words > b->dmax before calling this */
209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
210. {
211. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:209:1: Parameter `b->top`
207. /* This is used by bn_expand2() */
208. /* The caller MUST check that words > b->dmax before calling this */
209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
210. {
211. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:209:1: <Length trace>
207. /* This is used by bn_expand2() */
208. /* The caller MUST check that words > b->dmax before calling this */
209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
210. {
211. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:209:1: Parameter `*b->d`
207. /* This is used by bn_expand2() */
208. /* The caller MUST check that words > b->dmax before calling this */
209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
210. {
211. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:232:9: Array access: Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_rand`
230. assert(b->top <= words);
231. if (b->top > 0)
232. memcpy(a, b->d, sizeof(*a) * b->top);
^
233.
234. return a;
|
https://github.com/openssl/openssl/blob/bd01733fdd9a5a0acdc72cf5c6601d37e8ddd801/crypto/bn/bn_lib.c/#L232
|
d2a_code_trace_data_44785
|
void bn_correct_top(BIGNUM *a)
{
BN_ULONG *ftl;
int tmp_top = a->top;
if (tmp_top > 0) {
for (ftl = &(a->d[tmp_top]); tmp_top > 0; tmp_top--) {
ftl--;
if (*ftl != 0)
break;
}
a->top = tmp_top;
}
if (a->top == 0)
a->neg = 0;
a->flags &= ~BN_FLG_FIXED_TOP;
bn_pollute(a);
}
test/bntest.c:328: error: BUFFER_OVERRUN_L3
Offset: [1, +oo] Size: [0, 8388607] by call to `BN_div`.
Showing all 14 steps of the trace
test/bntest.c:320:11: Call
318. goto err;
319.
320. if (!(TEST_true(BN_bntest_rand(a, 1024, 0, 0))))
^
321. goto err;
322. for (i = 0; i < NUM0; i++) {
crypto/bn/bn_rand.c:111:1: Parameter `*rnd->d`
109. }
110.
111. > int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom)
112. {
113. return bnrand(TESTING, rnd, bits, top, bottom, NULL);
crypto/bn/bn_rand.c:113:12: Call
111. int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom)
112. {
113. return bnrand(TESTING, rnd, bits, top, bottom, NULL);
^
114. }
115.
crypto/bn/bn_rand.c:23:1: Parameter `*rnd->d`
21. } BNRAND_FLAG;
22.
23. > static int bnrand(BNRAND_FLAG flag, BIGNUM *rnd, int bits, int top, int bottom,
24. BN_CTX *ctx)
25. {
test/bntest.c:328:20: Call
326. BN_set_negative(b, rand_neg());
327. if (!(TEST_true(BN_mod(c, a, b, ctx))
328. && TEST_true(BN_div(d, e, a, b, ctx))
^
329. && TEST_true(BN_sub(e, e, c))
330. && TEST_BN_eq_zero(e)))
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 `dv->top`
262. * divisor's length is considered public;
263. */
264. > int bn_div_fixed_top(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num,
265. const BIGNUM *divisor, BN_CTX *ctx)
266. {
crypto/bn/bn_div.c:233:13: Call
231. if (ret) {
232. if (dv != NULL)
233. bn_correct_top(dv);
^
234. if (rm != NULL)
235. bn_correct_top(rm);
crypto/bn/bn_lib.c:967:1: <Offset trace>
965. }
966.
967. > void bn_correct_top(BIGNUM *a)
968. {
969. BN_ULONG *ftl;
crypto/bn/bn_lib.c:967:1: Parameter `a->top`
965. }
966.
967. > void bn_correct_top(BIGNUM *a)
968. {
969. BN_ULONG *ftl;
crypto/bn/bn_lib.c:970:5: Assignment
968. {
969. BN_ULONG *ftl;
970. int tmp_top = a->top;
^
971.
972. if (tmp_top > 0) {
crypto/bn/bn_lib.c:967:1: <Length trace>
965. }
966.
967. > void bn_correct_top(BIGNUM *a)
968. {
969. BN_ULONG *ftl;
crypto/bn/bn_lib.c:967:1: Parameter `*a->d`
965. }
966.
967. > void bn_correct_top(BIGNUM *a)
968. {
969. BN_ULONG *ftl;
crypto/bn/bn_lib.c:973:14: Array access: Offset: [1, +oo] Size: [0, 8388607] by call to `BN_div`
971.
972. if (tmp_top > 0) {
973. for (ftl = &(a->d[tmp_top]); tmp_top > 0; tmp_top--) {
^
974. ftl--;
975. if (*ftl != 0)
|
https://github.com/openssl/openssl/blob/bd01733fdd9a5a0acdc72cf5c6601d37e8ddd801/crypto/bn/bn_lib.c/#L973
|
d2a_code_trace_data_44786
|
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: [432+min(0, `c->synth_buf_offset[*]`), 433+max(511, `c->synth_buf_offset[*]`)] (⇐ [48+min(0, `c->synth_buf_offset[*]`), 49+max(511, `c->synth_buf_offset[*]`)] + 384) Size: 2 by call to `ff_mpa_synth_filter`.
libavcodec/mpc.c:51:1: Parameter `c->synth_buf[*]`
49. * Process decoded Musepack data and produce PCM
50. */
51. static void mpc_synth(MPCContext *c, int16_t *out)
^
52. {
53. int dither_state = 0;
libavcodec/mpc.c:60:13: Call
58. samples_ptr = samples + ch;
59. for(i = 0; i < SAMPLES_PER_BAND; i++) {
60. ff_mpa_synth_filter(c->synth_buf[ch], &(c->synth_buf_offset[ch]),
^
61. mpa_window, &dither_state,
62. samples_ptr, 2,
libavcodec/mpegaudiodec.c:858:1: <Length trace>
856. 32 samples. */
857. /* XXX: optimize by avoiding ring buffer usage */
858. void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
^
859. MPA_INT *window, int *dither_state,
860. OUT_INT *samples, int incr,
libavcodec/mpegaudiodec.c:858:1: Parameter `*synth_buf_ptr`
856. 32 samples. */
857. /* XXX: optimize by avoiding ring buffer usage */
858. void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
^
859. MPA_INT *window, int *dither_state,
860. OUT_INT *samples, int incr,
libavcodec/mpegaudiodec.c:877:5: Assignment
875.
876. offset = *synth_buf_offset;
877. synth_buf = synth_buf_ptr + offset;
^
878.
879. for(j=0;j<32;j++) {
libavcodec/mpegaudiodec.c:898:5: Assignment
896. p = synth_buf + 16;
897. SUM8(sum, +=, w, p);
898. p = synth_buf + 48;
^
899. SUM8(sum, -=, w + 32, p);
900. *samples = round_sample(&sum);
libavcodec/mpegaudiodec.c:899:5: Array access: Offset: [432+min(0, c->synth_buf_offset[*]), 433+max(511, c->synth_buf_offset[*])] (⇐ [48+min(0, c->synth_buf_offset[*]), 49+max(511, c->synth_buf_offset[*])] + 384) Size: 2 by call to `ff_mpa_synth_filter`
897. SUM8(sum, +=, w, p);
898. p = synth_buf + 48;
899. SUM8(sum, -=, w + 32, p);
^
900. *samples = round_sample(&sum);
901. samples += incr;
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/mpegaudiodec.c/#L899
|
d2a_code_trace_data_44787
|
int ssl3_cbc_remove_padding(const SSL *s,
SSL3_RECORD *rec,
unsigned block_size, unsigned mac_size)
{
unsigned padding_length, good;
const unsigned overhead = 1 + mac_size;
if (overhead > rec->length)
return 0;
padding_length = rec->data[rec->length - 1];
good = constant_time_ge(rec->length, padding_length + overhead);
good &= constant_time_ge(block_size, padding_length + 1);
rec->length -= good & (padding_length + 1);
return constant_time_select_int(good, 1, -1);
}
ssl/record/ssl3_record.c:581: error: INTEGER_OVERFLOW_L2
([0, +oo] - 1):unsigned32 by call to `ssl3_cbc_remove_padding`.
Showing all 5 steps of the trace
ssl/record/ssl3_record.c:522:1: Parameter `s->rlayer.rrec.length`
520. * occurred.
521. */
522. > int ssl3_enc(SSL *s, int send)
523. {
524. SSL3_RECORD *rec;
ssl/record/ssl3_record.c:581:20: Call
579. mac_size = EVP_MD_CTX_size(s->read_hash);
580. if ((bs != 1) && !send)
581. return ssl3_cbc_remove_padding(s, rec, bs, mac_size);
^
582. }
583. return (1);
ssl/record/ssl3_record.c:986:1: <LHS trace>
984. * -1: otherwise.
985. */
986. > int ssl3_cbc_remove_padding(const SSL *s,
987. SSL3_RECORD *rec,
988. unsigned block_size, unsigned mac_size)
ssl/record/ssl3_record.c:986:1: Parameter `rec->length`
984. * -1: otherwise.
985. */
986. > int ssl3_cbc_remove_padding(const SSL *s,
987. SSL3_RECORD *rec,
988. unsigned block_size, unsigned mac_size)
ssl/record/ssl3_record.c:999:22: Binary operation: ([0, +oo] - 1):unsigned32 by call to `ssl3_cbc_remove_padding`
997. return 0;
998.
999. padding_length = rec->data[rec->length - 1];
^
1000. good = constant_time_ge(rec->length, padding_length + overhead);
1001. /* SSLv3 requires that the padding is minimal. */
|
https://github.com/openssl/openssl/blob/747e16398d704a667cc99f8a0b1912c36b7de52d/ssl/record/ssl3_record.c/#L999
|
d2a_code_trace_data_44788
|
static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
{
BN_ULONG *a = NULL;
if (words > (INT_MAX / (4 * BN_BITS2))) {
BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_BIGNUM_TOO_LONG);
return NULL;
}
if (BN_get_flags(b, BN_FLG_STATIC_DATA)) {
BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA);
return NULL;
}
if (BN_get_flags(b, BN_FLG_SECURE))
a = OPENSSL_secure_zalloc(words * sizeof(*a));
else
a = OPENSSL_zalloc(words * sizeof(*a));
if (a == NULL) {
BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE);
return NULL;
}
assert(b->top <= words);
if (b->top > 0)
memcpy(a, b->d, sizeof(*a) * b->top);
return a;
}
crypto/bn/bn_exp.c:654: error: BUFFER_OVERRUN_L3
Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_nnmod`.
Showing all 21 steps of the trace
crypto/bn/bn_exp.c:647:14: Call
645. if ((mont = BN_MONT_CTX_new()) == NULL)
646. goto err;
647. if (!BN_MONT_CTX_set(mont, m, ctx))
^
648. goto err;
649. }
crypto/bn/bn_mont.c:353:14: Call
351. else if ((BN_mod_inverse(Ri, R, &tmod, ctx)) == NULL)
352. goto err;
353. if (!BN_lshift(Ri, Ri, BN_BITS2))
^
354. goto err; /* R*Ri */
355. if (!BN_is_zero(Ri)) {
crypto/bn/bn_shift.c:84:1: Parameter `r->top`
82. }
83.
84. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
85. {
86. int ret;
crypto/bn/bn_exp.c:654:17: Call
652. BIGNUM *reduced = BN_CTX_get(ctx);
653. if (reduced == NULL
654. || !BN_nnmod(reduced, a, m, ctx)) {
^
655. goto err;
656. }
crypto/bn/bn_mod.c:13:1: Parameter `*r->d`
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 `*rm->d`
207. * If 'dv' or 'rm' is NULL, the respective value is not returned.
208. */
209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
210. BN_CTX *ctx)
211. {
crypto/bn/bn_div.c:229:11: Call
227. }
228.
229. ret = bn_div_fixed_top(dv, rm, num, divisor, ctx);
^
230.
231. if (ret) {
crypto/bn/bn_div.c:264:1: Parameter `*rm->d`
262. * divisor's length is considered public;
263. */
264. > int bn_div_fixed_top(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num,
265. const BIGNUM *divisor, BN_CTX *ctx)
266. {
crypto/bn/bn_div.c:449:9: Call
447. snum->flags |= BN_FLG_FIXED_TOP;
448. if (rm != NULL)
449. bn_rshift_fixed_top(rm, snum, norm_shift);
^
450. BN_CTX_end(ctx);
451. return 1;
crypto/bn/bn_shift.c:214:1: Parameter `*r->d`
212. * |n < BN_BITS2| or |n / BN_BITS2| being non-secret.
213. */
214. > int bn_rshift_fixed_top(BIGNUM *r, const BIGNUM *a, int n)
215. {
216. int i, top, nw;
crypto/bn/bn_shift.c:239:19: Call
237. mask |= mask >> 8;
238. top = a->top - nw;
239. if (r != a && bn_wexpand(r, top) == NULL)
^
240. return 0;
241.
crypto/bn/bn_lib.c:960:1: Parameter `*a->d`
958. }
959.
960. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
961. {
962. return (words <= a->dmax) ? a : bn_expand2(a, words);
crypto/bn/bn_lib.c:962:37: Call
960. BIGNUM *bn_wexpand(BIGNUM *a, int words)
961. {
962. return (words <= a->dmax) ? a : bn_expand2(a, words);
^
963. }
964.
crypto/bn/bn_lib.c:245:1: Parameter `*b->d`
243. */
244.
245. > BIGNUM *bn_expand2(BIGNUM *b, int words)
246. {
247. if (words > b->dmax) {
crypto/bn/bn_lib.c:248:23: Call
246. {
247. if (words > b->dmax) {
248. BN_ULONG *a = bn_expand_internal(b, words);
^
249. if (!a)
250. return NULL;
crypto/bn/bn_lib.c:209:1: <Offset trace>
207. /* This is used by bn_expand2() */
208. /* The caller MUST check that words > b->dmax before calling this */
209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
210. {
211. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:209:1: Parameter `b->top`
207. /* This is used by bn_expand2() */
208. /* The caller MUST check that words > b->dmax before calling this */
209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
210. {
211. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:209:1: <Length trace>
207. /* This is used by bn_expand2() */
208. /* The caller MUST check that words > b->dmax before calling this */
209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
210. {
211. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:209:1: Parameter `*b->d`
207. /* This is used by bn_expand2() */
208. /* The caller MUST check that words > b->dmax before calling this */
209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
210. {
211. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:232:9: Array access: Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_nnmod`
230. assert(b->top <= words);
231. if (b->top > 0)
232. memcpy(a, b->d, sizeof(*a) * b->top);
^
233.
234. return a;
|
https://github.com/openssl/openssl/blob/18e1e302452e6dea4500b6f981cee7e151294dea/crypto/bn/bn_lib.c/#L232
|
d2a_code_trace_data_44789
|
static int nss_keylog_int(const char *prefix,
SSL *ssl,
const uint8_t *parameter_1,
size_t parameter_1_len,
const uint8_t *parameter_2,
size_t parameter_2_len)
{
char *out = NULL;
char *cursor = NULL;
size_t out_len = 0;
size_t i;
size_t prefix_len;
if (ssl->ctx->keylog_callback == NULL) return 1;
prefix_len = strlen(prefix);
out_len = prefix_len + (2*parameter_1_len) + (2*parameter_2_len) + 3;
if ((out = cursor = OPENSSL_malloc(out_len)) == NULL) {
SSLerr(SSL_F_NSS_KEYLOG_INT, ERR_R_MALLOC_FAILURE);
return 0;
}
strcpy(cursor, prefix);
cursor += prefix_len;
*cursor++ = ' ';
for (i = 0; i < parameter_1_len; i++) {
sprintf(cursor, "%02x", parameter_1[i]);
cursor += 2;
}
*cursor++ = ' ';
for (i = 0; i < parameter_2_len; i++) {
sprintf(cursor, "%02x", parameter_2[i]);
cursor += 2;
}
*cursor = '\0';
ssl->ctx->keylog_callback(ssl, (const char *)out);
OPENSSL_free(out);
return 1;
}
ssl/statem/statem_clnt.c:2642: error: BUFFER_OVERRUN_L3
Offset: 3 Size: [1, 150] by call to `ssl_log_rsa_client_key_exchange`.
Showing all 13 steps of the trace
ssl/statem/statem_clnt.c:2592:5: Assignment
2590. }
2591.
2592. pmslen = SSL_MAX_MASTER_KEY_LENGTH;
^
2593. pms = OPENSSL_malloc(pmslen);
2594. if (pms == NULL) {
ssl/statem/statem_clnt.c:2642:10: Call
2640.
2641. /* Log the premaster secret, if logging is enabled. */
2642. if (!ssl_log_rsa_client_key_exchange(s, encdata, enclen, pms, pmslen))
^
2643. goto err;
2644.
ssl/ssl_lib.c:4418:1: Parameter `premaster_len`
4416. }
4417.
4418. > int ssl_log_rsa_client_key_exchange(SSL *ssl,
4419. const uint8_t *encrypted_premaster,
4420. size_t encrypted_premaster_len,
ssl/ssl_lib.c:4430:12: Call
4428.
4429. /* We only want the first 8 bytes of the encrypted premaster as a tag. */
4430. return nss_keylog_int("RSA",
^
4431. ssl,
4432. encrypted_premaster,
ssl/ssl_lib.c:4366:1: <Offset trace>
4364. }
4365.
4366. > static int nss_keylog_int(const char *prefix,
4367. SSL *ssl,
4368. const uint8_t *parameter_1,
ssl/ssl_lib.c:4366:1: Parameter `prefix->strlen`
4364. }
4365.
4366. > static int nss_keylog_int(const char *prefix,
4367. SSL *ssl,
4368. const uint8_t *parameter_1,
ssl/ssl_lib.c:4366:1: <Length trace>
4364. }
4365.
4366. > static int nss_keylog_int(const char *prefix,
4367. SSL *ssl,
4368. const uint8_t *parameter_1,
ssl/ssl_lib.c:4366:1: Parameter `parameter_2_len`
4364. }
4365.
4366. > static int nss_keylog_int(const char *prefix,
4367. SSL *ssl,
4368. const uint8_t *parameter_1,
ssl/ssl_lib.c:4390:5: Assignment
4388. */
4389. prefix_len = strlen(prefix);
4390. out_len = prefix_len + (2*parameter_1_len) + (2*parameter_2_len) + 3;
^
4391. if ((out = cursor = OPENSSL_malloc(out_len)) == NULL) {
4392. SSLerr(SSL_F_NSS_KEYLOG_INT, ERR_R_MALLOC_FAILURE);
ssl/ssl_lib.c:4391:25: Call
4389. prefix_len = strlen(prefix);
4390. out_len = prefix_len + (2*parameter_1_len) + (2*parameter_2_len) + 3;
4391. if ((out = cursor = OPENSSL_malloc(out_len)) == NULL) {
^
4392. SSLerr(SSL_F_NSS_KEYLOG_INT, ERR_R_MALLOC_FAILURE);
4393. return 0;
crypto/mem.c:166:9: Assignment
164.
165. if (num <= 0)
166. return NULL;
^
167.
168. FAILTEST();
ssl/ssl_lib.c:4391:16: Assignment
4389. prefix_len = strlen(prefix);
4390. out_len = prefix_len + (2*parameter_1_len) + (2*parameter_2_len) + 3;
4391. if ((out = cursor = OPENSSL_malloc(out_len)) == NULL) {
^
4392. SSLerr(SSL_F_NSS_KEYLOG_INT, ERR_R_MALLOC_FAILURE);
4393. return 0;
ssl/ssl_lib.c:4396:5: Array access: Offset: 3 Size: [1, 150] by call to `ssl_log_rsa_client_key_exchange`
4394. }
4395.
4396. strcpy(cursor, prefix);
^
4397. cursor += prefix_len;
4398. *cursor++ = ' ';
|
https://github.com/openssl/openssl/blob/0247086d9a0713e18a0f16949039a40fdb63ff7e/ssl/ssl_lib.c/#L4396
|
d2a_code_trace_data_44790
|
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_x509.c:181: error: BUFFER_OVERRUN_L3
Offset: [-529, +oo] Size: 12 by call to `ASN1_TIME_print`.
Showing all 13 steps of the trace
crypto/x509/t_x509.c:122:13: Call
120. }
121. if (!(cflag & X509_FLAG_NO_VERSION)) {
122. l = X509_get_version(x);
^
123. if (BIO_printf(bp, "%8sVersion: %lu (0x%lx)\n", "", l + 1, l) <= 0)
124. goto err;
crypto/x509/x509_set.c:155:1: Parameter `*x->cert_info.version->data`
153. }
154.
155. > long X509_get_version(X509 *x)
156. {
157. return ASN1_INTEGER_get(x->cert_info.version);
crypto/x509/x509_set.c:157:12: Call
155. long X509_get_version(X509 *x)
156. {
157. return ASN1_INTEGER_get(x->cert_info.version);
^
158. }
159.
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/x509/t_x509.c:181:14: Call
179. if (BIO_write(bp, " Not Before: ", 24) <= 0)
180. goto err;
181. if (!ASN1_TIME_print(bp, X509_get_notBefore(x)))
^
182. goto err;
183. if (BIO_write(bp, "\n Not After : ", 25) <= 0)
crypto/asn1/a_time.c:202:1: Parameter `*tm->data`
200. }
201.
202. > int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm)
203. {
204. if (tm->type == V_ASN1_UTCTIME)
crypto/asn1/a_time.c:207:16: Call
205. return ASN1_UTCTIME_print(bp, tm);
206. if (tm->type == V_ASN1_GENERALIZEDTIME)
207. return ASN1_GENERALIZEDTIME_print(bp, tm);
^
208. BIO_write(bp, "Bad time value", 14);
209. return (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_TIME_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/39e46af6bb3f1ad7f5c0dee8e3d13e2daf9a0160/crypto/asn1/a_gentm.c/#L308
|
d2a_code_trace_data_44791
|
static ossl_inline unsigned int constant_time_is_zero(unsigned int a)
{
return constant_time_msb(~a & (a - 1));
}
crypto/rsa/rsa_pk1.c:196: error: INTEGER_OVERFLOW_L2
([0, +oo] - 1):unsigned32 by call to `constant_time_is_zero`.
Showing all 6 steps of the trace
crypto/rsa/rsa_pk1.c:154:1: Parameter `*from`
152. }
153.
154. > int RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen,
155. const unsigned char *from, int flen,
156. int num)
crypto/rsa/rsa_pk1.c:193:9: Assignment
191. flen -= 1 & mask;
192. from -= 1 & mask;
193. *--em = *from & mask;
^
194. }
195.
crypto/rsa/rsa_pk1.c:196:12: Call
194. }
195.
196. good = constant_time_is_zero(em[0]);
^
197. good &= constant_time_eq(em[1], 2);
198.
include/internal/constant_time_locl.h:164:1: <LHS trace>
162. }
163.
164. > static ossl_inline unsigned int constant_time_is_zero(unsigned int a)
165. {
166. return constant_time_msb(~a & (a - 1));
include/internal/constant_time_locl.h:164:1: Parameter `a`
162. }
163.
164. > static ossl_inline unsigned int constant_time_is_zero(unsigned int a)
165. {
166. return constant_time_msb(~a & (a - 1));
include/internal/constant_time_locl.h:166:12: Binary operation: ([0, +oo] - 1):unsigned32 by call to `constant_time_is_zero`
164. static ossl_inline unsigned int constant_time_is_zero(unsigned int a)
165. {
166. return constant_time_msb(~a & (a - 1));
^
167. }
168.
|
https://github.com/openssl/openssl/blob/4c2883a9bf59c5ee31e8e2e101b3894a16c06950/include/internal/constant_time_locl.h/#L166
|
d2a_code_trace_data_44792
|
static int opt_streamid(const char *opt, const char *arg)
{
int idx;
char *p;
char idx_str[16];
strncpy(idx_str, arg, sizeof(idx_str));
idx_str[sizeof(idx_str)-1] = '\0';
p = strchr(idx_str, ':');
if (!p) {
fprintf(stderr,
"Invalid value '%s' for option '%s', required syntax is 'index:value'\n",
arg, opt);
ffmpeg_exit(1);
}
*p++ = '\0';
idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1);
streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1);
streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX);
return 0;
}
ffmpeg.c:3677: error: Null Dereference
pointer `streamid_map` last assigned on line 3676 could be null and is dereferenced at line 3677, column 5.
ffmpeg.c:3659:1: start of procedure opt_streamid()
3657.
3658. /* arg format is "output-stream-index:streamid-value". */
3659. static int opt_streamid(const char *opt, const char *arg)
^
3660. {
3661. int idx;
ffmpeg.c:3665:5:
3663. char idx_str[16];
3664.
3665. strncpy(idx_str, arg, sizeof(idx_str));
^
3666. idx_str[sizeof(idx_str)-1] = '\0';
3667. p = strchr(idx_str, ':');
ffmpeg.c:3666:5:
3664.
3665. strncpy(idx_str, arg, sizeof(idx_str));
3666. idx_str[sizeof(idx_str)-1] = '\0';
^
3667. p = strchr(idx_str, ':');
3668. if (!p) {
ffmpeg.c:3667:5:
3665. strncpy(idx_str, arg, sizeof(idx_str));
3666. idx_str[sizeof(idx_str)-1] = '\0';
3667. p = strchr(idx_str, ':');
^
3668. if (!p) {
3669. fprintf(stderr,
ffmpeg.c:3668:10: Taking false branch
3666. idx_str[sizeof(idx_str)-1] = '\0';
3667. p = strchr(idx_str, ':');
3668. if (!p) {
^
3669. fprintf(stderr,
3670. "Invalid value '%s' for option '%s', required syntax is 'index:value'\n",
ffmpeg.c:3674:5:
3672. ffmpeg_exit(1);
3673. }
3674. *p++ = '\0';
^
3675. idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1);
3676. streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1);
ffmpeg.c:3675:5: Skipping parse_number_or_die(): empty list of specs
3673. }
3674. *p++ = '\0';
3675. idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1);
^
3676. streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1);
3677. streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX);
ffmpeg.c:3676:5:
3674. *p++ = '\0';
3675. idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1);
3676. streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1);
^
3677. streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX);
3678. return 0;
ffmpeg.c:561:1: start of procedure grow_array()
559.
560. /* similar to ff_dynarray_add() and av_fast_realloc() */
561. static void *grow_array(void *array, int elem_size, int *size, int new_size)
^
562. {
563. if (new_size >= INT_MAX / elem_size) {
ffmpeg.c:563:9: Taking false branch
561. static void *grow_array(void *array, int elem_size, int *size, int new_size)
562. {
563. if (new_size >= INT_MAX / elem_size) {
^
564. fprintf(stderr, "Array too big.\n");
565. ffmpeg_exit(1);
ffmpeg.c:567:9: Taking true branch
565. ffmpeg_exit(1);
566. }
567. if (*size < new_size) {
^
568. uint8_t *tmp = av_realloc(array, new_size*elem_size);
569. if (!tmp) {
ffmpeg.c:568:9:
566. }
567. if (*size < new_size) {
568. uint8_t *tmp = av_realloc(array, new_size*elem_size);
^
569. if (!tmp) {
570. fprintf(stderr, "Could not alloc buffer.\n");
libavutil/mem.c:119:1: start of procedure av_realloc()
117. }
118.
119. void *av_realloc(void *ptr, FF_INTERNAL_MEM_TYPE size)
^
120. {
121. #if CONFIG_MEMALIGN_HACK
libavutil/mem.c:126:8: Taking true branch
124.
125. /* let's disallow possible ambiguous cases */
126. if(size > (INT_MAX-16) )
^
127. return NULL;
128.
libavutil/mem.c:127:9:
125. /* let's disallow possible ambiguous cases */
126. if(size > (INT_MAX-16) )
127. return NULL;
^
128.
129. #if CONFIG_MEMALIGN_HACK
libavutil/mem.c:137:1: return from a call to av_realloc
135. return realloc(ptr, size);
136. #endif
137. }
^
138.
139. void av_free(void *ptr)
ffmpeg.c:569:14: Taking true branch
567. if (*size < new_size) {
568. uint8_t *tmp = av_realloc(array, new_size*elem_size);
569. if (!tmp) {
^
570. fprintf(stderr, "Could not alloc buffer.\n");
571. ffmpeg_exit(1);
ffmpeg.c:570:13:
568. uint8_t *tmp = av_realloc(array, new_size*elem_size);
569. if (!tmp) {
570. fprintf(stderr, "Could not alloc buffer.\n");
^
571. ffmpeg_exit(1);
572. }
ffmpeg.c:571:13: Skipping ffmpeg_exit(): empty list of specs
569. if (!tmp) {
570. fprintf(stderr, "Could not alloc buffer.\n");
571. ffmpeg_exit(1);
^
572. }
573. memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
ffmpeg.c:573:9:
571. ffmpeg_exit(1);
572. }
573. memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
^
574. *size = new_size;
575. return tmp;
ffmpeg.c:574:9:
572. }
573. memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
574. *size = new_size;
^
575. return tmp;
576. }
ffmpeg.c:575:9:
573. memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
574. *size = new_size;
575. return tmp;
^
576. }
577. return array;
ffmpeg.c:578:1: return from a call to grow_array
576. }
577. return array;
578. }
^
579.
580. static void choose_sample_fmt(AVStream *st, AVCodec *codec)
ffmpeg.c:3677:5: Skipping parse_number_or_die(): empty list of specs
3675. idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1);
3676. streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1);
3677. streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX);
^
3678. return 0;
3679. }
|
https://github.com/libav/libav/blob/f4c79d1e0b2e797012304db57903e4091b0c2d7c/ffmpeg.c/#L3677
|
d2a_code_trace_data_44793
|
BIGNUM *load_serial(char *serialfile, int create, ASN1_INTEGER **retai)
{
BIO *in = NULL;
BIGNUM *ret = NULL;
char buf[1024];
ASN1_INTEGER *ai = NULL;
ai = ASN1_INTEGER_new();
if (ai == NULL)
goto err;
in = BIO_new_file(serialfile, "r");
if (in == NULL) {
if (!create) {
perror(serialfile);
goto err;
}
ERR_clear_error();
ret = BN_new();
if (ret == NULL || !rand_serial(ret, ai))
BIO_printf(bio_err, "Out of memory\n");
} else {
if (!a2i_ASN1_INTEGER(in, ai, buf, 1024)) {
BIO_printf(bio_err, "unable to load number from %s\n",
serialfile);
goto err;
}
ret = ASN1_INTEGER_to_BN(ai, NULL);
if (ret == NULL) {
BIO_printf(bio_err,
"error converting number from bin to BIGNUM\n");
goto err;
}
}
if (ret && retai) {
*retai = ai;
ai = NULL;
}
err:
BIO_free(in);
ASN1_INTEGER_free(ai);
return (ret);
}
apps/apps.c:1424: error: MEMORY_LEAK
memory dynamically allocated by call to `ASN1_INTEGER_new()` at line 1390, column 10 is not reachable after line 1424, column 5.
Showing all 71 steps of the trace
apps/apps.c:1383:1: start of procedure load_serial()
1381. #undef BSIZE
1382. #define BSIZE 256
1383. > BIGNUM *load_serial(char *serialfile, int create, ASN1_INTEGER **retai)
1384. {
1385. BIO *in = NULL;
apps/apps.c:1385:5:
1383. BIGNUM *load_serial(char *serialfile, int create, ASN1_INTEGER **retai)
1384. {
1385. > BIO *in = NULL;
1386. BIGNUM *ret = NULL;
1387. char buf[1024];
apps/apps.c:1386:5:
1384. {
1385. BIO *in = NULL;
1386. > BIGNUM *ret = NULL;
1387. char buf[1024];
1388. ASN1_INTEGER *ai = NULL;
apps/apps.c:1388:5:
1386. BIGNUM *ret = NULL;
1387. char buf[1024];
1388. > ASN1_INTEGER *ai = NULL;
1389.
1390. ai = ASN1_INTEGER_new();
apps/apps.c:1390:5:
1388. ASN1_INTEGER *ai = NULL;
1389.
1390. > ai = ASN1_INTEGER_new();
1391. if (ai == NULL)
1392. goto err;
crypto/asn1/tasn_typ.c:78:1: start of procedure ASN1_INTEGER_new()
76.
77. IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_OCTET_STRING)
78. > IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_INTEGER)
79. IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_ENUMERATED)
80. IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_BIT_STRING)
crypto/asn1/asn1_lib.c:349:1: start of procedure ASN1_STRING_type_new()
347. }
348.
349. > ASN1_STRING *ASN1_STRING_type_new(int type)
350. {
351. ASN1_STRING *ret;
crypto/asn1/asn1_lib.c:353:5:
351. ASN1_STRING *ret;
352.
353. > ret = OPENSSL_zalloc(sizeof(*ret));
354. if (ret == NULL) {
355. ASN1err(ASN1_F_ASN1_STRING_TYPE_NEW, ERR_R_MALLOC_FAILURE);
crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
155. }
156.
157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:159:5:
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. > void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:161:9: Taking true branch
159. void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
^
162. memset(ret, 0, num);
163. return ret;
crypto/mem.c:162:9:
160.
161. if (ret != NULL)
162. > memset(ret, 0, num);
163. return ret;
164. }
crypto/mem.c:163:5:
161. if (ret != NULL)
162. memset(ret, 0, num);
163. > return ret;
164. }
165.
crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
162. memset(ret, 0, num);
163. return ret;
164. > }
165.
166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/asn1/asn1_lib.c:354:9: Taking false branch
352.
353. ret = OPENSSL_zalloc(sizeof(*ret));
354. if (ret == NULL) {
^
355. ASN1err(ASN1_F_ASN1_STRING_TYPE_NEW, ERR_R_MALLOC_FAILURE);
356. return (NULL);
crypto/asn1/asn1_lib.c:358:5:
356. return (NULL);
357. }
358. > ret->type = type;
359. return (ret);
360. }
crypto/asn1/asn1_lib.c:359:5:
357. }
358. ret->type = type;
359. > return (ret);
360. }
361.
crypto/asn1/asn1_lib.c:360:1: return from a call to ASN1_STRING_type_new
358. ret->type = type;
359. return (ret);
360. > }
361.
362. void ASN1_STRING_free(ASN1_STRING *a)
crypto/asn1/tasn_typ.c:78:1: return from a call to ASN1_INTEGER_new
76.
77. IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_OCTET_STRING)
78. > IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_INTEGER)
79. IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_ENUMERATED)
80. IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_BIT_STRING)
apps/apps.c:1391:9: Taking false branch
1389.
1390. ai = ASN1_INTEGER_new();
1391. if (ai == NULL)
^
1392. goto err;
1393.
apps/apps.c:1394:5: Skipping BIO_new_file(): empty list of specs
1392. goto err;
1393.
1394. in = BIO_new_file(serialfile, "r");
^
1395. if (in == NULL) {
1396. if (!create) {
apps/apps.c:1395:9: Taking false branch
1393.
1394. in = BIO_new_file(serialfile, "r");
1395. if (in == NULL) {
^
1396. if (!create) {
1397. perror(serialfile);
apps/apps.c:1405:14: Taking true branch
1403. BIO_printf(bio_err, "Out of memory\n");
1404. } else {
1405. if (!a2i_ASN1_INTEGER(in, ai, buf, 1024)) {
^
1406. BIO_printf(bio_err, "unable to load number from %s\n",
1407. serialfile);
apps/apps.c:1406:13: Skipping BIO_printf(): empty list of specs
1404. } else {
1405. if (!a2i_ASN1_INTEGER(in, ai, buf, 1024)) {
1406. BIO_printf(bio_err, "unable to load number from %s\n",
^
1407. serialfile);
1408. goto err;
apps/apps.c:1422:2:
1420. ai = NULL;
1421. }
1422. > err:
1423. BIO_free(in);
1424. ASN1_INTEGER_free(ai);
apps/apps.c:1423:5:
1421. }
1422. err:
1423. > BIO_free(in);
1424. ASN1_INTEGER_free(ai);
1425. return (ret);
crypto/bio/bio_lib.c:106:1: start of procedure BIO_free()
104. }
105.
106. > int BIO_free(BIO *a)
107. {
108. int i;
crypto/bio/bio_lib.c:110:9: Taking false branch
108. int i;
109.
110. if (a == NULL)
^
111. return (0);
112.
crypto/bio/bio_lib.c:113:5:
111. return (0);
112.
113. > i = CRYPTO_add(&a->references, -1, CRYPTO_LOCK_BIO);
114. #ifdef REF_PRINT
115. REF_PRINT("BIO", a);
crypto/lock.c:456:1: start of procedure CRYPTO_add_lock()
454. }
455.
456. > int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,
457. int line)
458. {
crypto/lock.c:459:5:
457. int line)
458. {
459. > int ret = 0;
460.
461. if (add_lock_callback != NULL) {
crypto/lock.c:461:9: Taking false branch
459. int ret = 0;
460.
461. if (add_lock_callback != NULL) {
^
462. #ifdef LOCK_DEBUG
463. int before = *pointer;
crypto/lock.c:477:9:
475. #endif
476. } else {
477. > CRYPTO_lock(CRYPTO_LOCK | CRYPTO_WRITE, type, file, line);
478.
479. ret = *pointer + amount;
crypto/lock.c:414:1: start of procedure CRYPTO_lock()
412. }
413.
414. > void CRYPTO_lock(int mode, int type, const char *file, int line)
415. {
416. #ifdef LOCK_DEBUG
crypto/lock.c:441:9: Taking false branch
439. }
440. #endif
441. if (type < 0) {
^
442. if (dynlock_lock_callback != NULL) {
443. struct CRYPTO_dynlock_value *pointer
crypto/lock.c:452:16: Taking false branch
450. CRYPTO_destroy_dynlockid(type);
451. }
452. } else if (locking_callback != NULL)
^
453. locking_callback(mode, type, file, line);
454. }
crypto/lock.c:441:5:
439. }
440. #endif
441. > if (type < 0) {
442. if (dynlock_lock_callback != NULL) {
443. struct CRYPTO_dynlock_value *pointer
crypto/lock.c:454:1: return from a call to CRYPTO_lock
452. } else if (locking_callback != NULL)
453. locking_callback(mode, type, file, line);
454. > }
455.
456. int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,
crypto/lock.c:479:9:
477. CRYPTO_lock(CRYPTO_LOCK | CRYPTO_WRITE, type, file, line);
478.
479. > ret = *pointer + amount;
480. #ifdef LOCK_DEBUG
481. {
crypto/lock.c:490:9:
488. }
489. #endif
490. > *pointer = ret;
491. CRYPTO_lock(CRYPTO_UNLOCK | CRYPTO_WRITE, type, file, line);
492. }
crypto/lock.c:491:9:
489. #endif
490. *pointer = ret;
491. > CRYPTO_lock(CRYPTO_UNLOCK | CRYPTO_WRITE, type, file, line);
492. }
493. return (ret);
crypto/lock.c:414:1: start of procedure CRYPTO_lock()
412. }
413.
414. > void CRYPTO_lock(int mode, int type, const char *file, int line)
415. {
416. #ifdef LOCK_DEBUG
crypto/lock.c:441:9: Taking false branch
439. }
440. #endif
441. if (type < 0) {
^
442. if (dynlock_lock_callback != NULL) {
443. struct CRYPTO_dynlock_value *pointer
crypto/lock.c:452:16: Taking false branch
450. CRYPTO_destroy_dynlockid(type);
451. }
452. } else if (locking_callback != NULL)
^
453. locking_callback(mode, type, file, line);
454. }
crypto/lock.c:441:5:
439. }
440. #endif
441. > if (type < 0) {
442. if (dynlock_lock_callback != NULL) {
443. struct CRYPTO_dynlock_value *pointer
crypto/lock.c:454:1: return from a call to CRYPTO_lock
452. } else if (locking_callback != NULL)
453. locking_callback(mode, type, file, line);
454. > }
455.
456. int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,
crypto/lock.c:493:5:
491. CRYPTO_lock(CRYPTO_UNLOCK | CRYPTO_WRITE, type, file, line);
492. }
493. > return (ret);
494. }
495.
crypto/lock.c:494:1: return from a call to CRYPTO_add_lock
492. }
493. return (ret);
494. > }
495.
496. const char *CRYPTO_get_lock_name(int type)
crypto/bio/bio_lib.c:117:9: Taking false branch
115. REF_PRINT("BIO", a);
116. #endif
117. if (i > 0)
^
118. return (1);
119. #ifdef REF_CHECK
crypto/bio/bio_lib.c:125:10: Taking true branch
123. }
124. #endif
125. if ((a->callback != NULL) &&
^
126. ((i = (int)a->callback(a, BIO_CB_FREE, NULL, 0, 0L, 1L)) <= 0))
127. return (i);
crypto/bio/bio_lib.c:126:10: Taking true branch
124. #endif
125. if ((a->callback != NULL) &&
126. ((i = (int)a->callback(a, BIO_CB_FREE, NULL, 0, 0L, 1L)) <= 0))
^
127. return (i);
128.
crypto/bio/bio_lib.c:127:9:
125. if ((a->callback != NULL) &&
126. ((i = (int)a->callback(a, BIO_CB_FREE, NULL, 0, 0L, 1L)) <= 0))
127. > return (i);
128.
129. CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, a, &a->ex_data);
crypto/bio/bio_lib.c:135:1: return from a call to BIO_free
133. OPENSSL_free(a);
134. return (1);
135. > }
136.
137. void BIO_vfree(BIO *a)
apps/apps.c:1424:5:
1422. err:
1423. BIO_free(in);
1424. > ASN1_INTEGER_free(ai);
1425. return (ret);
1426. }
crypto/asn1/tasn_typ.c:78:1: start of procedure ASN1_INTEGER_free()
76.
77. IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_OCTET_STRING)
78. > IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_INTEGER)
79. IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_ENUMERATED)
80. IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_BIT_STRING)
crypto/asn1/asn1_lib.c:362:1: start of procedure ASN1_STRING_free()
360. }
361.
362. > void ASN1_STRING_free(ASN1_STRING *a)
363. {
364. if (a == NULL)
crypto/asn1/asn1_lib.c:364:9: Taking false branch
362. void ASN1_STRING_free(ASN1_STRING *a)
363. {
364. if (a == NULL)
^
365. return;
366. if (!(a->flags & ASN1_STRING_FLAG_NDEF))
crypto/asn1/asn1_lib.c:366:11: Taking false branch
364. if (a == NULL)
365. return;
366. if (!(a->flags & ASN1_STRING_FLAG_NDEF))
^
367. OPENSSL_free(a->data);
368. if (!(a->flags & ASN1_STRING_FLAG_EMBED))
crypto/asn1/asn1_lib.c:368:11: Taking false branch
366. if (!(a->flags & ASN1_STRING_FLAG_NDEF))
367. OPENSSL_free(a->data);
368. if (!(a->flags & ASN1_STRING_FLAG_EMBED))
^
369. OPENSSL_free(a);
370. }
crypto/asn1/asn1_lib.c:368:5:
366. if (!(a->flags & ASN1_STRING_FLAG_NDEF))
367. OPENSSL_free(a->data);
368. > if (!(a->flags & ASN1_STRING_FLAG_EMBED))
369. OPENSSL_free(a);
370. }
crypto/asn1/asn1_lib.c:370:1: return from a call to ASN1_STRING_free
368. if (!(a->flags & ASN1_STRING_FLAG_EMBED))
369. OPENSSL_free(a);
370. > }
371.
372. void ASN1_STRING_clear_free(ASN1_STRING *a)
crypto/asn1/tasn_typ.c:78:1: return from a call to ASN1_INTEGER_free
76.
77. IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_OCTET_STRING)
78. > IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_INTEGER)
79. IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_ENUMERATED)
80. IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_BIT_STRING)
|
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/apps/apps.c/#L1424
|
d2a_code_trace_data_44794
|
static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict)
{
const char *codec_string = encoder ? "encoder" : "decoder";
AVCodec *codec;
if(!name)
return CODEC_ID_NONE;
codec = encoder ?
avcodec_find_encoder_by_name(name) :
avcodec_find_decoder_by_name(name);
if(!codec) {
fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
ffmpeg_exit(1);
}
if(codec->type != type) {
fprintf(stderr, "Invalid %s type '%s'\n", codec_string, name);
ffmpeg_exit(1);
}
if(codec->capabilities & CODEC_CAP_EXPERIMENTAL &&
strict > FF_COMPLIANCE_EXPERIMENTAL) {
fprintf(stderr, "%s '%s' is experimental and might produce bad "
"results.\nAdd '-strict experimental' if you want to use it.\n",
codec_string, codec->name);
codec = encoder ?
avcodec_find_encoder(codec->id) :
avcodec_find_decoder(codec->id);
if (!(codec->capabilities & CODEC_CAP_EXPERIMENTAL))
fprintf(stderr, "Or use the non experimental %s '%s'.\n",
codec_string, codec->name);
ffmpeg_exit(1);
}
return codec->id;
}
ffmpeg.c:3120: error: Null Dereference
pointer `codec` last assigned on line 3113 could be null and is dereferenced at line 3120, column 8.
ffmpeg.c:3106:1: start of procedure find_codec_or_die()
3104. }
3105.
3106. static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict)
^
3107. {
3108. const char *codec_string = encoder ? "encoder" : "decoder";
ffmpeg.c:3108:32: Condition is true
3106. static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict)
3107. {
3108. const char *codec_string = encoder ? "encoder" : "decoder";
^
3109. AVCodec *codec;
3110.
ffmpeg.c:3108:5:
3106. static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict)
3107. {
3108. const char *codec_string = encoder ? "encoder" : "decoder";
^
3109. AVCodec *codec;
3110.
ffmpeg.c:3111:9: Taking false branch
3109. AVCodec *codec;
3110.
3111. if(!name)
^
3112. return CODEC_ID_NONE;
3113. codec = encoder ?
ffmpeg.c:3113:13: Condition is true
3111. if(!name)
3112. return CODEC_ID_NONE;
3113. codec = encoder ?
^
3114. avcodec_find_encoder_by_name(name) :
3115. avcodec_find_decoder_by_name(name);
ffmpeg.c:3113:5:
3111. if(!name)
3112. return CODEC_ID_NONE;
3113. codec = encoder ?
^
3114. avcodec_find_encoder_by_name(name) :
3115. avcodec_find_decoder_by_name(name);
ffmpeg.c:3116:9: Taking true branch
3114. avcodec_find_encoder_by_name(name) :
3115. avcodec_find_decoder_by_name(name);
3116. if(!codec) {
^
3117. fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
3118. ffmpeg_exit(1);
ffmpeg.c:3117:9:
3115. avcodec_find_decoder_by_name(name);
3116. if(!codec) {
3117. fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
^
3118. ffmpeg_exit(1);
3119. }
ffmpeg.c:3118:9: Skipping ffmpeg_exit(): empty list of specs
3116. if(!codec) {
3117. fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
3118. ffmpeg_exit(1);
^
3119. }
3120. if(codec->type != type) {
ffmpeg.c:3120:8:
3118. ffmpeg_exit(1);
3119. }
3120. if(codec->type != type) {
^
3121. fprintf(stderr, "Invalid %s type '%s'\n", codec_string, name);
3122. ffmpeg_exit(1);
|
https://github.com/libav/libav/blob/87e4d9b252bc6fa3b982f7050013069c9dc3e05b/ffmpeg.c/#L3120
|
d2a_code_trace_data_44795
|
SSL_TEST_CTX *SSL_TEST_CTX_create(const CONF *conf, const char *test_section)
{
STACK_OF(CONF_VALUE) *sk_conf = NULL;
SSL_TEST_CTX *ctx = NULL;
int i;
size_t j;
if (!TEST_ptr(sk_conf = NCONF_get_section(conf, test_section))
|| !TEST_ptr(ctx = SSL_TEST_CTX_new()))
goto err;
for (i = 0; i < sk_CONF_VALUE_num(sk_conf); i++) {
int found = 0;
const CONF_VALUE *option = sk_CONF_VALUE_value(sk_conf, i);
if (strcmp(option->name, "client") == 0) {
if (!parse_client_options(&ctx->extra.client, conf, option->value))
goto err;
} else if (strcmp(option->name, "server") == 0) {
if (!parse_server_options(&ctx->extra.server, conf, option->value))
goto err;
} else if (strcmp(option->name, "server2") == 0) {
if (!parse_server_options(&ctx->extra.server2, conf, option->value))
goto err;
} else if (strcmp(option->name, "resume-client") == 0) {
if (!parse_client_options(&ctx->resume_extra.client, conf,
option->value))
goto err;
} else if (strcmp(option->name, "resume-server") == 0) {
if (!parse_server_options(&ctx->resume_extra.server, conf,
option->value))
goto err;
} else if (strcmp(option->name, "resume-server2") == 0) {
if (!parse_server_options(&ctx->resume_extra.server2, conf,
option->value))
goto err;
} else {
for (j = 0; j < OSSL_NELEM(ssl_test_ctx_options); j++) {
if (strcmp(option->name, ssl_test_ctx_options[j].name) == 0) {
if (!ssl_test_ctx_options[j].parse(ctx, option->value)) {
TEST_info("Bad value %s for option %s",
option->value, option->name);
goto err;
}
found = 1;
break;
}
}
if (!found) {
TEST_info("Unknown test option: %s", option->name);
goto err;
}
}
}
goto done;
err:
SSL_TEST_CTX_free(ctx);
ctx = NULL;
done:
return ctx;
}
test/ssl_test_ctx.c:868: error: NULL_DEREFERENCE
pointer `ctx` last assigned on line 812 could be null and is dereferenced by call to `SSL_TEST_CTX_free()` at line 868, column 5.
Showing all 39 steps of the trace
test/ssl_test_ctx.c:809:1: start of procedure SSL_TEST_CTX_create()
807. }
808.
809. > SSL_TEST_CTX *SSL_TEST_CTX_create(const CONF *conf, const char *test_section)
810. {
811. STACK_OF(CONF_VALUE) *sk_conf = NULL;
test/ssl_test_ctx.c:811:5:
809. SSL_TEST_CTX *SSL_TEST_CTX_create(const CONF *conf, const char *test_section)
810. {
811. > STACK_OF(CONF_VALUE) *sk_conf = NULL;
812. SSL_TEST_CTX *ctx = NULL;
813. int i;
test/ssl_test_ctx.c:812:5:
810. {
811. STACK_OF(CONF_VALUE) *sk_conf = NULL;
812. > SSL_TEST_CTX *ctx = NULL;
813. int i;
814. size_t j;
test/ssl_test_ctx.c:816:10:
814. size_t j;
815.
816. > if (!TEST_ptr(sk_conf = NCONF_get_section(conf, test_section))
817. || !TEST_ptr(ctx = SSL_TEST_CTX_new()))
818. goto err;
crypto/conf/conf_lib.c:244:1: start of procedure NCONF_get_section()
242. }
243.
244. > STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf, const char *section)
245. {
246. if (conf == NULL) {
crypto/conf/conf_lib.c:246:9: Taking false branch
244. STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf, const char *section)
245. {
246. if (conf == NULL) {
^
247. CONFerr(CONF_F_NCONF_GET_SECTION, CONF_R_NO_CONF);
248. return NULL;
crypto/conf/conf_lib.c:251:9: Taking false branch
249. }
250.
251. if (section == NULL) {
^
252. CONFerr(CONF_F_NCONF_GET_SECTION, CONF_R_NO_SECTION);
253. return NULL;
crypto/conf/conf_lib.c:256:5:
254. }
255.
256. > return _CONF_get_section_values(conf, section);
257. }
258.
crypto/conf/conf_api.c:35:1: start of procedure _CONF_get_section_values()
33.
34. /* Up until OpenSSL 0.9.5a, this was CONF_get_section */
35. > STACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf,
36. const char *section)
37. {
crypto/conf/conf_api.c:40:5:
38. CONF_VALUE *v;
39.
40. > v = _CONF_get_section(conf, section);
41. if (v != NULL)
42. return ((STACK_OF(CONF_VALUE) *)v->value);
crypto/conf/conf_api.c:22:1: start of procedure _CONF_get_section()
20.
21. /* Up until OpenSSL 0.9.5a, this was get_section */
22. > CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section)
23. {
24. CONF_VALUE *v, vv;
crypto/conf/conf_api.c:26:10: Taking false branch
24. CONF_VALUE *v, vv;
25.
26. if ((conf == NULL) || (section == NULL))
^
27. return NULL;
28. vv.name = NULL;
crypto/conf/conf_api.c:26:28: Taking false branch
24. CONF_VALUE *v, vv;
25.
26. if ((conf == NULL) || (section == NULL))
^
27. return NULL;
28. vv.name = NULL;
crypto/conf/conf_api.c:28:5:
26. if ((conf == NULL) || (section == NULL))
27. return NULL;
28. > vv.name = NULL;
29. vv.section = (char *)section;
30. v = lh_CONF_VALUE_retrieve(conf->data, &vv);
crypto/conf/conf_api.c:29:5:
27. return NULL;
28. vv.name = NULL;
29. > vv.section = (char *)section;
30. v = lh_CONF_VALUE_retrieve(conf->data, &vv);
31. return v;
crypto/conf/conf_api.c:30:5:
28. vv.name = NULL;
29. vv.section = (char *)section;
30. > v = lh_CONF_VALUE_retrieve(conf->data, &vv);
31. return v;
32. }
include/openssl/conf.h:31:1: start of procedure lh_CONF_VALUE_retrieve()
29.
30. DEFINE_STACK_OF(CONF_VALUE)
31. > DEFINE_LHASH_OF(CONF_VALUE);
32.
33. struct conf_st;
crypto/lhash/lhash.c:147:1: start of procedure OPENSSL_LH_retrieve()
145. }
146.
147. > void *OPENSSL_LH_retrieve(OPENSSL_LHASH *lh, const void *data)
148. {
149. unsigned long hash;
crypto/lhash/lhash.c:153:5:
151. void *ret;
152.
153. > lh->error = 0;
154. rn = getrn(lh, data, &hash);
155.
crypto/lhash/lhash.c:154:5: Skipping getrn(): empty list of specs
152.
153. lh->error = 0;
154. rn = getrn(lh, data, &hash);
^
155.
156. if (*rn == NULL) {
crypto/lhash/lhash.c:156:9: Taking true branch
154. rn = getrn(lh, data, &hash);
155.
156. if (*rn == NULL) {
^
157. lh->num_retrieve_miss++;
158. return NULL;
crypto/lhash/lhash.c:157:9:
155.
156. if (*rn == NULL) {
157. > lh->num_retrieve_miss++;
158. return NULL;
159. } else {
crypto/lhash/lhash.c:158:9:
156. if (*rn == NULL) {
157. lh->num_retrieve_miss++;
158. > return NULL;
159. } else {
160. ret = (*rn)->data;
crypto/lhash/lhash.c:164:1: return from a call to OPENSSL_LH_retrieve
162. }
163. return ret;
164. > }
165.
166. static void doall_util_fn(OPENSSL_LHASH *lh, int use_arg,
include/openssl/conf.h:31:1: return from a call to lh_CONF_VALUE_retrieve
29.
30. DEFINE_STACK_OF(CONF_VALUE)
31. > DEFINE_LHASH_OF(CONF_VALUE);
32.
33. struct conf_st;
crypto/conf/conf_api.c:31:5:
29. vv.section = (char *)section;
30. v = lh_CONF_VALUE_retrieve(conf->data, &vv);
31. > return v;
32. }
33.
crypto/conf/conf_api.c:32:1: return from a call to _CONF_get_section
30. v = lh_CONF_VALUE_retrieve(conf->data, &vv);
31. return v;
32. > }
33.
34. /* Up until OpenSSL 0.9.5a, this was CONF_get_section */
crypto/conf/conf_api.c:41:9: Taking false branch
39.
40. v = _CONF_get_section(conf, section);
41. if (v != NULL)
^
42. return ((STACK_OF(CONF_VALUE) *)v->value);
43. else
crypto/conf/conf_api.c:44:9:
42. return ((STACK_OF(CONF_VALUE) *)v->value);
43. else
44. > return NULL;
45. }
46.
crypto/conf/conf_api.c:45:1: return from a call to _CONF_get_section_values
43. else
44. return NULL;
45. > }
46.
47. int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value)
crypto/conf/conf_lib.c:257:1: return from a call to NCONF_get_section
255.
256. return _CONF_get_section_values(conf, section);
257. > }
258.
259. char *NCONF_get_string(const CONF *conf, const char *group, const char *name)
test/testutil/tests.c:228:1: start of procedure test_ptr()
226. }
227.
228. > int test_ptr(const char *file, int line, const char *s, const void *p)
229. {
230. if (p != NULL)
test/testutil/tests.c:230:9: Taking false branch
228. int test_ptr(const char *file, int line, const char *s, const void *p)
229. {
230. if (p != NULL)
^
231. return 1;
232. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
test/testutil/tests.c:232:5: Skipping test_fail_message(): empty list of specs
230. if (p != NULL)
231. return 1;
232. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
^
233. return 0;
234. }
test/testutil/tests.c:233:5:
231. return 1;
232. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
233. > return 0;
234. }
235.
test/testutil/tests.c:234:1: return from a call to test_ptr
232. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
233. return 0;
234. > }
235.
236. int test_true(const char *file, int line, const char *s, int b)
test/ssl_test_ctx.c:816:10: Taking true branch
814. size_t j;
815.
816. if (!TEST_ptr(sk_conf = NCONF_get_section(conf, test_section))
^
817. || !TEST_ptr(ctx = SSL_TEST_CTX_new()))
818. goto err;
test/ssl_test_ctx.c:867:2:
865. goto done;
866.
867. > err:
868. SSL_TEST_CTX_free(ctx);
869. ctx = NULL;
test/ssl_test_ctx.c:868:5:
866.
867. err:
868. > SSL_TEST_CTX_free(ctx);
869. ctx = NULL;
870. done:
|
https://github.com/openssl/openssl/blob/2b1aa1988189773497d6edba443cf77f5c31feba/test/ssl_test_ctx.c/#L868
|
d2a_code_trace_data_44796
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
crypto/dsa/dsa_ossl.c:354: error: INTEGER_OVERFLOW_L2
([0, +oo] - 1):unsigned32 by call to `BN_mod_inverse`.
Showing all 18 steps of the trace
crypto/dsa/dsa_ossl.c:354:7: Call
352. /* Calculate W = inv(S) mod Q
353. * save W in u2 */
354. if ((BN_mod_inverse(&u2,sig->s,dsa->q,ctx)) == NULL) goto err;
^
355.
356. /* save M in u1 */
crypto/bn/bn_gcd.c:209:1: Parameter `ctx->stack.depth`
207. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx);
208.
209. > BIGNUM *BN_mod_inverse(BIGNUM *in,
210. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx)
211. {
crypto/bn/bn_gcd.c:218:10: Call
216. if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0) || (BN_get_flags(n, BN_FLG_CONSTTIME) != 0))
217. {
218. return BN_mod_inverse_no_branch(in, a, n, ctx);
^
219. }
220.
crypto/bn/bn_gcd.c:507:1: Parameter `ctx->stack.depth`
505. * It does not contain branches that may leak sensitive information.
506. */
507. > static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
508. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx)
509. {
crypto/bn/bn_gcd.c:519:2: Call
517. bn_check_top(n);
518.
519. BN_CTX_start(ctx);
^
520. A = BN_CTX_get(ctx);
521. B = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:255:1: Parameter `ctx->stack.depth`
253. }
254.
255. > void BN_CTX_start(BN_CTX *ctx)
256. {
257. CTXDBG_ENTRY("BN_CTX_start", ctx);
crypto/bn/bn_gcd.c:548:8: Call
546. pB = &local_B;
547. BN_with_flags(pB, B, BN_FLG_CONSTTIME);
548. if (!BN_nnmod(B, pB, A, ctx)) goto err;
^
549. }
550. sign = -1;
crypto/bn/bn_mod.c:127:1: Parameter `ctx->stack.depth`
125.
126.
127. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx)
128. {
129. /* like BN_mod, but returns non-negative remainder
crypto/bn/bn_mod.c:132:8: Call
130. * (i.e., 0 <= r < |d| always holds) */
131.
132. if (!(BN_mod(r,m,d,ctx)))
^
133. return 0;
134. if (!r->neg)
crypto/bn/bn_div.c:181:1: Parameter `ctx->stack.depth`
179. * If 'dv' or 'rm' is NULL, the respective value is not returned.
180. */
181. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
182. BN_CTX *ctx)
183. {
crypto/bn/bn_div.c:226:2: Call
224. }
225.
226. BN_CTX_start(ctx);
^
227. tmp=BN_CTX_get(ctx);
228. snum=BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:255:1: Parameter `ctx->stack.depth`
253. }
254.
255. > void BN_CTX_start(BN_CTX *ctx)
256. {
257. CTXDBG_ENTRY("BN_CTX_start", ctx);
crypto/bn/bn_div.c:441:2: Call
439. }
440. if (no_branch) bn_correct_top(res);
441. BN_CTX_end(ctx);
^
442. return(1);
443. err:
crypto/bn/bn_ctx.c:270:1: Parameter `ctx->stack.depth`
268. }
269.
270. > void BN_CTX_end(BN_CTX *ctx)
271. {
272. CTXDBG_ENTRY("BN_CTX_end", ctx);
crypto/bn/bn_ctx.c:277:21: Call
275. else
276. {
277. unsigned int fp = BN_STACK_pop(&ctx->stack);
^
278. /* Does this stack frame have anything to release? */
279. if(fp < ctx->used)
crypto/bn/bn_ctx.c:351:1: <LHS trace>
349. }
350.
351. > static unsigned int BN_STACK_pop(BN_STACK *st)
352. {
353. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:351:1: Parameter `st->depth`
349. }
350.
351. > static unsigned int BN_STACK_pop(BN_STACK *st)
352. {
353. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:353:9: Binary operation: ([0, +oo] - 1):unsigned32 by call to `BN_mod_inverse`
351. static unsigned int BN_STACK_pop(BN_STACK *st)
352. {
353. return st->indexes[--(st->depth)];
^
354. }
355.
|
https://github.com/openssl/openssl/blob/4af793036f6ef4f0a1078e5d7155426a98d50e37/crypto/bn/bn_ctx.c/#L353
|
d2a_code_trace_data_44797
|
void avformat_free_context(AVFormatContext *s)
{
int i;
if (!s)
return;
av_opt_free(s);
if (s->iformat && s->iformat->priv_class && s->priv_data)
av_opt_free(s->priv_data);
for (i = 0; i < s->nb_streams; i++)
free_stream(&s->streams[i]);
for (i = s->nb_programs - 1; i >= 0; i--) {
av_dict_free(&s->programs[i]->metadata);
av_freep(&s->programs[i]->stream_index);
av_freep(&s->programs[i]);
}
av_freep(&s->programs);
av_freep(&s->priv_data);
while (s->nb_chapters--) {
av_dict_free(&s->chapters[s->nb_chapters]->metadata);
av_free(s->chapters[s->nb_chapters]);
}
av_freep(&s->chapters);
av_dict_free(&s->metadata);
av_freep(&s->streams);
av_freep(&s->internal);
av_free(s);
}
libavformat/hlsenc.c:329: error: Integer Overflow L1
([-oo, 0] - 1):unsigned32 by call to `avformat_free_context`.
libavformat/hlsenc.c:328:5: Call
326.
327. av_write_trailer(oc);
328. ff_format_io_close(s, &oc->pb);
^
329. avformat_free_context(oc);
330. av_free(hls->basename);
libavformat/utils.c:3184:5: Assignment
3182. if (*pb)
3183. s->io_close(s, *pb);
3184. *pb = NULL;
^
3185. }
libavformat/hlsenc.c:329:5: Call
327. av_write_trailer(oc);
328. ff_format_io_close(s, &oc->pb);
329. avformat_free_context(oc);
^
330. av_free(hls->basename);
331. append_entry(hls, hls->duration);
libavformat/utils.c:2477:1: <LHS trace>
2475. }
2476.
2477. void avformat_free_context(AVFormatContext *s)
^
2478. {
2479. int i;
libavformat/utils.c:2477:1: Parameter `s->nb_chapters`
2475. }
2476.
2477. void avformat_free_context(AVFormatContext *s)
^
2478. {
2479. int i;
libavformat/utils.c:2498:12: Binary operation: ([-oo, 0] - 1):unsigned32 by call to `avformat_free_context`
2496. av_freep(&s->programs);
2497. av_freep(&s->priv_data);
2498. while (s->nb_chapters--) {
^
2499. av_dict_free(&s->chapters[s->nb_chapters]->metadata);
2500. av_free(s->chapters[s->nb_chapters]);
|
https://github.com/libav/libav/blob/611ba89b896a5286b6d8ad9bfdbb8b4f5c11df9c/libavformat/utils.c/#L2498
|
d2a_code_trace_data_44798
|
int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
{
assert(pkt->subs != NULL && len != 0);
if (pkt->subs == NULL || len == 0)
return 0;
if (pkt->maxsize - pkt->written < len)
return 0;
if (pkt->buf->length - pkt->written < len) {
size_t newlen;
size_t reflen;
reflen = (len > pkt->buf->length) ? len : pkt->buf->length;
if (reflen > SIZE_MAX / 2) {
newlen = SIZE_MAX;
} else {
newlen = reflen * 2;
if (newlen < DEFAULT_BUF_SIZE)
newlen = DEFAULT_BUF_SIZE;
}
if (BUF_MEM_grow(pkt->buf, newlen) == 0)
return 0;
}
*allocbytes = (unsigned char *)pkt->buf->data + pkt->curr;
return 1;
}
ssl/t1_lib.c:1063: error: INTEGER_OVERFLOW_L2
([0, +oo] - [0, `s->s3->previous_client_finished_len` + `pkt->written` + 19]):unsigned64 by call to `WPACKET_sub_memcpy__`.
Showing all 14 steps of the trace
ssl/t1_lib.c:1062:21: Call
1060. /* Sub-packet for servername list (always 1 hostname)*/
1061. || !WPACKET_start_sub_packet_u16(pkt)
1062. || !WPACKET_put_bytes_u8(pkt, TLSEXT_NAMETYPE_host_name)
^
1063. || !WPACKET_sub_memcpy_u16(pkt, s->tlsext_hostname,
1064. strlen(s->tlsext_hostname))
ssl/packet.c:261:1: Parameter `pkt->buf->length`
259. }
260.
261. > int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size)
262. {
263. unsigned char *data;
ssl/t1_lib.c:1063:21: Call
1061. || !WPACKET_start_sub_packet_u16(pkt)
1062. || !WPACKET_put_bytes_u8(pkt, TLSEXT_NAMETYPE_host_name)
1063. || !WPACKET_sub_memcpy_u16(pkt, s->tlsext_hostname,
^
1064. strlen(s->tlsext_hostname))
1065. || !WPACKET_close(pkt)
ssl/packet.c: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] - [0, s->s3->previous_client_finished_len + pkt->written + 19]):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_44799
|
static int var_diamond_search(MpegEncContext * s, int *best, int dmin,
int src_index, int ref_index, int const penalty_factor,
int size, int h, int flags)
{
MotionEstContext * const c= &s->me;
me_cmp_func cmpf, chroma_cmpf;
int dia_size;
LOAD_COMMON
LOAD_COMMON2
int map_generation= c->map_generation;
cmpf= s->dsp.me_cmp[size];
chroma_cmpf= s->dsp.me_cmp[size+1];
for(dia_size=1; dia_size<=c->dia_size; dia_size++){
int dir, start, end;
const int x= best[0];
const int y= best[1];
start= FFMAX(0, y + dia_size - ymax);
end = FFMIN(dia_size, xmax - x + 1);
for(dir= start; dir<end; dir++){
int d;
CHECK_MV(x + dir , y + dia_size - dir);
}
start= FFMAX(0, x + dia_size - xmax);
end = FFMIN(dia_size, y - ymin + 1);
for(dir= start; dir<end; dir++){
int d;
CHECK_MV(x + dia_size - dir, y - dir );
}
start= FFMAX(0, -y + dia_size + ymin );
end = FFMIN(dia_size, x - xmin + 1);
for(dir= start; dir<end; dir++){
int d;
CHECK_MV(x - dir , y - dia_size + dir);
}
start= FFMAX(0, -x + dia_size + xmin );
end = FFMIN(dia_size, ymax - y + 1);
for(dir= start; dir<end; dir++){
int d;
CHECK_MV(x - dia_size + dir, y + dir );
}
if(x!=best[0] || y!=best[1])
dia_size=0;
#if 0
{
int dx, dy, i;
static int stats[8*8];
dx= FFABS(x-best[0]);
dy= FFABS(y-best[1]);
stats[dy*8 + dx] ++;
if(256*256*256*64 % (stats[0]+1)==0){
for(i=0; i<64; i++){
if((i&7)==0) printf("\n");
printf("%6d ", stats[i]);
}
printf("\n");
}
}
#endif
}
return dmin;
}
libavcodec/motion_est_template.c:942: error: Uninitialized Value
The value read from xmin was never initialized.
libavcodec/motion_est_template.c:942:16:
940. }
941.
942. start= FFMAX(0, -x + dia_size + xmin );
^
943. end = FFMIN(dia_size, ymax - y + 1);
944. for(dir= start; dir<end; dir++){
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L942
|
d2a_code_trace_data_44800
|
static int read_old_huffman_tables(HYuvContext *s){
#if 1
GetBitContext gb;
int i;
init_get_bits(&gb, classic_shift_luma, sizeof(classic_shift_luma)*8);
read_len_table(s->len[0], &gb);
init_get_bits(&gb, classic_shift_chroma, sizeof(classic_shift_chroma)*8);
read_len_table(s->len[1], &gb);
for(i=0; i<256; i++) s->bits[0][i] = classic_add_luma [i];
for(i=0; i<256; i++) s->bits[1][i] = classic_add_chroma[i];
if(s->bitstream_bpp >= 24){
memcpy(s->bits[1], s->bits[0], 256*sizeof(uint32_t));
memcpy(s->len[1] , s->len [0], 256*sizeof(uint8_t));
}
memcpy(s->bits[2], s->bits[1], 256*sizeof(uint32_t));
memcpy(s->len[2] , s->len [1], 256*sizeof(uint8_t));
for(i=0; i<3; i++){
free_vlc(&s->vlc[i]);
init_vlc(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1, s->bits[i], 4, 4, 0);
}
generate_joint_tables(s);
return 0;
#else
av_log(s->avctx, AV_LOG_DEBUG, "v1 huffyuv is not supported \n");
return -1;
#endif
}
libavcodec/huffyuv.c:431: error: Buffer Overrun L3
Offset added: 1024 Size: [0, +oo].
libavcodec/huffyuv.c:417:1: <Length trace>
415. }
416.
417. static int read_old_huffman_tables(HYuvContext *s){
^
418. #if 1
419. GetBitContext gb;
libavcodec/huffyuv.c:417:1: Parameter `s->bits[*][*]`
415. }
416.
417. static int read_old_huffman_tables(HYuvContext *s){
^
418. #if 1
419. GetBitContext gb;
libavcodec/huffyuv.c:431:9: Array access: Offset added: 1024 Size: [0, +oo]
429.
430. if(s->bitstream_bpp >= 24){
431. memcpy(s->bits[1], s->bits[0], 256*sizeof(uint32_t));
^
432. memcpy(s->len[1] , s->len [0], 256*sizeof(uint8_t));
433. }
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/huffyuv.c/#L431
|
d2a_code_trace_data_44801
|
static int opt_vstats(const char *opt, const char *arg)
{
char filename[40];
time_t today2 = time(NULL);
struct tm *today = localtime(&today2);
snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min,
today->tm_sec);
return opt_vstats_file(opt, filename);
}
avconv.c:4755: error: Null Dereference
pointer `today` last assigned on line 4753 could be null and is dereferenced at line 4755, column 69.
avconv.c:4749:1: start of procedure opt_vstats()
4747. }
4748.
4749. static int opt_vstats(const char *opt, const char *arg)
^
4750. {
4751. char filename[40];
avconv.c:4752:5:
4750. {
4751. char filename[40];
4752. time_t today2 = time(NULL);
^
4753. struct tm *today = localtime(&today2);
4754.
avconv.c:4753:5:
4751. char filename[40];
4752. time_t today2 = time(NULL);
4753. struct tm *today = localtime(&today2);
^
4754.
4755. snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min,
avconv.c:4755:5:
4753. struct tm *today = localtime(&today2);
4754.
4755. snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min,
^
4756. today->tm_sec);
4757. return opt_vstats_file(opt, filename);
|
https://github.com/libav/libav/blob/89605e4aa018f75fef1de531449383b0e9d1bfe1/avconv.c/#L4755
|
d2a_code_trace_data_44802
|
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:1081: 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_srvr.c:1080:10: Call
1078. }
1079.
1080. if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_encrypt_then_mac)
^
1081. || !WPACKET_put_bytes_u16(pkt, 0)) {
1082. SSLerr(SSL_F_TLS_CONSTRUCT_STOC_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_srvr.c:1081:17: Call
1079.
1080. if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_encrypt_then_mac)
1081. || !WPACKET_put_bytes_u16(pkt, 0)) {
^
1082. SSLerr(SSL_F_TLS_CONSTRUCT_STOC_ETM, ERR_R_INTERNAL_ERROR);
1083. 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_44803
|
static int
TIFFStartTile(TIFF* tif, uint32 tile)
{
TIFFDirectory *td = &tif->tif_dir;
if ((tif->tif_flags & TIFF_CODERSETUP) == 0) {
if (!(*tif->tif_setupdecode)(tif))
return (0);
tif->tif_flags |= TIFF_CODERSETUP;
}
tif->tif_curtile = tile;
tif->tif_row =
(tile % TIFFhowmany_32(td->td_imagewidth, td->td_tilewidth)) *
td->td_tilelength;
tif->tif_col =
(tile % TIFFhowmany_32(td->td_imagelength, td->td_tilelength)) *
td->td_tilewidth;
tif->tif_flags &= ~TIFF_BUF4WRITE;
if (tif->tif_flags&TIFF_NOREADRAW)
{
tif->tif_rawcp = NULL;
tif->tif_rawcc = 0;
}
else
{
tif->tif_rawcp = tif->tif_rawdata;
tif->tif_rawcc = (tmsize_t)td->td_stripbytecount[tile];
}
return ((*tif->tif_predecode)(tif,
(uint16)(tile/td->td_stripsperimage)));
}
tools/tiffcrop.c:809: error: Integer Overflow L2
([0, `in->tif_dir.td_tilewidth`] - 1):unsigned32 by call to `TIFFReadTile`.
tools/tiffcrop.c:779:1: Parameter `in->tif_dir.td_tilewidth`
777. }
778.
779. static int readSeparateTilesIntoBuffer (TIFF* in, uint8 *buf,
^
780. uint32 imagelength, uint32 imagewidth, uint16 spp)
781. {
tools/tiffcrop.c:784:17: Call
782. int status = 1;
783. uint32 imagew = TIFFRasterScanlineSize(in);
784. uint32 tilew = TIFFTileRowSize(in);
^
785. int iskew = imagew - tilew*spp;
786. tdata_t tilebuf = _TIFFmalloc(TIFFTileSize(in));
libtiff/tif_tile.c:184:1: Parameter `tif->tif_dir.td_tilewidth`
182. return (TIFFhowmany8_64(rowsize));
183. }
184. tmsize_t
^
185. TIFFTileRowSize(TIFF* tif)
186. {
libtiff/tif_tile.c:190:4: Call
188. uint64 m;
189. tmsize_t n;
190. m=TIFFTileRowSize64(tif);
^
191. n=(tmsize_t)m;
192. if ((uint64)n!=m)
libtiff/tif_tile.c:169:1: Parameter `tif->tif_dir.td_tilewidth`
167. * Compute the # bytes in each row of a tile.
168. */
169. uint64
^
170. TIFFTileRowSize64(TIFF* tif)
171. {
tools/tiffcrop.c:786:32: Call
784. uint32 tilew = TIFFTileRowSize(in);
785. int iskew = imagew - tilew*spp;
786. tdata_t tilebuf = _TIFFmalloc(TIFFTileSize(in));
^
787. uint8* bufp = (uint8*) buf;
788. uint32 tw, tl;
libtiff/tif_tile.c:274:1: Parameter `tif->tif_dir.td_tilewidth`
272. return (TIFFVTileSize64(tif, tif->tif_dir.td_tilelength));
273. }
274. tmsize_t
^
275. TIFFTileSize(TIFF* tif)
276. {
libtiff/tif_tile.c:280:4: Call
278. uint64 m;
279. tmsize_t n;
280. m=TIFFTileSize64(tif);
^
281. n=(tmsize_t)m;
282. if ((uint64)n!=m)
libtiff/tif_tile.c:269:1: Parameter `tif->tif_dir.td_tilewidth`
267. * Compute the # bytes in a row-aligned tile.
268. */
269. uint64
^
270. TIFFTileSize64(TIFF* tif)
271. {
libtiff/tif_tile.c:272:10: Call
270. TIFFTileSize64(TIFF* tif)
271. {
272. return (TIFFVTileSize64(tif, tif->tif_dir.td_tilelength));
^
273. }
274. tmsize_t
libtiff/tif_tile.c:203:1: Parameter `tif->tif_dir.td_tilewidth`
201. * Compute the # bytes in a variable length, row-aligned tile.
202. */
203. uint64
^
204. TIFFVTileSize64(TIFF* tif, uint32 nrows)
205. {
tools/tiffcrop.c:809:9: Call
807.
808. for (s = 0; s < spp; s++) {
809. if (TIFFReadTile(in, tilebuf, col, row, 0, s) < 0
^
810. && !ignore) {
811. TIFFError(TIFFFileName(in),
libtiff/tif_read.c:415:1: Parameter `tif->tif_dir.td_tilewidth`
413. * tile is selected by the (x,y,z,s) coordinates.
414. */
415. tmsize_t
^
416. TIFFReadTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s)
417. {
libtiff/tif_read.c:420:10: Call
418. if (!TIFFCheckRead(tif, 1) || !TIFFCheckTile(tif, x, y, z, s))
419. return ((tmsize_t)(-1));
420. return (TIFFReadEncodedTile(tif,
^
421. TIFFComputeTile(tif, x, y, z, s), buf, (tmsize_t)(-1)));
422. }
libtiff/tif_read.c:428:1: Parameter `tif->tif_dir.td_tilewidth`
426. * amount into the user-supplied buffer.
427. */
428. tmsize_t
^
429. TIFFReadEncodedTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size)
430. {
libtiff/tif_read.c:447:6: Call
445. else if (size > tilesize)
446. size = tilesize;
447. if (TIFFFillTile(tif, tile) && (*tif->tif_decodetile)(tif,
^
448. (uint8*) buf, size, (uint16)(tile/td->td_stripsperimage))) {
449. (*tif->tif_postdecode)(tif, (uint8*) buf, size);
libtiff/tif_read.c:568:1: Parameter `tif->tif_dir.td_tilewidth`
566. * expanded, as necessary, to hold the tile's data.
567. */
568. int
^
569. TIFFFillTile(TIFF* tif, uint32 tile)
570. {
libtiff/tif_read.c:657:10: Call
655. }
656. }
657. return (TIFFStartTile(tif, tile));
^
658. }
659.
libtiff/tif_read.c:737:1: <LHS trace>
735. * tile has just been read in.
736. */
737. static int
^
738. TIFFStartTile(TIFF* tif, uint32 tile)
739. {
libtiff/tif_read.c:737:1: Parameter `tif->tif_dir.td_tilewidth`
735. * tile has just been read in.
736. */
737. static int
^
738. TIFFStartTile(TIFF* tif, uint32 tile)
739. {
libtiff/tif_read.c:748:2: Binary operation: ([0, in->tif_dir.td_tilewidth] - 1):unsigned32 by call to `TIFFReadTile`
746. }
747. tif->tif_curtile = tile;
748. tif->tif_row =
^
749. (tile % TIFFhowmany_32(td->td_imagewidth, td->td_tilewidth)) *
750. td->td_tilelength;
|
https://gitlab.com/libtiff/libtiff/blob/771a4ea0a98c7a218c9f3add9a05e08d29625758/libtiff/tif_read.c/#L748
|
d2a_code_trace_data_44804
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
crypto/ec/ecdsa_ossl.c:449: error: INTEGER_OVERFLOW_L2
([0, +oo] - 1):unsigned32 by call to `BN_mod_mul`.
Showing all 16 steps of the trace
crypto/ec/ecdsa_ossl.c:399:5: Call
397. return -1;
398. }
399. BN_CTX_start(ctx);
^
400. u1 = BN_CTX_get(ctx);
401. u2 = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:235:1: Parameter `ctx->stack.depth`
233. }
234.
235. > void BN_CTX_start(BN_CTX *ctx)
236. {
237. CTXDBG_ENTRY("BN_CTX_start", ctx);
crypto/ec/ecdsa_ossl.c:449:10: Call
447. }
448. /* u2 = r * w mod q */
449. if (!BN_mod_mul(u2, sig->r, u2, order, ctx)) {
^
450. ECerr(EC_F_OSSL_ECDSA_VERIFY_SIG, ERR_R_BN_LIB);
451. goto err;
crypto/bn/bn_mod.c:178:1: Parameter `ctx->stack.depth`
176.
177. /* slow but works */
178. > int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,
179. BN_CTX *ctx)
180. {
crypto/bn/bn_mod.c:188:5: Call
186. bn_check_top(m);
187.
188. BN_CTX_start(ctx);
^
189. if ((t = BN_CTX_get(ctx)) == NULL)
190. goto err;
crypto/bn/bn_ctx.c:235:1: Parameter `ctx->stack.depth`
233. }
234.
235. > void BN_CTX_start(BN_CTX *ctx)
236. {
237. CTXDBG_ENTRY("BN_CTX_start", ctx);
crypto/bn/bn_mod.c:195:14: Call
193. goto err;
194. } else {
195. if (!BN_mul(t, a, b, ctx))
^
196. goto err;
197. }
crypto/bn/bn_mul.c:882:1: Parameter `ctx->stack.depth`
880. #endif /* BN_RECURSION */
881.
882. > int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
883. {
884. int ret = 0;
crypto/bn/bn_mul.c:908:5: Call
906. top = al + bl;
907.
908. BN_CTX_start(ctx);
^
909. if ((r == a) || (r == b)) {
910. if ((rr = BN_CTX_get(ctx)) == NULL)
crypto/bn/bn_ctx.c:235:1: Parameter `ctx->stack.depth`
233. }
234.
235. > void BN_CTX_start(BN_CTX *ctx)
236. {
237. CTXDBG_ENTRY("BN_CTX_start", ctx);
crypto/bn/bn_mul.c:1032:5: Call
1030. err:
1031. bn_check_top(r);
1032. BN_CTX_end(ctx);
^
1033. return (ret);
1034. }
crypto/bn/bn_ctx.c:249:1: Parameter `ctx->stack.depth`
247. }
248.
249. > void BN_CTX_end(BN_CTX *ctx)
250. {
251. CTXDBG_ENTRY("BN_CTX_end", ctx);
crypto/bn/bn_ctx.c:255:27: Call
253. ctx->err_stack--;
254. else {
255. unsigned int fp = BN_STACK_pop(&ctx->stack);
^
256. /* Does this stack frame have anything to release? */
257. if (fp < ctx->used)
crypto/bn/bn_ctx.c:325:1: <LHS trace>
323. }
324.
325. > static unsigned int BN_STACK_pop(BN_STACK *st)
326. {
327. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:325:1: Parameter `st->depth`
323. }
324.
325. > static unsigned int BN_STACK_pop(BN_STACK *st)
326. {
327. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:327:12: Binary operation: ([0, +oo] - 1):unsigned32 by call to `BN_mod_mul`
325. static unsigned int BN_STACK_pop(BN_STACK *st)
326. {
327. return st->indexes[--(st->depth)];
^
328. }
329.
|
https://github.com/openssl/openssl/blob/be2e334fce734e726a4085701bc3cbbaabf9d893/crypto/bn/bn_ctx.c/#L327
|
d2a_code_trace_data_44805
|
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: [48+min(0, `c->synth_buf_offset[*]`), 49+max(511, `c->synth_buf_offset[*]`)] Size: 2 by call to `ff_mpa_synth_filter`.
libavcodec/mpc.c:51:1: Parameter `c->synth_buf[*]`
49. * Process decoded Musepack data and produce PCM
50. */
51. static void mpc_synth(MPCContext *c, int16_t *out)
^
52. {
53. int dither_state = 0;
libavcodec/mpc.c:60:13: Call
58. samples_ptr = samples + ch;
59. for(i = 0; i < SAMPLES_PER_BAND; i++) {
60. ff_mpa_synth_filter(c->synth_buf[ch], &(c->synth_buf_offset[ch]),
^
61. mpa_window, &dither_state,
62. samples_ptr, 2,
libavcodec/mpegaudiodec.c:858:1: <Length trace>
856. 32 samples. */
857. /* XXX: optimize by avoiding ring buffer usage */
858. void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
^
859. MPA_INT *window, int *dither_state,
860. OUT_INT *samples, int incr,
libavcodec/mpegaudiodec.c:858:1: Parameter `*synth_buf_ptr`
856. 32 samples. */
857. /* XXX: optimize by avoiding ring buffer usage */
858. void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
^
859. MPA_INT *window, int *dither_state,
860. OUT_INT *samples, int incr,
libavcodec/mpegaudiodec.c:877:5: Assignment
875.
876. offset = *synth_buf_offset;
877. synth_buf = synth_buf_ptr + offset;
^
878.
879. for(j=0;j<32;j++) {
libavcodec/mpegaudiodec.c:898:5: Assignment
896. p = synth_buf + 16;
897. SUM8(sum, +=, w, p);
898. p = synth_buf + 48;
^
899. SUM8(sum, -=, w + 32, p);
900. *samples = round_sample(&sum);
libavcodec/mpegaudiodec.c:899:5: Array access: Offset: [48+min(0, c->synth_buf_offset[*]), 49+max(511, c->synth_buf_offset[*])] Size: 2 by call to `ff_mpa_synth_filter`
897. SUM8(sum, +=, w, p);
898. p = synth_buf + 48;
899. SUM8(sum, -=, w + 32, p);
^
900. *samples = round_sample(&sum);
901. samples += incr;
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/mpegaudiodec.c/#L899
|
d2a_code_trace_data_44806
|
int ssl_security_cert_chain(SSL *s, STACK_OF(X509) *sk, X509 *x, int vfy)
{
int rv, start_idx, i;
if (x == NULL) {
x = sk_X509_value(sk, 0);
start_idx = 1;
} else
start_idx = 0;
rv = ssl_security_cert(s, NULL, x, vfy, 1);
if (rv != 1)
return rv;
for (i = start_idx; i < sk_X509_num(sk); i++) {
x = sk_X509_value(sk, i);
rv = ssl_security_cert(s, NULL, x, vfy, 0);
if (rv != 1)
return rv;
}
return 1;
}
ssl/t1_lib.c:4049: error: NULL_DEREFERENCE
pointer `null` is dereferenced by call to `ssl_security_cert()` at line 4049, column 10.
Showing all 11 steps of the trace
ssl/t1_lib.c:4040:1: start of procedure ssl_security_cert_chain()
4038. */
4039.
4040. > int ssl_security_cert_chain(SSL *s, STACK_OF(X509) *sk, X509 *x, int vfy)
4041. {
4042. int rv, start_idx, i;
ssl/t1_lib.c:4043:9: Taking true branch
4041. {
4042. int rv, start_idx, i;
4043. if (x == NULL) {
^
4044. x = sk_X509_value(sk, 0);
4045. start_idx = 1;
ssl/t1_lib.c:4044:9:
4042. int rv, start_idx, i;
4043. if (x == NULL) {
4044. > x = sk_X509_value(sk, 0);
4045. start_idx = 1;
4046. } else
include/openssl/x509.h:97:1: start of procedure sk_X509_value()
95. typedef struct x509_cinf_st X509_CINF;
96.
97. > DEFINE_STACK_OF(X509)
98.
99. /* This is used for a table of trust checking functions */
crypto/stack/stack.c:284:1: start of procedure OPENSSL_sk_value()
282. }
283.
284. > void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
285. {
286. if (st == NULL || i < 0 || i >= st->num)
crypto/stack/stack.c:286:9: Taking true branch
284. void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
285. {
286. if (st == NULL || i < 0 || i >= st->num)
^
287. return NULL;
288. return (void *)st->data[i];
crypto/stack/stack.c:287:9:
285. {
286. if (st == NULL || i < 0 || i >= st->num)
287. > return NULL;
288. return (void *)st->data[i];
289. }
crypto/stack/stack.c:289:1: return from a call to OPENSSL_sk_value
287. return NULL;
288. return (void *)st->data[i];
289. > }
290.
291. void *OPENSSL_sk_set(OPENSSL_STACK *st, int i, const void *data)
include/openssl/x509.h:97:1: return from a call to sk_X509_value
95. typedef struct x509_cinf_st X509_CINF;
96.
97. > DEFINE_STACK_OF(X509)
98.
99. /* This is used for a table of trust checking functions */
ssl/t1_lib.c:4045:9:
4043. if (x == NULL) {
4044. x = sk_X509_value(sk, 0);
4045. > start_idx = 1;
4046. } else
4047. start_idx = 0;
ssl/t1_lib.c:4049:5:
4047. start_idx = 0;
4048.
4049. > rv = ssl_security_cert(s, NULL, x, vfy, 1);
4050. if (rv != 1)
4051. return rv;
|
https://github.com/openssl/openssl/blob/a1f2b0e6e07a53c0ae2c81cba319b90e54210cd6/ssl/t1_lib.c/#L4049
|
d2a_code_trace_data_44807
|
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/prime.c:124: error: BUFFER_OVERRUN_L3
Offset: [16, +oo] (⇐ 1 + [15, +oo]) Size: [0, 8388607] by call to `BN_is_prime_ex`.
Showing all 51 steps of the trace
apps/prime.c:112:21: Call
110.
111. if (hex)
112. r = BN_hex2bn(&bn, argv[0]);
^
113. else
114. r = BN_dec2bn(&bn, argv[0]);
crypto/bn/bn_print.c:126:1: Parameter `(*bn)->top`
124. }
125.
126. > int BN_hex2bn(BIGNUM **bn, const char *a)
127. {
128. BIGNUM *ret = NULL;
apps/prime.c:124:24: Call
122. BIO_printf(bio_out, " (%s) %s prime\n",
123. argv[0],
124. BN_is_prime_ex(bn, checks, NULL, NULL)
^
125. ? "is" : "is not");
126. }
crypto/bn/bn_prime.c:145:1: Parameter `a->top`
143. }
144.
145. > int BN_is_prime_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed,
146. BN_GENCB *cb)
147. {
crypto/bn/bn_prime.c:148:12: Call
146. BN_GENCB *cb)
147. {
148. return BN_is_prime_fasttest_ex(a, checks, ctx_passed, 0, cb);
^
149. }
150.
crypto/bn/bn_prime.c:151:1: Parameter `a->top`
149. }
150.
151. > int BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed,
152. int do_trial_division, BN_GENCB *cb)
153. {
crypto/bn/bn_prime.c:161:9: Call
159.
160. /* Take care of the really small primes 2 & 3 */
161. if (BN_is_word(a, 2) || BN_is_word(a, 3))
^
162. return 1;
163.
crypto/bn/bn_lib.c:855:1: Parameter `a->top`
853. }
854.
855. > int BN_is_word(const BIGNUM *a, const BN_ULONG w)
856. {
857. return BN_abs_is_word(a, w) && (!w || !a->neg);
crypto/bn/bn_lib.c:857:12: Call
855. int BN_is_word(const BIGNUM *a, const BN_ULONG w)
856. {
857. return BN_abs_is_word(a, w) && (!w || !a->neg);
^
858. }
859.
crypto/bn/bn_lib.c:840:1: Parameter `a->top`
838. }
839.
840. > int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w)
841. {
842. return ((a->top == 1) && (a->d[0] == w)) || ((w == 0) && (a->top == 0));
crypto/bn/bn_prime.c:161:29: Call
159.
160. /* Take care of the really small primes 2 & 3 */
161. if (BN_is_word(a, 2) || BN_is_word(a, 3))
^
162. return 1;
163.
crypto/bn/bn_lib.c:855:1: Parameter `a->top`
853. }
854.
855. > int BN_is_word(const BIGNUM *a, const BN_ULONG w)
856. {
857. return BN_abs_is_word(a, w) && (!w || !a->neg);
crypto/bn/bn_lib.c:857:12: Call
855. int BN_is_word(const BIGNUM *a, const BN_ULONG w)
856. {
857. return BN_abs_is_word(a, w) && (!w || !a->neg);
^
858. }
859.
crypto/bn/bn_lib.c:840:1: Parameter `a->top`
838. }
839.
840. > int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w)
841. {
842. return ((a->top == 1) && (a->d[0] == w)) || ((w == 0) && (a->top == 0));
crypto/bn/bn_prime.c:165:10: Call
163.
164. /* Check odd and bigger than 1 */
165. if (!BN_is_odd(a) || BN_cmp(a, BN_value_one()) <= 0)
^
166. return 0;
167.
crypto/bn/bn_lib.c:860:1: Parameter `a->top`
858. }
859.
860. > int BN_is_odd(const BIGNUM *a)
861. {
862. return (a->top > 0) && (a->d[0] & 1);
crypto/bn/bn_prime.c:165:26: Call
163.
164. /* Check odd and bigger than 1 */
165. if (!BN_is_odd(a) || BN_cmp(a, BN_value_one()) <= 0)
^
166. return 0;
167.
crypto/bn/bn_lib.c:542:1: Parameter `a->top`
540. }
541.
542. > int BN_cmp(const BIGNUM *a, const BIGNUM *b)
543. {
544. int i;
crypto/bn/bn_prime.c:198:10: Call
196.
197. /* compute A1 := a - 1 */
198. if (!BN_copy(A1, a) || !BN_sub_word(A1, 1))
^
199. goto err;
200. /* compute A3 := a - 3 */
crypto/bn/bn_lib.c:285:1: Parameter `b->top`
283. }
284.
285. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
286. {
287. bn_check_top(b);
crypto/bn/bn_prime.c:201:10: Call
199. goto err;
200. /* compute A3 := a - 3 */
201. if (!BN_copy(A3, a) || !BN_sub_word(A3, 3))
^
202. goto err;
203.
crypto/bn/bn_lib.c:285:1: Parameter `b->top`
283. }
284.
285. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
286. {
287. bn_check_top(b);
crypto/bn/bn_prime.c:215:10: Call
213. if (mont == NULL)
214. goto err;
215. if (!BN_MONT_CTX_set(mont, a, ctx))
^
216. goto err;
217.
crypto/bn/bn_mont.c:238:9: Call
236. BIGNUM *Ri, *R;
237.
238. if (BN_is_zero(mod))
^
239. return 0;
240.
crypto/bn/bn_lib.c:845:1: Parameter `a->top`
843. }
844.
845. > int BN_is_zero(const BIGNUM *a)
846. {
847. return a->top == 0;
crypto/bn/bn_prime.c:223:13: Call
221. goto err;
222.
223. j = witness(check, a, A1, A1_odd, k, ctx, mont);
^
224. if (j == -1)
225. goto err;
crypto/bn/bn_prime.c:245:1: Parameter `a->top`
243. }
244.
245. > static int witness(BIGNUM *w, const BIGNUM *a, const BIGNUM *a1,
246. const BIGNUM *a1_odd, int k, BN_CTX *ctx,
247. BN_MONT_CTX *mont)
crypto/bn/bn_prime.c:249:10: Call
247. BN_MONT_CTX *mont)
248. {
249. if (!BN_mod_exp_mont(w, w, a1_odd, a, ctx, mont)) /* w := w^a1_odd mod a */
^
250. return -1;
251. if (BN_is_one(w))
crypto/bn/bn_exp.c:296:1: Parameter `m->top`
294. }
295.
296. > int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
297. const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
298. {
crypto/bn/bn_exp.c:310:16: Call
308. || BN_get_flags(a, BN_FLG_CONSTTIME) != 0
309. || BN_get_flags(m, BN_FLG_CONSTTIME) != 0) {
310. return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont);
^
311. }
312.
crypto/bn/bn_exp.c:745:14: Assignment
743. /* 2^(top*BN_BITS2) - m */
744. tmp.d[0] = (0 - m->d[0]) & BN_MASK2;
745. for (i = 1; i < top; i++)
^
746. tmp.d[i] = (~m->d[i]) & BN_MASK2;
747. tmp.top = top;
crypto/bn/bn_exp.c:1062:14: Call
1060. bits -= window0;
1061. wvalue = bn_get_bits(p, bits) & wmask;
1062. if (!MOD_EXP_CTIME_COPY_FROM_PREBUF(&tmp, top, powerbuf, wvalue,
^
1063. window))
1064. goto err;
crypto/bn/bn_exp.c:520:1: Parameter `top`
518. }
519.
520. > static int MOD_EXP_CTIME_COPY_FROM_PREBUF(BIGNUM *b, int top,
521. unsigned char *buf, int idx,
522. int window)
crypto/bn/bn_exp.c:577:5: Assignment
575. }
576.
577. b->top = top;
^
578. bn_correct_top(b);
579. return 1;
crypto/bn/bn_exp.c:578:5: Call
576.
577. b->top = top;
578. bn_correct_top(b);
^
579. return 1;
580. }
crypto/bn/bn_lib.c:946:1: Parameter `a->top`
944. }
945.
946. > void bn_correct_top(BIGNUM *a)
947. {
948. BN_ULONG *ftl;
crypto/bn/bn_exp.c:1075:22: Call
1073. /* Square the result window-size times */
1074. for (i = 0; i < window; i++)
1075. if (!BN_mod_mul_montgomery(&tmp, &tmp, &tmp, mont, ctx))
^
1076. goto err;
1077.
crypto/bn/bn_mont.c:26:1: Parameter `a->top`
24. #endif
25.
26. > int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
27. BN_MONT_CTX *mont, BN_CTX *ctx)
28. {
crypto/bn/bn_mont.c:53:14: Call
51. bn_check_top(tmp);
52. if (a == b) {
53. if (!BN_sqr(tmp, a, ctx))
^
54. goto err;
55. } else {
crypto/bn/bn_sqr.c:17:1: Parameter `a->top`
15. * I've just gone over this and it is now %20 faster on x86 - eay - 27 Jun 96
16. */
17. > int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx)
18. {
19. int max, al;
crypto/bn/bn_sqr.c:25:5: Assignment
23. bn_check_top(a);
24.
25. al = a->top;
^
26. if (al <= 0) {
27. r->top = 0;
crypto/bn/bn_sqr.c:74:17: Call
72. if (bn_wexpand(tmp, max) == NULL)
73. goto err;
74. bn_sqr_normal(rr->d, a->d, al, tmp->d);
^
75. }
76. }
crypto/bn/bn_sqr.c:105:1: <Offset trace>
103.
104. /* tmp must have 2*n words */
105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
106. {
107. int i, j, max;
crypto/bn/bn_sqr.c:105:1: Parameter `n`
103.
104. /* tmp must have 2*n words */
105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
106. {
107. int i, j, max;
crypto/bn/bn_sqr.c:116:5: Assignment
114. rp[0] = rp[max - 1] = 0;
115. rp++;
116. j = n;
^
117.
118. if (--j > 0) {
crypto/bn/bn_sqr.c:118:9: Assignment
116. j = n;
117.
118. if (--j > 0) {
^
119. ap++;
120. rp[j] = bn_mul_words(rp, ap, j, ap[-1]);
crypto/bn/bn_sqr.c:105:1: <Length trace>
103.
104. /* tmp must have 2*n words */
105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
106. {
107. int i, j, max;
crypto/bn/bn_sqr.c:105:1: Parameter `*r`
103.
104. /* tmp must have 2*n words */
105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
106. {
107. int i, j, max;
crypto/bn/bn_sqr.c:113:5: Assignment
111. max = n * 2;
112. ap = a;
113. rp = r;
^
114. rp[0] = rp[max - 1] = 0;
115. rp++;
crypto/bn/bn_sqr.c:115:5: Assignment
113. rp = r;
114. rp[0] = rp[max - 1] = 0;
115. rp++;
^
116. j = n;
117.
crypto/bn/bn_sqr.c:120:9: Array access: Offset: [16, +oo] (⇐ 1 + [15, +oo]) Size: [0, 8388607] by call to `BN_is_prime_ex`
118. if (--j > 0) {
119. ap++;
120. rp[j] = bn_mul_words(rp, ap, j, ap[-1]);
^
121. rp += 2;
122. }
|
https://github.com/openssl/openssl/blob/b48d4397b8ee4256f0b0a115eb99f27ae89995e0/crypto/bn/bn_sqr.c/#L120
|
d2a_code_trace_data_44808
|
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:133: 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:133:9: Call
131. break;
132. default:
133. BIO_snprintf(p, p_maxlen, "bio callback - unknown type (%d)\n", cmd);
^
134. break;
135. }
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_44809
|
void CRYPTO_free(void *str)
{
#ifndef OPENSSL_NO_CRYPTO_MDEBUG
if (call_malloc_debug) {
CRYPTO_mem_debug_free(str, 0);
free(str);
CRYPTO_mem_debug_free(str, 1);
} else {
free(str);
}
#else
free(str);
#endif
}
crypto/stack/stack.c:107: error: USE_AFTER_FREE
call to `sk_free()` eventually accesses memory that was invalidated by call to `free()` on line 94 indirectly during the call to `CRYPTO_realloc()`.
Showing all 14 steps of the trace
crypto/stack/stack.c:92:10: invalidation part of the trace starts here
90. char **s;
91.
92. if ((ret = sk_new(sk->comp)) == NULL)
^
93. goto err;
94. s = OPENSSL_realloc((char *)ret->data,
crypto/stack/stack.c:92:10: assigned
90. char **s;
91.
92. if ((ret = sk_new(sk->comp)) == NULL)
^
93. goto err;
94. s = OPENSSL_realloc((char *)ret->data,
crypto/stack/stack.c:94:9: when calling `CRYPTO_realloc` here
92. if ((ret = sk_new(sk->comp)) == NULL)
93. goto err;
94. s = OPENSSL_realloc((char *)ret->data,
^
95. (unsigned int)sizeof(char *) * sk->num_alloc);
96. if (s == NULL)
crypto/mem.c:166:1: parameter `str` of CRYPTO_realloc
164. }
165.
166. > void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
167. {
168. if (str == NULL)
crypto/mem.c:172:9: when calling `CRYPTO_free` here
170.
171. if (num == 0) {
172. CRYPTO_free(str);
^
173. return NULL;
174. }
crypto/mem.c:234:1: parameter `str` of CRYPTO_free
232. }
233.
234. > void CRYPTO_free(void *str)
235. {
236. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
crypto/mem.c:245:5: was invalidated by call to `free()`
243. }
244. #else
245. free(str);
^
246. #endif
247. }
crypto/stack/stack.c:92:10: use-after-lifetime part of the trace starts here
90. char **s;
91.
92. if ((ret = sk_new(sk->comp)) == NULL)
^
93. goto err;
94. s = OPENSSL_realloc((char *)ret->data,
crypto/stack/stack.c:92:10: assigned
90. char **s;
91.
92. if ((ret = sk_new(sk->comp)) == NULL)
^
93. goto err;
94. s = OPENSSL_realloc((char *)ret->data,
crypto/stack/stack.c:107:5: when calling `sk_free` here
105. return (ret);
106. err:
107. sk_free(ret);
^
108. return (NULL);
109. }
crypto/stack/stack.c:309:1: parameter `st` of sk_free
307. }
308.
309. > void sk_free(_STACK *st)
310. {
311. if (st == NULL)
crypto/stack/stack.c:313:5: when calling `CRYPTO_free` here
311. if (st == NULL)
312. return;
313. OPENSSL_free(st->data);
^
314. OPENSSL_free(st);
315. }
crypto/mem.c:234:1: parameter `str` of CRYPTO_free
232. }
233.
234. > void CRYPTO_free(void *str)
235. {
236. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
crypto/mem.c:245:5: invalid access occurs here
243. }
244. #else
245. free(str);
^
246. #endif
247. }
|
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/crypto/mem.c/#L245
|
d2a_code_trace_data_44810
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
test/bntest.c:682: error: BUFFER_OVERRUN_L3
Offset: [-1, +oo] Size: [1, +oo] by call to `BN_GF2m_mod_mul`.
Showing all 19 steps of the trace
test/bntest.c:682:13: Call
680. BN_bntest_rand(d, 1024, 0, 0);
681. for (j = 0; j < 2; j++) {
682. BN_GF2m_mod_mul(e, a, c, b[j], ctx);
^
683. BN_GF2m_add(f, a, d);
684. BN_GF2m_mod_mul(g, f, c, b[j], ctx);
crypto/bn/bn_gf2m.c:465:1: Parameter `ctx->stack.depth`
463. * BN_GF2m_mod_mul_arr function.
464. */
465. > int BN_GF2m_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
466. const BIGNUM *p, BN_CTX *ctx)
467. {
test/bntest.c:684:13: Call
682. BN_GF2m_mod_mul(e, a, c, b[j], ctx);
683. BN_GF2m_add(f, a, d);
684. BN_GF2m_mod_mul(g, f, c, b[j], ctx);
^
685. BN_GF2m_mod_mul(h, d, c, b[j], ctx);
686. BN_GF2m_add(f, e, g);
crypto/bn/bn_gf2m.c:465:1: Parameter `ctx->stack.depth`
463. * BN_GF2m_mod_mul_arr function.
464. */
465. > int BN_GF2m_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
466. const BIGNUM *p, BN_CTX *ctx)
467. {
test/bntest.c:685:13: Call
683. BN_GF2m_add(f, a, d);
684. BN_GF2m_mod_mul(g, f, c, b[j], ctx);
685. BN_GF2m_mod_mul(h, d, c, b[j], ctx);
^
686. BN_GF2m_add(f, e, g);
687. BN_GF2m_add(f, f, h);
crypto/bn/bn_gf2m.c:465:1: Parameter `ctx->stack.depth`
463. * BN_GF2m_mod_mul_arr function.
464. */
465. > int BN_GF2m_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
466. const BIGNUM *p, BN_CTX *ctx)
467. {
test/bntest.c:682:13: Call
680. BN_bntest_rand(d, 1024, 0, 0);
681. for (j = 0; j < 2; j++) {
682. BN_GF2m_mod_mul(e, a, c, b[j], ctx);
^
683. BN_GF2m_add(f, a, d);
684. BN_GF2m_mod_mul(g, f, c, b[j], ctx);
crypto/bn/bn_gf2m.c:465:1: Parameter `ctx->stack.depth`
463. * BN_GF2m_mod_mul_arr function.
464. */
465. > int BN_GF2m_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
466. const BIGNUM *p, BN_CTX *ctx)
467. {
crypto/bn/bn_gf2m.c:481:11: Call
479. goto err;
480. }
481. ret = BN_GF2m_mod_mul_arr(r, a, b, arr, ctx);
^
482. bn_check_top(r);
483. err:
crypto/bn/bn_gf2m.c:424:5: Call
422. }
423.
424. BN_CTX_start(ctx);
^
425. if ((s = BN_CTX_get(ctx)) == NULL)
426. goto err;
crypto/bn/bn_ctx.c:171:1: Parameter `*ctx->stack.indexes`
169. }
170.
171. > void BN_CTX_start(BN_CTX *ctx)
172. {
173. CTXDBG("ENTER BN_CTX_start()", ctx);
crypto/bn/bn_gf2m.c:454:5: Call
452.
453. err:
454. BN_CTX_end(ctx);
^
455. return ret;
456. }
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_GF2m_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_44811
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
test/ec_internal_test.c:90: error: BUFFER_OVERRUN_L3
Offset: [-1, +oo] Size: [1, +oo] by call to `group_field_tests`.
Showing all 13 steps of the trace
test/ec_internal_test.c:81:5: Call
79. return 0;
80.
81. BN_CTX_start(ctx);
^
82. p = BN_CTX_get(ctx);
83. a = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:181:1: Parameter `ctx->stack.depth`
179. }
180.
181. > void BN_CTX_start(BN_CTX *ctx)
182. {
183. CTXDBG_ENTRY("BN_CTX_start", ctx);
test/ec_internal_test.c:90:13: Call
88. || !TEST_true(BN_bin2bn(params + 2 * len, len, b))
89. || !TEST_true(EC_GROUP_set_curve(group, p, a, b, ctx))
90. || !group_field_tests(group, ctx))
^
91. goto err;
92. ret = 1;
test/ec_internal_test.c:28:5: Call
26. return 1;
27.
28. BN_CTX_start(ctx);
^
29. a = BN_CTX_get(ctx);
30. b = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:181:1: Parameter `*ctx->stack.indexes`
179. }
180.
181. > void BN_CTX_start(BN_CTX *ctx)
182. {
183. CTXDBG_ENTRY("BN_CTX_start", ctx);
test/ec_internal_test.c:65:5: Call
63. ret = 1;
64. err:
65. BN_CTX_end(ctx);
^
66. return ret;
67. }
crypto/bn/bn_ctx.c:195:1: Parameter `*ctx->stack.indexes`
193. }
194.
195. > void BN_CTX_end(BN_CTX *ctx)
196. {
197. CTXDBG_ENTRY("BN_CTX_end", ctx);
crypto/bn/bn_ctx.c:201:27: Call
199. ctx->err_stack--;
200. else {
201. unsigned int fp = BN_STACK_pop(&ctx->stack);
^
202. /* Does this stack frame have anything to release? */
203. if (fp < ctx->used)
crypto/bn/bn_ctx.c:274:1: <Offset trace>
272. }
273.
274. > static unsigned int BN_STACK_pop(BN_STACK *st)
275. {
276. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:274:1: Parameter `st->depth`
272. }
273.
274. > static unsigned int BN_STACK_pop(BN_STACK *st)
275. {
276. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:274:1: <Length trace>
272. }
273.
274. > static unsigned int BN_STACK_pop(BN_STACK *st)
275. {
276. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:274:1: Parameter `*st->indexes`
272. }
273.
274. > static unsigned int BN_STACK_pop(BN_STACK *st)
275. {
276. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:276:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `group_field_tests`
274. static unsigned int BN_STACK_pop(BN_STACK *st)
275. {
276. return st->indexes[--(st->depth)];
^
277. }
278.
|
https://github.com/openssl/openssl/blob/8f58ede09572dcc6a7e6c01280dd348240199568/crypto/bn/bn_ctx.c/#L276
|
d2a_code_trace_data_44812
|
int ssl3_read_n(SSL *s, int n, int max, int extend)
{
int i,len,left,align=0;
unsigned char *pkt;
SSL3_BUFFER *rb;
if (n <= 0) return n;
rb = &(s->s3->rbuf);
left = rb->left;
#if defined(SSL3_ALIGN_PAYLOAD) && SSL3_ALIGN_PAYLOAD!=0
align = (int)rb->buf + SSL3_RT_HEADER_LENGTH;
align = (-align)&(SSL3_ALIGN_PAYLOAD-1);
#endif
if (!extend)
{
if (left == 0)
rb->offset = align;
else if (align != 0 && left >= SSL3_RT_HEADER_LENGTH)
{
pkt = rb->buf + rb->offset;
if (pkt[0] == SSL3_RT_APPLICATION_DATA
&& (pkt[3]<<8|pkt[4]) >= 128)
{
memmove (rb->buf+align,pkt,left);
rb->offset = align;
}
}
s->packet = rb->buf + rb->offset;
s->packet_length = 0;
}
if ( SSL_version(s) == DTLS1_VERSION &&
extend)
{
if ( left > 0 && n > left)
n = left;
}
if (left >= n)
{
s->packet_length+=n;
rb->left=left-n;
rb->offset+=n;
return(n);
}
len = s->packet_length;
pkt = rb->buf+align;
if (s->packet != pkt)
{
memmove(pkt, s->packet, len+left);
s->packet = pkt;
rb->offset = len + align;
}
max = rb->len - rb->offset;
if (n > max)
{
SSLerr(SSL_F_SSL3_READ_N,ERR_R_INTERNAL_ERROR);
return -1;
}
if (!s->read_ahead)
max=n;
while (left < n)
{
clear_sys_error();
if (s->rbio != NULL)
{
s->rwstate=SSL_READING;
i=BIO_read(s->rbio,pkt+len+left, max-left);
}
else
{
SSLerr(SSL_F_SSL3_READ_N,SSL_R_READ_BIO_NOT_SET);
i = -1;
}
if (i <= 0)
{
rb->left = left;
return(i);
}
left+=i;
}
rb->offset += n;
rb->left = left - n;
s->packet_length += n;
s->rwstate=SSL_NOTHING;
return(n);
}
ssl/d1_pkt.c:551: error: BUFFER_OVERRUN_L3
Offset added: [5, +oo] Size: [0, +oo] by call to `ssl3_read_n`.
Showing all 8 steps of the trace
ssl/d1_pkt.c:522:1: Parameter `s->s3->rbuf.left`
520. */
521. /* used only by dtls1_read_bytes */
522. > int dtls1_get_record(SSL *s)
523. {
524. int ssl_major,ssl_minor,al;
ssl/d1_pkt.c:551:5: Call
549. (s->packet_length < DTLS1_RT_HEADER_LENGTH))
550. {
551. n=ssl3_read_n(s, DTLS1_RT_HEADER_LENGTH, s->s3->rbuf.len, 0);
^
552. /* read timeout is handled by dtls1_read_bytes */
553. if (n <= 0) return(n); /* error or non-blocking */
ssl/s3_pkt.c:123:1: <Offset trace>
121. static int ssl3_get_record(SSL *s);
122.
123. > int ssl3_read_n(SSL *s, int n, int max, int extend)
124. {
125. /* If extend == 0, obtain new n-byte packet; if extend == 1, increase
ssl/s3_pkt.c:123:1: Parameter `s->s3->rbuf.left`
121. static int ssl3_get_record(SSL *s);
122.
123. > int ssl3_read_n(SSL *s, int n, int max, int extend)
124. {
125. /* If extend == 0, obtain new n-byte packet; if extend == 1, increase
ssl/s3_pkt.c:139:2: Assignment
137.
138. rb = &(s->s3->rbuf);
139. left = rb->left;
^
140. #if defined(SSL3_ALIGN_PAYLOAD) && SSL3_ALIGN_PAYLOAD!=0
141. align = (int)rb->buf + SSL3_RT_HEADER_LENGTH;
ssl/s3_pkt.c:123:1: <Length trace>
121. static int ssl3_get_record(SSL *s);
122.
123. > int ssl3_read_n(SSL *s, int n, int max, int extend)
124. {
125. /* If extend == 0, obtain new n-byte packet; if extend == 1, increase
ssl/s3_pkt.c:123:1: Parameter `*s->s3->rbuf.buf`
121. static int ssl3_get_record(SSL *s);
122.
123. > int ssl3_read_n(SSL *s, int n, int max, int extend)
124. {
125. /* If extend == 0, obtain new n-byte packet; if extend == 1, increase
ssl/s3_pkt.c:165:5: Array access: Offset added: [5, +oo] Size: [0, +oo] by call to `ssl3_read_n`
163. * arguments and therefore no buffer
164. * overrun can be triggered. */
165. memmove (rb->buf+align,pkt,left);
^
166. rb->offset = align;
167. }
|
https://github.com/openssl/openssl/blob/ad0e439604abf22dcf9e9b7ffd0618c7f3489e02/ssl/s3_pkt.c/#L165
|
d2a_code_trace_data_44813
|
static ngx_int_t
ngx_http_fastcgi_process_header(ngx_http_request_t *r)
{
u_char *p, *msg, *start, *last,
*part_start, *part_end;
size_t size;
ngx_str_t *status_line, *pattern;
ngx_int_t rc, status;
ngx_buf_t buf;
ngx_uint_t i;
ngx_table_elt_t *h;
ngx_http_upstream_t *u;
ngx_http_fastcgi_ctx_t *f;
ngx_http_upstream_header_t *hh;
ngx_http_fastcgi_loc_conf_t *flcf;
ngx_http_fastcgi_split_part_t *part;
ngx_http_upstream_main_conf_t *umcf;
f = ngx_http_get_module_ctx(r, ngx_http_fastcgi_module);
umcf = ngx_http_get_module_main_conf(r, ngx_http_upstream_module);
u = r->upstream;
for ( ;; ) {
if (f->state < ngx_http_fastcgi_st_data) {
f->pos = u->buffer.pos;
f->last = u->buffer.last;
rc = ngx_http_fastcgi_process_record(r, f);
u->buffer.pos = f->pos;
u->buffer.last = f->last;
if (rc == NGX_AGAIN) {
return NGX_AGAIN;
}
if (rc == NGX_ERROR) {
return NGX_HTTP_UPSTREAM_INVALID_HEADER;
}
if (f->type != NGX_HTTP_FASTCGI_STDOUT
&& f->type != NGX_HTTP_FASTCGI_STDERR)
{
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
"upstream sent unexpected FastCGI record: %d",
f->type);
return NGX_HTTP_UPSTREAM_INVALID_HEADER;
}
if (f->type == NGX_HTTP_FASTCGI_STDOUT && f->length == 0) {
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
"upstream closed prematurely FastCGI stdout");
return NGX_HTTP_UPSTREAM_INVALID_HEADER;
}
}
if (f->state == ngx_http_fastcgi_st_padding) {
if (u->buffer.pos + f->padding < u->buffer.last) {
f->state = ngx_http_fastcgi_st_version;
u->buffer.pos += f->padding;
continue;
}
if (u->buffer.pos + f->padding == u->buffer.last) {
f->state = ngx_http_fastcgi_st_version;
u->buffer.pos = u->buffer.last;
return NGX_AGAIN;
}
f->padding -= u->buffer.last - u->buffer.pos;
u->buffer.pos = u->buffer.last;
return NGX_AGAIN;
}
if (f->type == NGX_HTTP_FASTCGI_STDERR) {
if (f->length) {
msg = u->buffer.pos;
if (u->buffer.pos + f->length <= u->buffer.last) {
u->buffer.pos += f->length;
f->length = 0;
f->state = ngx_http_fastcgi_st_padding;
} else {
f->length -= u->buffer.last - u->buffer.pos;
u->buffer.pos = u->buffer.last;
}
for (p = u->buffer.pos - 1; msg < p; p--) {
if (*p != LF && *p != CR && *p != '.' && *p != ' ') {
break;
}
}
p++;
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
"FastCGI sent in stderr: \"%*s\"", p - msg, msg);
flcf = ngx_http_get_module_loc_conf(r, ngx_http_fastcgi_module);
if (flcf->catch_stderr) {
pattern = flcf->catch_stderr->elts;
for (i = 0; i < flcf->catch_stderr->nelts; i++) {
if (ngx_strnstr(msg, (char *) pattern[i].data,
p - msg)
!= NULL)
{
return NGX_HTTP_UPSTREAM_INVALID_HEADER;
}
}
}
if (u->buffer.pos == u->buffer.last) {
if (!f->fastcgi_stdout) {
u->buffer.pos = u->buffer.start;
u->buffer.last = u->buffer.start;
}
return NGX_AGAIN;
}
} else {
f->state = ngx_http_fastcgi_st_version;
}
continue;
}
f->fastcgi_stdout = 1;
start = u->buffer.pos;
if (u->buffer.pos + f->length < u->buffer.last) {
last = u->buffer.last;
u->buffer.last = u->buffer.pos + f->length;
} else {
last = NULL;
}
for ( ;; ) {
part_start = u->buffer.pos;
part_end = u->buffer.last;
rc = ngx_http_parse_header_line(r, &u->buffer, 1);
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"http fastcgi parser: %d", rc);
if (rc == NGX_AGAIN) {
break;
}
if (rc == NGX_OK) {
h = ngx_list_push(&u->headers_in.headers);
if (h == NULL) {
return NGX_ERROR;
}
if (f->split_parts && f->split_parts->nelts) {
part = f->split_parts->elts;
size = u->buffer.pos - part_start;
for (i = 0; i < f->split_parts->nelts; i++) {
size += part[i].end - part[i].start;
}
p = ngx_pnalloc(r->pool, size);
if (p == NULL) {
return NGX_ERROR;
}
buf.pos = p;
for (i = 0; i < f->split_parts->nelts; i++) {
p = ngx_cpymem(p, part[i].start,
part[i].end - part[i].start);
}
p = ngx_cpymem(p, part_start, u->buffer.pos - part_start);
buf.last = p;
f->split_parts->nelts = 0;
rc = ngx_http_parse_header_line(r, &buf, 1);
h->key.len = r->header_name_end - r->header_name_start;
h->key.data = r->header_name_start;
h->key.data[h->key.len] = '\0';
h->value.len = r->header_end - r->header_start;
h->value.data = r->header_start;
h->value.data[h->value.len] = '\0';
h->lowcase_key = ngx_pnalloc(r->pool, h->key.len);
if (h->lowcase_key == NULL) {
return NGX_ERROR;
}
} else {
h->key.len = r->header_name_end - r->header_name_start;
h->value.len = r->header_end - r->header_start;
h->key.data = ngx_pnalloc(r->pool,
h->key.len + 1 + h->value.len + 1
+ h->key.len);
if (h->key.data == NULL) {
return NGX_ERROR;
}
h->value.data = h->key.data + h->key.len + 1;
h->lowcase_key = h->key.data + h->key.len + 1
+ h->value.len + 1;
ngx_cpystrn(h->key.data, r->header_name_start,
h->key.len + 1);
ngx_cpystrn(h->value.data, r->header_start,
h->value.len + 1);
}
h->hash = r->header_hash;
if (h->key.len == r->lowcase_index) {
ngx_memcpy(h->lowcase_key, r->lowcase_header, h->key.len);
} else {
ngx_strlow(h->lowcase_key, h->key.data, h->key.len);
}
hh = ngx_hash_find(&umcf->headers_in_hash, h->hash,
h->lowcase_key, h->key.len);
if (hh && hh->handler(r, h, hh->offset) != NGX_OK) {
return NGX_ERROR;
}
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"http fastcgi header: \"%V: %V\"",
&h->key, &h->value);
if (u->buffer.pos < u->buffer.last) {
continue;
}
break;
}
if (rc == NGX_HTTP_PARSE_HEADER_DONE) {
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"http fastcgi header done");
if (u->headers_in.status) {
status_line = &u->headers_in.status->value;
status = ngx_atoi(status_line->data, 3);
if (status == NGX_ERROR) {
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
"upstream sent invalid status \"%V\"",
status_line);
return NGX_HTTP_UPSTREAM_INVALID_HEADER;
}
u->headers_in.status_n = status;
u->headers_in.status_line = *status_line;
} else if (u->headers_in.location) {
u->headers_in.status_n = 302;
u->headers_in.status_line.len =
sizeof("302 Moved Temporarily") - 1;
u->headers_in.status_line.data =
(u_char *) "302 Moved Temporarily";
} else {
u->headers_in.status_n = 200;
u->headers_in.status_line.len = sizeof("200 OK") - 1;
u->headers_in.status_line.data = (u_char *) "200 OK";
}
if (u->state) {
u->state->status = u->headers_in.status_n;
}
break;
}
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
"upstream sent invalid header");
return NGX_HTTP_UPSTREAM_INVALID_HEADER;
}
if (last) {
u->buffer.last = last;
}
f->length -= u->buffer.pos - start;
if (f->length == 0) {
if (f->padding) {
f->state = ngx_http_fastcgi_st_padding;
} else {
f->state = ngx_http_fastcgi_st_version;
}
}
if (rc == NGX_HTTP_PARSE_HEADER_DONE) {
return NGX_OK;
}
if (rc == NGX_OK) {
continue;
}
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"upstream split a header line in FastCGI records");
if (f->split_parts == NULL) {
f->split_parts = ngx_array_create(r->pool, 1,
sizeof(ngx_http_fastcgi_split_part_t));
if (f->split_parts == NULL) {
return NGX_ERROR;
}
}
part = ngx_array_push(f->split_parts);
part->start = part_start;
part->end = part_end;
if (u->buffer.pos < u->buffer.last) {
continue;
}
return NGX_AGAIN;
}
}
src/http/modules/ngx_http_fastcgi_module.c:1441: error: Uninitialized Value
The value read from part_end was never initialized.
src/http/modules/ngx_http_fastcgi_module.c:1441:9:
1439.
1440. part->start = part_start;
1441. part->end = part_end;
^
1442.
1443. if (u->buffer.pos < u->buffer.last) {
|
https://github.com/nginx/nginx/blob/e5b2d3c6b2a132bbbbac0249566f0da7ff12bc39/src/http/modules/ngx_http_fastcgi_module.c/#L1441
|
d2a_code_trace_data_44814
|
IMPLEMENT_new_ctx(cbc, CBC, 256)
providers/common/ciphers/aes.c:292: error: NULL_DEREFERENCE
pointer `ctx` last assigned on line 292 could be null and is dereferenced at line 292, column 1.
Showing all 18 steps of the trace
providers/common/ciphers/aes.c:292:1: start of procedure aes_256_cbc_newctx()
290. /* CBC */
291. IMPLEMENT_new_params(cbc, CBC)
292. > IMPLEMENT_new_ctx(cbc, CBC, 256)
293. IMPLEMENT_new_ctx(cbc, CBC, 192)
294. IMPLEMENT_new_ctx(cbc, CBC, 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:292:1:
290. /* CBC */
291. IMPLEMENT_new_params(cbc, CBC)
292. > IMPLEMENT_new_ctx(cbc, CBC, 256)
293. IMPLEMENT_new_ctx(cbc, CBC, 192)
294. IMPLEMENT_new_ctx(cbc, CBC, 128)
|
https://github.com/openssl/openssl/blob/f79858ac4d90a450d0620d1ecb713bc35d7d9f8d/providers/common/ciphers/aes.c/#L292
|
d2a_code_trace_data_44815
|
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:1060: error: Uninitialized Value
The value read from xmax was never initialized.
libavcodec/motion_est_template.c:1060:9:
1058. CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift) , (P_MEDIAN[1]>>shift)+1)
1059. CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift)-1, (P_MEDIAN[1]>>shift) )
1060. CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift)+1, (P_MEDIAN[1]>>shift) )
^
1061. CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
1062. (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1060
|
d2a_code_trace_data_44816
|
static int dct_quantize_refine(MpegEncContext *s,
DCTELEM *block, int16_t *weight, DCTELEM *orig,
int n, int qscale){
int16_t rem[64];
DECLARE_ALIGNED_16(DCTELEM, d1[64]);
const int *qmat;
const uint8_t *scantable= s->intra_scantable.scantable;
const uint8_t *perm_scantable= s->intra_scantable.permutated;
int run_tab[65];
int prev_run=0;
int prev_level=0;
int qmul, qadd, start_i, last_non_zero, i, dc;
uint8_t * length;
uint8_t * last_length;
int lambda;
int rle_index, run, q = 1, sum;
#ifdef REFINE_STATS
static int count=0;
static int after_last=0;
static int to_zero=0;
static int from_zero=0;
static int raise=0;
static int lower=0;
static int messed_sign=0;
#endif
if(basis[0][0] == 0)
build_basis(s->dsp.idct_permutation);
qmul= qscale*2;
qadd= (qscale-1)|1;
if (s->mb_intra) {
if (!s->h263_aic) {
if (n < 4)
q = s->y_dc_scale;
else
q = s->c_dc_scale;
} else{
q = 1;
qadd=0;
}
q <<= RECON_SHIFT-3;
dc= block[0]*q;
start_i = 1;
qmat = s->q_intra_matrix[qscale];
length = s->intra_ac_vlc_length;
last_length= s->intra_ac_vlc_last_length;
} else {
dc= 0;
start_i = 0;
qmat = s->q_inter_matrix[qscale];
length = s->inter_ac_vlc_length;
last_length= s->inter_ac_vlc_last_length;
}
last_non_zero = s->block_last_index[n];
#ifdef REFINE_STATS
{START_TIMER
#endif
dc += (1<<(RECON_SHIFT-1));
for(i=0; i<64; i++){
rem[i]= dc - (orig[i]<<RECON_SHIFT);
}
#ifdef REFINE_STATS
STOP_TIMER("memset rem[]")}
#endif
sum=0;
for(i=0; i<64; i++){
int one= 36;
int qns=4;
int w;
w= FFABS(weight[i]) + qns*one;
w= 15 + (48*qns*one + w/2)/w;
weight[i] = w;
assert(w>0);
assert(w<(1<<6));
sum += w*w;
}
lambda= sum*(uint64_t)s->lambda2 >> (FF_LAMBDA_SHIFT - 6 + 6 + 6 + 6);
#ifdef REFINE_STATS
{START_TIMER
#endif
run=0;
rle_index=0;
for(i=start_i; i<=last_non_zero; i++){
int j= perm_scantable[i];
const int level= block[j];
int coeff;
if(level){
if(level<0) coeff= qmul*level - qadd;
else coeff= qmul*level + qadd;
run_tab[rle_index++]=run;
run=0;
s->dsp.add_8x8basis(rem, basis[j], coeff);
}else{
run++;
}
}
#ifdef REFINE_STATS
if(last_non_zero>0){
STOP_TIMER("init rem[]")
}
}
{START_TIMER
#endif
for(;;){
int best_score=s->dsp.try_8x8basis(rem, weight, basis[0], 0);
int best_coeff=0;
int best_change=0;
int run2, best_unquant_change=0, analyze_gradient;
#ifdef REFINE_STATS
{START_TIMER
#endif
analyze_gradient = last_non_zero > 2 || s->avctx->quantizer_noise_shaping >= 3;
if(analyze_gradient){
#ifdef REFINE_STATS
{START_TIMER
#endif
for(i=0; i<64; i++){
int w= weight[i];
d1[i] = (rem[i]*w*w + (1<<(RECON_SHIFT+12-1)))>>(RECON_SHIFT+12);
}
#ifdef REFINE_STATS
STOP_TIMER("rem*w*w")}
{START_TIMER
#endif
s->dsp.fdct(d1);
#ifdef REFINE_STATS
STOP_TIMER("dct")}
#endif
}
if(start_i){
const int level= block[0];
int change, old_coeff;
assert(s->mb_intra);
old_coeff= q*level;
for(change=-1; change<=1; change+=2){
int new_level= level + change;
int score, new_coeff;
new_coeff= q*new_level;
if(new_coeff >= 2048 || new_coeff < 0)
continue;
score= s->dsp.try_8x8basis(rem, weight, basis[0], new_coeff - old_coeff);
if(score<best_score){
best_score= score;
best_coeff= 0;
best_change= change;
best_unquant_change= new_coeff - old_coeff;
}
}
}
run=0;
rle_index=0;
run2= run_tab[rle_index++];
prev_level=0;
prev_run=0;
for(i=start_i; i<64; i++){
int j= perm_scantable[i];
const int level= block[j];
int change, old_coeff;
if(s->avctx->quantizer_noise_shaping < 3 && i > last_non_zero + 1)
break;
if(level){
if(level<0) old_coeff= qmul*level - qadd;
else old_coeff= qmul*level + qadd;
run2= run_tab[rle_index++];
}else{
old_coeff=0;
run2--;
assert(run2>=0 || i >= last_non_zero );
}
for(change=-1; change<=1; change+=2){
int new_level= level + change;
int score, new_coeff, unquant_change;
score=0;
if(s->avctx->quantizer_noise_shaping < 2 && FFABS(new_level) > FFABS(level))
continue;
if(new_level){
if(new_level<0) new_coeff= qmul*new_level - qadd;
else new_coeff= qmul*new_level + qadd;
if(new_coeff >= 2048 || new_coeff <= -2048)
continue;
if(level){
if(level < 63 && level > -63){
if(i < last_non_zero)
score += length[UNI_AC_ENC_INDEX(run, new_level+64)]
- length[UNI_AC_ENC_INDEX(run, level+64)];
else
score += last_length[UNI_AC_ENC_INDEX(run, new_level+64)]
- last_length[UNI_AC_ENC_INDEX(run, level+64)];
}
}else{
assert(FFABS(new_level)==1);
if(analyze_gradient){
int g= d1[ scantable[i] ];
if(g && (g^new_level) >= 0)
continue;
}
if(i < last_non_zero){
int next_i= i + run2 + 1;
int next_level= block[ perm_scantable[next_i] ] + 64;
if(next_level&(~127))
next_level= 0;
if(next_i < last_non_zero)
score += length[UNI_AC_ENC_INDEX(run, 65)]
+ length[UNI_AC_ENC_INDEX(run2, next_level)]
- length[UNI_AC_ENC_INDEX(run + run2 + 1, next_level)];
else
score += length[UNI_AC_ENC_INDEX(run, 65)]
+ last_length[UNI_AC_ENC_INDEX(run2, next_level)]
- last_length[UNI_AC_ENC_INDEX(run + run2 + 1, next_level)];
}else{
score += last_length[UNI_AC_ENC_INDEX(run, 65)];
if(prev_level){
score += length[UNI_AC_ENC_INDEX(prev_run, prev_level)]
- last_length[UNI_AC_ENC_INDEX(prev_run, prev_level)];
}
}
}
}else{
new_coeff=0;
assert(FFABS(level)==1);
if(i < last_non_zero){
int next_i= i + run2 + 1;
int next_level= block[ perm_scantable[next_i] ] + 64;
if(next_level&(~127))
next_level= 0;
if(next_i < last_non_zero)
score += length[UNI_AC_ENC_INDEX(run + run2 + 1, next_level)]
- length[UNI_AC_ENC_INDEX(run2, next_level)]
- length[UNI_AC_ENC_INDEX(run, 65)];
else
score += last_length[UNI_AC_ENC_INDEX(run + run2 + 1, next_level)]
- last_length[UNI_AC_ENC_INDEX(run2, next_level)]
- length[UNI_AC_ENC_INDEX(run, 65)];
}else{
score += -last_length[UNI_AC_ENC_INDEX(run, 65)];
if(prev_level){
score += last_length[UNI_AC_ENC_INDEX(prev_run, prev_level)]
- length[UNI_AC_ENC_INDEX(prev_run, prev_level)];
}
}
}
score *= lambda;
unquant_change= new_coeff - old_coeff;
assert((score < 100*lambda && score > -100*lambda) || lambda==0);
score+= s->dsp.try_8x8basis(rem, weight, basis[j], unquant_change);
if(score<best_score){
best_score= score;
best_coeff= i;
best_change= change;
best_unquant_change= unquant_change;
}
}
if(level){
prev_level= level + 64;
if(prev_level&(~127))
prev_level= 0;
prev_run= run;
run=0;
}else{
run++;
}
}
#ifdef REFINE_STATS
STOP_TIMER("iterative step")}
#endif
if(best_change){
int j= perm_scantable[ best_coeff ];
block[j] += best_change;
if(best_coeff > last_non_zero){
last_non_zero= best_coeff;
assert(block[j]);
#ifdef REFINE_STATS
after_last++;
#endif
}else{
#ifdef REFINE_STATS
if(block[j]){
if(block[j] - best_change){
if(FFABS(block[j]) > FFABS(block[j] - best_change)){
raise++;
}else{
lower++;
}
}else{
from_zero++;
}
}else{
to_zero++;
}
#endif
for(; last_non_zero>=start_i; last_non_zero--){
if(block[perm_scantable[last_non_zero]])
break;
}
}
#ifdef REFINE_STATS
count++;
if(256*256*256*64 % count == 0){
printf("after_last:%d to_zero:%d from_zero:%d raise:%d lower:%d sign:%d xyp:%d/%d/%d\n", after_last, to_zero, from_zero, raise, lower, messed_sign, s->mb_x, s->mb_y, s->picture_number);
}
#endif
run=0;
rle_index=0;
for(i=start_i; i<=last_non_zero; i++){
int j= perm_scantable[i];
const int level= block[j];
if(level){
run_tab[rle_index++]=run;
run=0;
}else{
run++;
}
}
s->dsp.add_8x8basis(rem, basis[j], best_unquant_change);
}else{
break;
}
}
#ifdef REFINE_STATS
if(last_non_zero>0){
STOP_TIMER("iterative search")
}
}
#endif
return last_non_zero;
}
libavcodec/mpegvideo_enc.c:1753: error: Buffer Overrun L2
Offset: [0, 68] (⇐ [0, 5] + [0, 63]) Size: 8 by call to `encode_mb_internal`.
libavcodec/mpegvideo_enc.c:1753:41: Call
1751. static av_always_inline void encode_mb(MpegEncContext *s, int motion_x, int motion_y)
1752. {
1753. if (s->chroma_format == CHROMA_420) encode_mb_internal(s, motion_x, motion_y, 8, 6);
^
1754. else encode_mb_internal(s, motion_x, motion_y, 16, 8);
1755. }
libavcodec/mpegvideo_enc.c:1457:1: Array declaration
1455. }
1456.
1457. static av_always_inline void encode_mb_internal(MpegEncContext *s, int motion_x, int motion_y, int mb_block_height, int mb_block_count)
^
1458. {
1459. int16_t weight[8][64];
libavcodec/mpegvideo_enc.c:1668:46: Call
1666. for(i=0;i<mb_block_count;i++) {
1667. if(!skip_dct[i]){
1668. s->block_last_index[i] = dct_quantize_refine(s, s->block[i], weight[i], orig[i], i, s->qscale);
^
1669. }
1670. }
libavcodec/mpegvideo_enc.c:3349:9: <Offset trace>
3347. #endif
3348. dc += (1<<(RECON_SHIFT-1));
3349. for(i=0; i<64; i++){
^
3350. rem[i]= dc - (orig[i]<<RECON_SHIFT); //FIXME use orig dirrectly instead of copying to rem[]
3351. }
libavcodec/mpegvideo_enc.c:3349:9: Assignment
3347. #endif
3348. dc += (1<<(RECON_SHIFT-1));
3349. for(i=0; i<64; i++){
^
3350. rem[i]= dc - (orig[i]<<RECON_SHIFT); //FIXME use orig dirrectly instead of copying to rem[]
3351. }
libavcodec/mpegvideo_enc.c:3282:1: <Length trace>
3280. }
3281.
3282. static int dct_quantize_refine(MpegEncContext *s, //FIXME breaks denoise?
^
3283. DCTELEM *block, int16_t *weight, DCTELEM *orig,
3284. int n, int qscale){
libavcodec/mpegvideo_enc.c:3282:1: Parameter `*orig`
3280. }
3281.
3282. static int dct_quantize_refine(MpegEncContext *s, //FIXME breaks denoise?
^
3283. DCTELEM *block, int16_t *weight, DCTELEM *orig,
3284. int n, int qscale){
libavcodec/mpegvideo_enc.c:3350:23: Array access: Offset: [0, 68] (⇐ [0, 5] + [0, 63]) Size: 8 by call to `encode_mb_internal`
3348. dc += (1<<(RECON_SHIFT-1));
3349. for(i=0; i<64; i++){
3350. rem[i]= dc - (orig[i]<<RECON_SHIFT); //FIXME use orig dirrectly instead of copying to rem[]
^
3351. }
3352. #ifdef REFINE_STATS
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/mpegvideo_enc.c/#L3350
|
d2a_code_trace_data_44817
|
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: [1, +oo] Size: [0, 8388607] 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:110:13: Array access: Offset: [1, +oo] Size: [0, 8388607] by call to `BN_lshift`
108. for (i = a->top - 1; i >= 0; i--) {
109. l = f[i];
110. t[nw + i + 1] |= (l >> rb) & BN_MASK2;
^
111. t[nw + i] = (l << lb) & BN_MASK2;
112. }
|
https://github.com/openssl/openssl/blob/b3618f44a7b8504bfb0a64e8a33e6b8e56d4d516/crypto/bn/bn_shift.c/#L110
|
d2a_code_trace_data_44818
|
static void floor_encode(venc_context_t * venc, floor_t * fc, PutBitContext * pb, uint_fast16_t * posts, float * floor, int samples) {
int range = 255 / fc->multiplier + 1;
int coded[fc->values];
int i, counter;
put_bits(pb, 1, 1);
put_bits(pb, ilog(range - 1), posts[0]);
put_bits(pb, ilog(range - 1), posts[1]);
coded[0] = coded[1] = 1;
for (i = 2; i < fc->values; i++) {
int predicted = render_point(fc->list[fc->list[i].low].x,
posts[fc->list[i].low],
fc->list[fc->list[i].high].x,
posts[fc->list[i].high],
fc->list[i].x);
int highroom = range - predicted;
int lowroom = predicted;
int room = FFMIN(highroom, lowroom);
if (predicted == posts[i]) {
coded[i] = 0;
continue;
} else {
if (!coded[fc->list[i].low ]) coded[fc->list[i].low ] = -1;
if (!coded[fc->list[i].high]) coded[fc->list[i].high] = -1;
}
if (posts[i] > predicted) {
if (posts[i] - predicted > room)
coded[i] = posts[i] - predicted + lowroom;
else
coded[i] = (posts[i] - predicted) << 1;
} else {
if (predicted - posts[i] > room)
coded[i] = predicted - posts[i] + highroom - 1;
else
coded[i] = ((predicted - posts[i]) << 1) - 1;
}
}
counter = 2;
for (i = 0; i < fc->partitions; i++) {
floor_class_t * c = &fc->classes[fc->partition_to_class[i]];
int k, cval = 0, csub = 1<<c->subclass;
if (c->subclass) {
codebook_t * book = &venc->codebooks[c->masterbook];
int cshift = 0;
for (k = 0; k < c->dim; k++) {
int l;
for (l = 0; l < csub; l++) {
int maxval = 1;
if (c->books[l] != -1)
maxval = venc->codebooks[c->books[l]].nentries;
if (coded[counter + k] < maxval) break;
}
assert(l != csub);
cval |= l << cshift;
cshift += c->subclass;
}
put_codeword(pb, book, cval);
}
for (k = 0; k < c->dim; k++) {
int book = c->books[cval & (csub-1)];
int entry = coded[counter++];
cval >>= c->subclass;
if (book == -1) continue;
if (entry == -1) entry = 0;
put_codeword(pb, &venc->codebooks[book], entry);
}
}
ff_vorbis_floor1_render_list(fc->list, fc->values, posts, coded, fc->multiplier, floor, samples);
}
libavcodec/vorbis_enc.c:992: error: Integer Overflow L2
([0, +oo] - 1):unsigned64 by call to `floor_encode`.
libavcodec/vorbis_enc.c:991:9: Call
989. floor_t * fc = &venc->floors[mapping->floor[mapping->mux[i]]];
990. uint_fast16_t posts[fc->values];
991. floor_fit(venc, fc, &venc->coeffs[i * samples], posts, samples);
^
992. floor_encode(venc, fc, &pb, posts, &venc->floor[i * samples], samples);
993. }
libavcodec/vorbis_enc.c:679:1: Parameter `*posts`
677. }
678.
679. static void floor_fit(venc_context_t * venc, floor_t * fc, float * coeffs, uint_fast16_t * posts, int samples) {
^
680. int range = 255 / fc->multiplier + 1;
681. int i;
libavcodec/vorbis_enc.c:992:9: Call
990. uint_fast16_t posts[fc->values];
991. floor_fit(venc, fc, &venc->coeffs[i * samples], posts, samples);
992. floor_encode(venc, fc, &pb, posts, &venc->floor[i * samples], samples);
^
993. }
994.
libavcodec/vorbis_enc.c:707:1: <LHS trace>
705. }
706.
707. static void floor_encode(venc_context_t * venc, floor_t * fc, PutBitContext * pb, uint_fast16_t * posts, float * floor, int samples) {
^
708. int range = 255 / fc->multiplier + 1;
709. int coded[fc->values]; // first 2 values are unused
libavcodec/vorbis_enc.c:707:1: Parameter `*posts`
705. }
706.
707. static void floor_encode(venc_context_t * venc, floor_t * fc, PutBitContext * pb, uint_fast16_t * posts, float * floor, int samples) {
^
708. int range = 255 / fc->multiplier + 1;
709. int coded[fc->values]; // first 2 values are unused
libavcodec/vorbis_enc.c:742:17: Binary operation: ([0, +oo] - 1):unsigned64 by call to `floor_encode`
740. coded[i] = predicted - posts[i] + highroom - 1;
741. else
742. coded[i] = ((predicted - posts[i]) << 1) - 1;
^
743. }
744. }
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/vorbis_enc.c/#L742
|
d2a_code_trace_data_44819
|
static inline void pred_direct_motion(H264Context * const h, int *mb_type){
MpegEncContext * const s = &h->s;
const int mb_xy = s->mb_x + s->mb_y*s->mb_stride;
const int b8_xy = 2*s->mb_x + 2*s->mb_y*h->b8_stride;
const int b4_xy = 4*s->mb_x + 4*s->mb_y*h->b_stride;
const int mb_type_col = h->ref_list[1][0].mb_type[mb_xy];
const int16_t (*l1mv0)[2] = (const int16_t (*)[2]) &h->ref_list[1][0].motion_val[0][b4_xy];
const int16_t (*l1mv1)[2] = (const int16_t (*)[2]) &h->ref_list[1][0].motion_val[1][b4_xy];
const int8_t *l1ref0 = &h->ref_list[1][0].ref_index[0][b8_xy];
const int8_t *l1ref1 = &h->ref_list[1][0].ref_index[1][b8_xy];
const int is_b8x8 = IS_8X8(*mb_type);
unsigned int sub_mb_type;
int i8, i4;
#define MB_TYPE_16x16_OR_INTRA (MB_TYPE_16x16|MB_TYPE_INTRA4x4|MB_TYPE_INTRA16x16|MB_TYPE_INTRA_PCM)
if(IS_8X8(mb_type_col) && !h->sps.direct_8x8_inference_flag){
sub_mb_type = MB_TYPE_8x8|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2;
*mb_type = MB_TYPE_8x8|MB_TYPE_L0L1;
}else if(!is_b8x8 && (mb_type_col & MB_TYPE_16x16_OR_INTRA)){
sub_mb_type = MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2;
*mb_type = MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2;
}else{
sub_mb_type = MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2;
*mb_type = MB_TYPE_8x8|MB_TYPE_L0L1;
}
if(!is_b8x8)
*mb_type |= MB_TYPE_DIRECT2;
if(MB_FIELD)
*mb_type |= MB_TYPE_INTERLACED;
tprintf(s->avctx, "mb_type = %08x, sub_mb_type = %08x, is_b8x8 = %d, mb_type_col = %08x\n", *mb_type, sub_mb_type, is_b8x8, mb_type_col);
if(h->direct_spatial_mv_pred){
int ref[2];
int mv[2][2];
int list;
for(list=0; list<2; list++){
int refa = h->ref_cache[list][scan8[0] - 1];
int refb = h->ref_cache[list][scan8[0] - 8];
int refc = h->ref_cache[list][scan8[0] - 8 + 4];
if(refc == -2)
refc = h->ref_cache[list][scan8[0] - 8 - 1];
ref[list] = refa;
if(ref[list] < 0 || (refb < ref[list] && refb >= 0))
ref[list] = refb;
if(ref[list] < 0 || (refc < ref[list] && refc >= 0))
ref[list] = refc;
if(ref[list] < 0)
ref[list] = -1;
}
if(ref[0] < 0 && ref[1] < 0){
ref[0] = ref[1] = 0;
mv[0][0] = mv[0][1] =
mv[1][0] = mv[1][1] = 0;
}else{
for(list=0; list<2; list++){
if(ref[list] >= 0)
pred_motion(h, 0, 4, list, ref[list], &mv[list][0], &mv[list][1]);
else
mv[list][0] = mv[list][1] = 0;
}
}
if(ref[1] < 0){
if(!is_b8x8)
*mb_type &= ~MB_TYPE_L1;
sub_mb_type &= ~MB_TYPE_L1;
}else if(ref[0] < 0){
if(!is_b8x8)
*mb_type &= ~MB_TYPE_L0;
sub_mb_type &= ~MB_TYPE_L0;
}
if(IS_INTERLACED(*mb_type) != IS_INTERLACED(mb_type_col)){
int pair_xy = s->mb_x + (s->mb_y&~1)*s->mb_stride;
int mb_types_col[2];
int b8_stride = h->b8_stride;
int b4_stride = h->b_stride;
*mb_type = (*mb_type & ~MB_TYPE_16x16) | MB_TYPE_8x8;
if(IS_INTERLACED(*mb_type)){
mb_types_col[0] = h->ref_list[1][0].mb_type[pair_xy];
mb_types_col[1] = h->ref_list[1][0].mb_type[pair_xy+s->mb_stride];
if(s->mb_y&1){
l1ref0 -= 2*b8_stride;
l1ref1 -= 2*b8_stride;
l1mv0 -= 4*b4_stride;
l1mv1 -= 4*b4_stride;
}
b8_stride *= 3;
b4_stride *= 6;
}else{
int cur_poc = s->current_picture_ptr->poc;
int *col_poc = h->ref_list[1]->field_poc;
int col_parity = FFABS(col_poc[0] - cur_poc) >= FFABS(col_poc[1] - cur_poc);
int dy = 2*col_parity - (s->mb_y&1);
mb_types_col[0] =
mb_types_col[1] = h->ref_list[1][0].mb_type[pair_xy + col_parity*s->mb_stride];
l1ref0 += dy*b8_stride;
l1ref1 += dy*b8_stride;
l1mv0 += 2*dy*b4_stride;
l1mv1 += 2*dy*b4_stride;
b8_stride = 0;
}
for(i8=0; i8<4; i8++){
int x8 = i8&1;
int y8 = i8>>1;
int xy8 = x8+y8*b8_stride;
int xy4 = 3*x8+y8*b4_stride;
int a=0, b=0;
if(is_b8x8 && !IS_DIRECT(h->sub_mb_type[i8]))
continue;
h->sub_mb_type[i8] = sub_mb_type;
fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[0], 1);
fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[1], 1);
if(!IS_INTRA(mb_types_col[y8])
&& ( (l1ref0[xy8] == 0 && FFABS(l1mv0[xy4][0]) <= 1 && FFABS(l1mv0[xy4][1]) <= 1)
|| (l1ref0[xy8] < 0 && l1ref1[xy8] == 0 && FFABS(l1mv1[xy4][0]) <= 1 && FFABS(l1mv1[xy4][1]) <= 1))){
if(ref[0] > 0)
a= pack16to32(mv[0][0],mv[0][1]);
if(ref[1] > 0)
b= pack16to32(mv[1][0],mv[1][1]);
}else{
a= pack16to32(mv[0][0],mv[0][1]);
b= pack16to32(mv[1][0],mv[1][1]);
}
fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, a, 4);
fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, b, 4);
}
}else if(IS_16X16(*mb_type)){
int a=0, b=0;
fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, (uint8_t)ref[0], 1);
fill_rectangle(&h->ref_cache[1][scan8[0]], 4, 4, 8, (uint8_t)ref[1], 1);
if(!IS_INTRA(mb_type_col)
&& ( (l1ref0[0] == 0 && FFABS(l1mv0[0][0]) <= 1 && FFABS(l1mv0[0][1]) <= 1)
|| (l1ref0[0] < 0 && l1ref1[0] == 0 && FFABS(l1mv1[0][0]) <= 1 && FFABS(l1mv1[0][1]) <= 1
&& (h->x264_build>33 || !h->x264_build)))){
if(ref[0] > 0)
a= pack16to32(mv[0][0],mv[0][1]);
if(ref[1] > 0)
b= pack16to32(mv[1][0],mv[1][1]);
}else{
a= pack16to32(mv[0][0],mv[0][1]);
b= pack16to32(mv[1][0],mv[1][1]);
}
fill_rectangle(&h->mv_cache[0][scan8[0]], 4, 4, 8, a, 4);
fill_rectangle(&h->mv_cache[1][scan8[0]], 4, 4, 8, b, 4);
}else{
for(i8=0; i8<4; i8++){
const int x8 = i8&1;
const int y8 = i8>>1;
if(is_b8x8 && !IS_DIRECT(h->sub_mb_type[i8]))
continue;
h->sub_mb_type[i8] = sub_mb_type;
fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, pack16to32(mv[0][0],mv[0][1]), 4);
fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, pack16to32(mv[1][0],mv[1][1]), 4);
fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[0], 1);
fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[1], 1);
if(!IS_INTRA(mb_type_col) && ( l1ref0[x8 + y8*h->b8_stride] == 0
|| (l1ref0[x8 + y8*h->b8_stride] < 0 && l1ref1[x8 + y8*h->b8_stride] == 0
&& (h->x264_build>33 || !h->x264_build)))){
const int16_t (*l1mv)[2]= l1ref0[x8 + y8*h->b8_stride] == 0 ? l1mv0 : l1mv1;
if(IS_SUB_8X8(sub_mb_type)){
const int16_t *mv_col = l1mv[x8*3 + y8*3*h->b_stride];
if(FFABS(mv_col[0]) <= 1 && FFABS(mv_col[1]) <= 1){
if(ref[0] == 0)
fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, 0, 4);
if(ref[1] == 0)
fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, 0, 4);
}
}else
for(i4=0; i4<4; i4++){
const int16_t *mv_col = l1mv[x8*2 + (i4&1) + (y8*2 + (i4>>1))*h->b_stride];
if(FFABS(mv_col[0]) <= 1 && FFABS(mv_col[1]) <= 1){
if(ref[0] == 0)
*(uint32_t*)h->mv_cache[0][scan8[i8*4+i4]] = 0;
if(ref[1] == 0)
*(uint32_t*)h->mv_cache[1][scan8[i8*4+i4]] = 0;
}
}
}
}
}
}else{
const int *map_col_to_list0[2] = {h->map_col_to_list0[0], h->map_col_to_list0[1]};
const int *dist_scale_factor = h->dist_scale_factor;
if(FRAME_MBAFF){
if(IS_INTERLACED(*mb_type)){
map_col_to_list0[0] = h->map_col_to_list0_field[0];
map_col_to_list0[1] = h->map_col_to_list0_field[1];
dist_scale_factor = h->dist_scale_factor_field;
}
if(IS_INTERLACED(*mb_type) != IS_INTERLACED(mb_type_col)){
const int pair_xy = s->mb_x + (s->mb_y&~1)*s->mb_stride;
int mb_types_col[2];
int y_shift;
*mb_type = MB_TYPE_8x8|MB_TYPE_L0L1
| (is_b8x8 ? 0 : MB_TYPE_DIRECT2)
| (*mb_type & MB_TYPE_INTERLACED);
sub_mb_type = MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2|MB_TYPE_16x16;
if(IS_INTERLACED(*mb_type)){
mb_types_col[0] = h->ref_list[1][0].mb_type[pair_xy];
mb_types_col[1] = h->ref_list[1][0].mb_type[pair_xy+s->mb_stride];
if(s->mb_y&1){
l1ref0 -= 2*h->b8_stride;
l1ref1 -= 2*h->b8_stride;
l1mv0 -= 4*h->b_stride;
l1mv1 -= 4*h->b_stride;
}
y_shift = 0;
if( (mb_types_col[0] & MB_TYPE_16x16_OR_INTRA)
&& (mb_types_col[1] & MB_TYPE_16x16_OR_INTRA)
&& !is_b8x8)
*mb_type |= MB_TYPE_16x8;
else
*mb_type |= MB_TYPE_8x8;
}else{
int dy = (s->mb_y&1) ? 1 : 2;
mb_types_col[0] =
mb_types_col[1] = h->ref_list[1][0].mb_type[pair_xy+s->mb_stride];
l1ref0 += dy*h->b8_stride;
l1ref1 += dy*h->b8_stride;
l1mv0 += 2*dy*h->b_stride;
l1mv1 += 2*dy*h->b_stride;
y_shift = 2;
if((mb_types_col[0] & (MB_TYPE_16x16_OR_INTRA|MB_TYPE_16x8))
&& !is_b8x8)
*mb_type |= MB_TYPE_16x16;
else
*mb_type |= MB_TYPE_8x8;
}
for(i8=0; i8<4; i8++){
const int x8 = i8&1;
const int y8 = i8>>1;
int ref0, scale;
const int16_t (*l1mv)[2]= l1mv0;
if(is_b8x8 && !IS_DIRECT(h->sub_mb_type[i8]))
continue;
h->sub_mb_type[i8] = sub_mb_type;
fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, 0, 1);
if(IS_INTRA(mb_types_col[y8])){
fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, 0, 1);
fill_rectangle(&h-> mv_cache[0][scan8[i8*4]], 2, 2, 8, 0, 4);
fill_rectangle(&h-> mv_cache[1][scan8[i8*4]], 2, 2, 8, 0, 4);
continue;
}
ref0 = l1ref0[x8 + (y8*2>>y_shift)*h->b8_stride];
if(ref0 >= 0)
ref0 = map_col_to_list0[0][ref0*2>>y_shift];
else{
ref0 = map_col_to_list0[1][l1ref1[x8 + (y8*2>>y_shift)*h->b8_stride]*2>>y_shift];
l1mv= l1mv1;
}
scale = dist_scale_factor[ref0];
fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, ref0, 1);
{
const int16_t *mv_col = l1mv[x8*3 + (y8*6>>y_shift)*h->b_stride];
int my_col = (mv_col[1]<<y_shift)/2;
int mx = (scale * mv_col[0] + 128) >> 8;
int my = (scale * my_col + 128) >> 8;
fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, pack16to32(mx,my), 4);
fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, pack16to32(mx-mv_col[0],my-my_col), 4);
}
}
return;
}
}
if(IS_16X16(*mb_type)){
int ref, mv0, mv1;
fill_rectangle(&h->ref_cache[1][scan8[0]], 4, 4, 8, 0, 1);
if(IS_INTRA(mb_type_col)){
ref=mv0=mv1=0;
}else{
const int ref0 = l1ref0[0] >= 0 ? map_col_to_list0[0][l1ref0[0]]
: map_col_to_list0[1][l1ref1[0]];
const int scale = dist_scale_factor[ref0];
const int16_t *mv_col = l1ref0[0] >= 0 ? l1mv0[0] : l1mv1[0];
int mv_l0[2];
mv_l0[0] = (scale * mv_col[0] + 128) >> 8;
mv_l0[1] = (scale * mv_col[1] + 128) >> 8;
ref= ref0;
mv0= pack16to32(mv_l0[0],mv_l0[1]);
mv1= pack16to32(mv_l0[0]-mv_col[0],mv_l0[1]-mv_col[1]);
}
fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, ref, 1);
fill_rectangle(&h-> mv_cache[0][scan8[0]], 4, 4, 8, mv0, 4);
fill_rectangle(&h-> mv_cache[1][scan8[0]], 4, 4, 8, mv1, 4);
}else{
for(i8=0; i8<4; i8++){
const int x8 = i8&1;
const int y8 = i8>>1;
int ref0, scale;
const int16_t (*l1mv)[2]= l1mv0;
if(is_b8x8 && !IS_DIRECT(h->sub_mb_type[i8]))
continue;
h->sub_mb_type[i8] = sub_mb_type;
fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, 0, 1);
if(IS_INTRA(mb_type_col)){
fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, 0, 1);
fill_rectangle(&h-> mv_cache[0][scan8[i8*4]], 2, 2, 8, 0, 4);
fill_rectangle(&h-> mv_cache[1][scan8[i8*4]], 2, 2, 8, 0, 4);
continue;
}
ref0 = l1ref0[x8 + y8*h->b8_stride];
if(ref0 >= 0)
ref0 = map_col_to_list0[0][ref0];
else{
ref0 = map_col_to_list0[1][l1ref1[x8 + y8*h->b8_stride]];
l1mv= l1mv1;
}
scale = dist_scale_factor[ref0];
fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, ref0, 1);
if(IS_SUB_8X8(sub_mb_type)){
const int16_t *mv_col = l1mv[x8*3 + y8*3*h->b_stride];
int mx = (scale * mv_col[0] + 128) >> 8;
int my = (scale * mv_col[1] + 128) >> 8;
fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, pack16to32(mx,my), 4);
fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, pack16to32(mx-mv_col[0],my-mv_col[1]), 4);
}else
for(i4=0; i4<4; i4++){
const int16_t *mv_col = l1mv[x8*2 + (i4&1) + (y8*2 + (i4>>1))*h->b_stride];
int16_t *mv_l0 = h->mv_cache[0][scan8[i8*4+i4]];
mv_l0[0] = (scale * mv_col[0] + 128) >> 8;
mv_l0[1] = (scale * mv_col[1] + 128) >> 8;
*(uint32_t*)h->mv_cache[1][scan8[i8*4+i4]] =
pack16to32(mv_l0[0]-mv_col[0],mv_l0[1]-mv_col[1]);
}
}
}
}
}
libavcodec/h264.c:1126: error: Uninitialized Value
The value read from ref[_] was never initialized.
libavcodec/h264.c:1126:17:
1124. fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, pack16to32(mv[1][0],mv[1][1]), 4);
1125. fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[0], 1);
1126. fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[1], 1);
^
1127.
1128. /* col_zero_flag */
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/h264.c/#L1126
|
d2a_code_trace_data_44820
|
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:814: error: INTEGER_OVERFLOW_L2
([0, +oo] - [0, `pkt->written` + 326]):unsigned64 by call to `WPACKET_start_sub_packet_len__`.
Showing all 12 steps of the trace
ssl/statem/statem_clnt.c:795:17: Call
793. sess_id_len = s->session->session_id_length;
794. if (sess_id_len > sizeof(s->session->session_id)
795. || !WPACKET_start_sub_packet_u8(pkt)
^
796. || (sess_id_len != 0 && !WPACKET_memcpy(pkt, s->session->session_id,
797. sess_id_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/statem/statem_clnt.c:814:10: Call
812.
813. /* Ciphers supported */
814. if (!WPACKET_start_sub_packet_u16(pkt)) {
^
815. SSLerr(SSL_F_TLS_CONSTRUCT_CLIENT_HELLO, ERR_R_INTERNAL_ERROR);
816. return 0;
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] - [0, pkt->written + 326]):unsigned64 by call to `WPACKET_start_sub_packet_len__`
44. return 0;
45.
46. if (pkt->buf->length - pkt->written < len) {
^
47. size_t newlen;
48. size_t reflen;
|
https://github.com/openssl/openssl/blob/6438632420cee9821409221ef6717edc5ee408c1/ssl/packet.c/#L46
|
d2a_code_trace_data_44821
|
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/heartbeat_test.c:84: error: INTEGER_OVERFLOW_L1
(0 - 1):unsigned64 by call to `SSL_new`.
Showing all 17 steps of the trace
ssl/heartbeat_test.c:75:16: Call
73. fixture.test_case_name = test_case_name;
74.
75. fixture.ctx = SSL_CTX_new(meth);
^
76. if (!fixture.ctx)
77. {
ssl/ssl_lib.c:2068:16: Call
2066. ret->app_verify_cookie_cb=0;
2067.
2068. ret->sessions=lh_SSL_SESSION_new();
^
2069. if (ret->sessions == NULL) goto err;
2070. ret->cert_store=X509_STORE_new();
crypto/lhash/lhash.c:133:2: Assignment
131. ret->up_load=UP_LOAD;
132. ret->down_load=DOWN_LOAD;
133. ret->num_items=0;
^
134.
135. ret->num_expands=0;
ssl/heartbeat_test.c:84:14: Call
82. }
83.
84. fixture.s = SSL_new(fixture.ctx);
^
85. if (!fixture.s)
86. {
ssl/ssl_lib.c:275:1: Parameter `ctx->sessions->num_items`
273. }
274.
275. > SSL *SSL_new(SSL_CTX *ctx)
276. {
277. SSL *s;
ssl/ssl_lib.c:408:2: Call
406. s->server=(ctx->method->ssl_accept == ssl_undefined_function)?0:1;
407.
408. SSL_clear(s);
^
409.
410. CRYPTO_new_ex_data(CRYPTO_EX_INDEX_SSL, s, &s->ex_data);
ssl/ssl_lib.c:185:1: Parameter `s->ctx->sessions->num_items`
183. };
184.
185. > int SSL_clear(SSL *s)
186. {
187.
ssl/ssl_lib.c:194:6: Call
192. }
193.
194. if (ssl_clear_bad_session(s))
^
195. {
196. SSL_SESSION_free(s->session);
ssl/ssl_sess.c:982:1: Parameter `s->ctx->sessions->num_items`
980. }
981.
982. > int ssl_clear_bad_session(SSL *s)
983. {
984. if ( (s->session != NULL) &&
ssl/ssl_sess.c:988:3: Call
986. !(SSL_in_init(s) || SSL_in_before(s)))
987. {
988. SSL_CTX_remove_session(s->ctx,s->session);
^
989. return(1);
990. }
ssl/ssl_sess.c:677:1: Parameter `ctx->sessions->num_items`
675. }
676.
677. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
678. {
679. return remove_session_lock(ctx, c, 1);
ssl/ssl_sess.c:679:9: Call
677. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
678. {
679. return remove_session_lock(ctx, c, 1);
^
680. }
681.
ssl/ssl_sess.c:682:1: Parameter `ctx->sessions->num_items`
680. }
681.
682. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck)
683. {
684. SSL_SESSION *r;
ssl/ssl_sess.c:693:6: Call
691. {
692. ret=1;
693. r=lh_SSL_SESSION_delete(ctx->sessions,c);
^
694. SSL_SESSION_list_remove(ctx,c);
695. }
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 - 1):unsigned64 by call to `SSL_new`
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/f5ad068b01a4adae1e1dd4103b5ce7e5e1442f6c/crypto/lhash/lhash.c/#L240
|
d2a_code_trace_data_44822
|
static void contract(_LHASH *lh)
{
LHASH_NODE **n, *n1, *np;
np = lh->b[lh->p + lh->pmax - 1];
lh->b[lh->p + lh->pmax - 1] = NULL;
if (lh->p == 0) {
n = OPENSSL_realloc(lh->b,
(unsigned int)(sizeof(LHASH_NODE *) * lh->pmax));
if (n == NULL) {
lh->error++;
return;
}
lh->num_contract_reallocs++;
lh->num_alloc_nodes /= 2;
lh->pmax /= 2;
lh->p = lh->pmax - 1;
lh->b = n;
} else
lh->p--;
lh->num_nodes--;
lh->num_contracts++;
n1 = lh->b[(int)lh->p];
if (n1 == NULL)
lh->b[(int)lh->p] = np;
else {
while (n1->next != NULL)
n1 = n1->next;
n1->next = np;
}
}
ssl/ssl_locl.h:694: error: BUFFER_OVERRUN_L3
Offset: [-1, +oo] Size: [1, +oo] by call to `lh_delete`.
Showing all 10 steps of the trace
ssl/ssl_locl.h:694:1: Parameter `lh->pmax`
692. };
693.
694. > DEFINE_LHASH_OF(SSL_SESSION);
695.
696.
ssl/ssl_locl.h:694:1: Call
692. };
693.
694. > DEFINE_LHASH_OF(SSL_SESSION);
695.
696.
crypto/lhash/lhash.c:189:1: Parameter `lh->pmax`
187. }
188.
189. > void *lh_delete(_LHASH *lh, const void *data)
190. {
191. unsigned long hash;
crypto/lhash/lhash.c:212:9: Call
210. if ((lh->num_nodes > MIN_NODES) &&
211. (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
212. contract(lh);
^
213.
214. return (ret);
crypto/lhash/lhash.c:323:1: <Offset trace>
321. }
322.
323. > static void contract(_LHASH *lh)
324. {
325. LHASH_NODE **n, *n1, *np;
crypto/lhash/lhash.c:323:1: Parameter `lh->p`
321. }
322.
323. > static void contract(_LHASH *lh)
324. {
325. LHASH_NODE **n, *n1, *np;
crypto/lhash/lhash.c:343:9: Assignment
341. lh->b = n;
342. } else
343. lh->p--;
^
344.
345. lh->num_nodes--;
crypto/lhash/lhash.c:323:1: <Length trace>
321. }
322.
323. > static void contract(_LHASH *lh)
324. {
325. LHASH_NODE **n, *n1, *np;
crypto/lhash/lhash.c:323:1: Parameter `*lh->b`
321. }
322.
323. > static void contract(_LHASH *lh)
324. {
325. LHASH_NODE **n, *n1, *np;
crypto/lhash/lhash.c:348:10: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `lh_delete`
346. lh->num_contracts++;
347.
348. n1 = lh->b[(int)lh->p];
^
349. if (n1 == NULL)
350. lh->b[(int)lh->p] = np;
|
https://github.com/openssl/openssl/blob/ac33c5a477568127ad99b1260a8978477de50e36/crypto/lhash/lhash.c/#L348
|
d2a_code_trace_data_44823
|
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:3167: error: Uninitialized Value
The value read from is_intra[_] was never initialized.
libavcodec/vc1.c:3167:24:
3165. int intrapred = 0;
3166. for(i=0; i<6; i++)
3167. if(is_intra[i]) {
^
3168. if(((!s->first_slice_line || (i==2 || i==3)) && v->mb_type[0][s->block_index[i] - s->block_wrap[i]])
3169. || ((s->mb_x || (i==1 || i==3)) && v->mb_type[0][s->block_index[i] - 1])) {
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/vc1.c/#L3167
|
d2a_code_trace_data_44824
|
unsigned int ff_vorbis_nth_root(unsigned int x, unsigned int n) {
unsigned int ret=0, i, j;
do {
++ret;
for(i=0,j=ret;i<n-1;i++) j*=ret;
} while (j<=x);
return (ret-1);
}
libavcodec/vorbis_enc.c:952: error: Integer Overflow L2
([0, +oo] - 1):unsigned32 by call to `put_main_header`.
libavcodec/vorbis_enc.c:944:5: Call
942. }
943.
944. create_vorbis_context(venc, avccontext);
^
945.
946. if (avccontext->flags & CODEC_FLAG_QSCALE)
libavcodec/vorbis_enc.c:403:5: Call
401. venc->win[1] = ff_vorbis_vwin[venc->log2_blocksize[1] - 6];
402.
403. ff_mdct_init(&venc->mdct[0], venc->log2_blocksize[0], 0);
^
404. ff_mdct_init(&venc->mdct[1], venc->log2_blocksize[1], 0);
405. }
libavcodec/mdct.c:54:1: Parameter `*s->fft.revtab`
52. * init MDCT or IMDCT computation.
53. */
54. int ff_mdct_init(MDCTContext *s, int nbits, int inverse)
^
55. {
56. int n, n4, i;
libavcodec/vorbis_enc.c:952:34: Call
950. venc->quality *= venc->quality;
951.
952. avccontext->extradata_size = put_main_header(venc, (uint8_t**)&avccontext->extradata);
^
953.
954. avccontext->frame_size = 1 << (venc->log2_blocksize[0] - 1);
libavcodec/vorbis_enc.c:539:1: Parameter `venc->codebooks->ndimentions`
537. }
538.
539. static int put_main_header(venc_context_t * venc, uint8_t ** out) {
^
540. int i;
541. PutBitContext pb;
libavcodec/vorbis_enc.c:589:9: Call
587. put_bits(&pb, 8, venc->ncodebooks - 1);
588. for (i = 0; i < venc->ncodebooks; i++)
589. put_codebook_header(&pb, &venc->codebooks[i]);
^
590.
591. // time domain, reserved, zero
libavcodec/vorbis_enc.c:417:1: Parameter `cb->ndimentions`
415. }
416.
417. static void put_codebook_header(PutBitContext * pb, codebook_t * cb) {
^
418. int i;
419. int ordered = 0;
libavcodec/vorbis_enc.c:459:19: Call
457. put_bits(pb, 4, cb->lookup);
458. if (cb->lookup) {
459. int tmp = cb_lookup_vals(cb->lookup, cb->ndimentions, cb->nentries);
^
460. int bits = ilog(cb->quantlist[0]);
461.
libavcodec/vorbis_enc.c:176:1: Parameter `dimentions`
174. }
175.
176. static int cb_lookup_vals(int lookup, int dimentions, int entries) {
^
177. if (lookup == 1) return ff_vorbis_nth_root(entries, dimentions);
178. else if (lookup == 2) return dimentions * entries;
libavcodec/vorbis_enc.c:177:34: Call
175.
176. static int cb_lookup_vals(int lookup, int dimentions, int entries) {
177. if (lookup == 1) return ff_vorbis_nth_root(entries, dimentions);
^
178. else if (lookup == 2) return dimentions * entries;
179. return 0;
libavcodec/vorbis.c:35:1: <LHS trace>
33. /* Helper functions */
34.
35. unsigned int ff_vorbis_nth_root(unsigned int x, unsigned int n) { // x^(1/n)
^
36. unsigned int ret=0, i, j;
37.
libavcodec/vorbis.c:35:1: Parameter `n`
33. /* Helper functions */
34.
35. unsigned int ff_vorbis_nth_root(unsigned int x, unsigned int n) { // x^(1/n)
^
36. unsigned int ret=0, i, j;
37.
libavcodec/vorbis.c:40:23: Binary operation: ([0, +oo] - 1):unsigned32 by call to `put_main_header`
38. do {
39. ++ret;
40. for(i=0,j=ret;i<n-1;i++) j*=ret;
^
41. } while (j<=x);
42.
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/vorbis.c/#L40
|
d2a_code_trace_data_44825
|
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:856: error: NULL_DEREFERENCE
pointer `meth` last assigned on line 854 could be null and is dereferenced at line 856, column 9.
Showing all 6 steps of the trace
crypto/rand/rand_lib.c:852:1: start of procedure RAND_pseudo_bytes()
850.
851. #if !OPENSSL_API_1_1_0 && !defined(FIPS_MODE)
852. > int RAND_pseudo_bytes(unsigned char *buf, int num)
853. {
854. const RAND_METHOD *meth = RAND_get_rand_method();
crypto/rand/rand_lib.c:854:5:
852. int RAND_pseudo_bytes(unsigned char *buf, int num)
853. {
854. > const RAND_METHOD *meth = RAND_get_rand_method();
855.
856. if (meth->pseudorand != NULL)
crypto/rand/rand_lib.c:722:1: start of procedure RAND_get_rand_method()
720. #endif
721.
722. > const RAND_METHOD *RAND_get_rand_method(void)
723. {
724. #ifdef FIPS_MODE
crypto/rand/rand_lib.c:725:5:
723. {
724. #ifdef FIPS_MODE
725. > return NULL;
726. #else
727. const RAND_METHOD *tmp_meth = NULL;
crypto/rand/rand_lib.c:754:1: return from a call to RAND_get_rand_method
752. return tmp_meth;
753. #endif
754. > }
755.
756. #if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODE)
crypto/rand/rand_lib.c:856:9:
854. const RAND_METHOD *meth = RAND_get_rand_method();
855.
856. > if (meth->pseudorand != NULL)
857. return meth->pseudorand(buf, num);
858. return -1;
|
https://github.com/openssl/openssl/blob/363e941ed43c648adf4d6d0874077ddd80041e1f/crypto/rand/rand_lib.c/#L856
|
d2a_code_trace_data_44826
|
static int vorbis_residue_decode(vorbis_context *vc, vorbis_residue *vr, uint_fast8_t ch, uint_fast8_t *do_not_decode, float *vec, uint_fast16_t vlen) {
GetBitContext *gb=&vc->gb;
uint_fast8_t c_p_c=vc->codebooks[vr->classbook].dimensions;
uint_fast16_t n_to_read=vr->end-vr->begin;
uint_fast16_t ptns_to_read=n_to_read/vr->partition_size;
uint_fast8_t classifs[ptns_to_read*vc->audio_channels];
uint_fast8_t pass;
uint_fast8_t ch_used;
uint_fast8_t i,j,l;
uint_fast16_t k;
if (vr->type==2) {
for(j=1;j<ch;++j) {
do_not_decode[0]&=do_not_decode[j];
}
if (do_not_decode[0]) return 0;
ch_used=1;
} else {
ch_used=ch;
}
AV_DEBUG(" residue type 0/1/2 decode begin, ch: %d cpc %d \n", ch, c_p_c);
for(pass=0;pass<=vr->maxpass;++pass) {
uint_fast16_t voffset;
uint_fast16_t partition_count;
uint_fast16_t j_times_ptns_to_read;
voffset=vr->begin;
for(partition_count=0;partition_count<ptns_to_read;) {
if (!pass) {
uint_fast32_t inverse_class = ff_inverse[vr->classifications];
for(j_times_ptns_to_read=0, j=0;j<ch_used;++j) {
if (!do_not_decode[j]) {
uint_fast32_t temp=get_vlc2(gb, vc->codebooks[vr->classbook].vlc.table,
vc->codebooks[vr->classbook].nb_bits, 3);
AV_DEBUG("Classword: %d \n", temp);
assert(vr->classifications > 1 && temp<=65536);
for(i=0;i<c_p_c;++i) {
uint_fast32_t temp2;
temp2=(((uint_fast64_t)temp) * inverse_class)>>32;
if (partition_count+c_p_c-1-i < ptns_to_read) {
classifs[j_times_ptns_to_read+partition_count+c_p_c-1-i]=temp-temp2*vr->classifications;
}
temp=temp2;
}
}
j_times_ptns_to_read+=ptns_to_read;
}
}
for(i=0;(i<c_p_c) && (partition_count<ptns_to_read);++i) {
for(j_times_ptns_to_read=0, j=0;j<ch_used;++j) {
uint_fast16_t voffs;
if (!do_not_decode[j]) {
uint_fast8_t vqclass=classifs[j_times_ptns_to_read+partition_count];
int_fast16_t vqbook=vr->books[vqclass][pass];
if (vqbook>=0 && vc->codebooks[vqbook].codevectors) {
uint_fast16_t coffs;
unsigned dim= vc->codebooks[vqbook].dimensions;
uint_fast16_t step= dim==1 ? vr->partition_size
: FASTDIV(vr->partition_size, dim);
vorbis_codebook codebook= vc->codebooks[vqbook];
if (vr->type==0) {
voffs=voffset+j*vlen;
for(k=0;k<step;++k) {
coffs=get_vlc2(gb, codebook.vlc.table, codebook.nb_bits, 3) * dim;
for(l=0;l<dim;++l) {
vec[voffs+k+l*step]+=codebook.codevectors[coffs+l];
}
}
}
else if (vr->type==1) {
voffs=voffset+j*vlen;
for(k=0;k<step;++k) {
coffs=get_vlc2(gb, codebook.vlc.table, codebook.nb_bits, 3) * dim;
for(l=0;l<dim;++l, ++voffs) {
vec[voffs]+=codebook.codevectors[coffs+l];
AV_DEBUG(" pass %d offs: %d curr: %f change: %f cv offs.: %d \n", pass, voffs, vec[voffs], codebook.codevectors[coffs+l], coffs);
}
}
}
else if (vr->type==2 && ch==2 && (voffset&1)==0 && (dim&1)==0) {
voffs=voffset>>1;
if(dim==2) {
for(k=0;k<step;++k) {
coffs=get_vlc2(gb, codebook.vlc.table, codebook.nb_bits, 3) * 2;
vec[voffs+k ]+=codebook.codevectors[coffs ];
vec[voffs+k+vlen]+=codebook.codevectors[coffs+1];
}
} else
for(k=0;k<step;++k) {
coffs=get_vlc2(gb, codebook.vlc.table, codebook.nb_bits, 3) * dim;
for(l=0;l<dim;l+=2, voffs++) {
vec[voffs ]+=codebook.codevectors[coffs+l ];
vec[voffs+vlen]+=codebook.codevectors[coffs+l+1];
AV_DEBUG(" pass %d offs: %d curr: %f change: %f cv offs.: %d+%d \n", pass, voffset/ch+(voffs%ch)*vlen, vec[voffset/ch+(voffs%ch)*vlen], codebook.codevectors[coffs+l], coffs, l);
}
}
}
else if (vr->type==2) {
voffs=voffset;
for(k=0;k<step;++k) {
coffs=get_vlc2(gb, codebook.vlc.table, codebook.nb_bits, 3) * dim;
for(l=0;l<dim;++l, ++voffs) {
vec[voffs/ch+(voffs%ch)*vlen]+=codebook.codevectors[coffs+l];
AV_DEBUG(" pass %d offs: %d curr: %f change: %f cv offs.: %d+%d \n", pass, voffset/ch+(voffs%ch)*vlen, vec[voffset/ch+(voffs%ch)*vlen], codebook.codevectors[coffs+l], coffs, l);
}
}
} else {
av_log(vc->avccontext, AV_LOG_ERROR, " Invalid residue type while residue decode?! \n");
return 1;
}
}
}
j_times_ptns_to_read+=ptns_to_read;
}
++partition_count;
voffset+=vr->partition_size;
}
}
}
return 0;
}
libavcodec/vorbis_dec.c:1292: error: Uninitialized Value
The value read from classifs[_] was never initialized.
libavcodec/vorbis_dec.c:1292:25:
1290.
1291. if (!do_not_decode[j]) {
1292. uint_fast8_t vqclass=classifs[j_times_ptns_to_read+partition_count];
^
1293. int_fast16_t vqbook=vr->books[vqclass][pass];
1294.
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/vorbis_dec.c/#L1292
|
d2a_code_trace_data_44827
|
static av_always_inline int epzs_motion_search_internal(MpegEncContext * s, int *mx_ptr, int *my_ptr,
int P[10][2], int src_index, int ref_index, int16_t (*last_mv)[2],
int ref_mv_scale, int flags, int size, int h)
{
MotionEstContext * const c= &s->me;
int best[2]={0, 0};
int d;
int dmin;
int map_generation;
int penalty_factor;
const int ref_mv_stride= s->mb_stride;
const int ref_mv_xy= s->mb_x + s->mb_y*ref_mv_stride;
me_cmp_func cmpf, chroma_cmpf;
LOAD_COMMON
LOAD_COMMON2
if(c->pre_pass){
penalty_factor= c->pre_penalty_factor;
cmpf= s->dsp.me_pre_cmp[size];
chroma_cmpf= s->dsp.me_pre_cmp[size+1];
}else{
penalty_factor= c->penalty_factor;
cmpf= s->dsp.me_cmp[size];
chroma_cmpf= s->dsp.me_cmp[size+1];
}
map_generation= update_map_generation(c);
assert(cmpf);
dmin= cmp(s, 0, 0, 0, 0, size, h, ref_index, src_index, cmpf, chroma_cmpf, flags);
map[0]= map_generation;
score_map[0]= dmin;
if((s->pict_type == FF_B_TYPE && !(c->flags & FLAG_DIRECT)) || s->flags&CODEC_FLAG_MV0)
dmin += (mv_penalty[pred_x] + mv_penalty[pred_y])*penalty_factor;
if (s->first_slice_line) {
CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift)
CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
}else{
if(dmin<((h*h*s->avctx->mv0_threshold)>>8)
&& ( P_LEFT[0] |P_LEFT[1]
|P_TOP[0] |P_TOP[1]
|P_TOPRIGHT[0]|P_TOPRIGHT[1])==0){
*mx_ptr= 0;
*my_ptr= 0;
c->skip=1;
return dmin;
}
CHECK_MV( P_MEDIAN[0] >>shift , P_MEDIAN[1] >>shift)
CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift) , (P_MEDIAN[1]>>shift)-1)
CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift) , (P_MEDIAN[1]>>shift)+1)
CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift)-1, (P_MEDIAN[1]>>shift) )
CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift)+1, (P_MEDIAN[1]>>shift) )
CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
CHECK_MV(P_LEFT[0] >>shift, P_LEFT[1] >>shift)
CHECK_MV(P_TOP[0] >>shift, P_TOP[1] >>shift)
CHECK_MV(P_TOPRIGHT[0]>>shift, P_TOPRIGHT[1]>>shift)
}
if(dmin>h*h*4){
if(c->pre_pass){
CHECK_CLIPPED_MV((last_mv[ref_mv_xy-1][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy-1][1]*ref_mv_scale + (1<<15))>>16)
if(!s->first_slice_line)
CHECK_CLIPPED_MV((last_mv[ref_mv_xy-ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy-ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16)
}else{
CHECK_CLIPPED_MV((last_mv[ref_mv_xy+1][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy+1][1]*ref_mv_scale + (1<<15))>>16)
if(s->mb_y+1<s->end_mb_y)
CHECK_CLIPPED_MV((last_mv[ref_mv_xy+ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy+ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16)
}
}
if(c->avctx->last_predictor_count){
const int count= c->avctx->last_predictor_count;
const int xstart= FFMAX(0, s->mb_x - count);
const int ystart= FFMAX(0, s->mb_y - count);
const int xend= FFMIN(s->mb_width , s->mb_x + count + 1);
const int yend= FFMIN(s->mb_height, s->mb_y + count + 1);
int mb_y;
for(mb_y=ystart; mb_y<yend; mb_y++){
int mb_x;
for(mb_x=xstart; mb_x<xend; mb_x++){
const int xy= mb_x + 1 + (mb_y + 1)*ref_mv_stride;
int mx= (last_mv[xy][0]*ref_mv_scale + (1<<15))>>16;
int my= (last_mv[xy][1]*ref_mv_scale + (1<<15))>>16;
if(mx>xmax || mx<xmin || my>ymax || my<ymin) continue;
CHECK_MV(mx,my)
}
}
}
dmin= diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
*mx_ptr= best[0];
*my_ptr= best[1];
return dmin;
}
libavcodec/motion_est_template.c:1069: error: Uninitialized Value
The value read from xmax was never initialized.
libavcodec/motion_est_template.c:1069:13:
1067. if(dmin>h*h*4){
1068. if(c->pre_pass){
1069. CHECK_CLIPPED_MV((last_mv[ref_mv_xy-1][0]*ref_mv_scale + (1<<15))>>16,
^
1070. (last_mv[ref_mv_xy-1][1]*ref_mv_scale + (1<<15))>>16)
1071. if(!s->first_slice_line)
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1069
|
d2a_code_trace_data_44828
|
static void new_audio_stream(AVFormatContext *oc)
{
AVStream *st;
AVCodecContext *audio_enc;
int codec_id;
st = av_new_stream(oc, oc->nb_streams);
if (!st) {
fprintf(stderr, "Could not alloc stream\n");
av_exit(1);
}
avcodec_get_context_defaults2(st->codec, CODEC_TYPE_AUDIO);
bitstream_filters[nb_output_files][oc->nb_streams - 1]= audio_bitstream_filters;
audio_bitstream_filters= NULL;
if(thread_count>1)
avcodec_thread_init(st->codec, thread_count);
audio_enc = st->codec;
audio_enc->codec_type = CODEC_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;
avctx_opts[CODEC_TYPE_AUDIO]->flags|= CODEC_FLAG_GLOBAL_HEADER;
}
if (audio_stream_copy) {
st->stream_copy = 1;
audio_enc->channels = audio_channels;
} else {
AVCodec *codec;
set_context_opts(audio_enc, avctx_opts[CODEC_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, CODEC_TYPE_AUDIO, 1);
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, CODEC_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->thread_count = thread_count;
audio_enc->channels = audio_channels;
audio_enc->sample_fmt = audio_sample_fmt;
audio_enc->channel_layout = channel_layout;
if(codec && codec->sample_fmts){
const enum SampleFormat *p= codec->sample_fmts;
for(; *p!=-1; p++){
if(*p == audio_enc->sample_fmt)
break;
}
if(*p == -1)
audio_enc->sample_fmt = codec->sample_fmts[0];
}
}
nb_ocodecs++;
audio_enc->sample_rate = audio_sample_rate;
audio_enc->time_base= (AVRational){1, audio_sample_rate};
if (audio_language) {
av_metadata_set(&st->metadata, "language", audio_language);
av_free(audio_language);
audio_language = NULL;
}
audio_disable = 0;
av_freep(&audio_codec_name);
audio_stream_copy = 0;
}
ffmpeg.c:3107: error: Null Dereference
pointer `st` last assigned on line 3102 could be null and is dereferenced at line 3107, column 35.
ffmpeg.c:3096:1: start of procedure new_audio_stream()
3094. }
3095.
3096. static void new_audio_stream(AVFormatContext *oc)
^
3097. {
3098. AVStream *st;
ffmpeg.c:3102:5:
3100. int codec_id;
3101.
3102. st = av_new_stream(oc, oc->nb_streams);
^
3103. if (!st) {
3104. fprintf(stderr, "Could not alloc stream\n");
libavformat/utils.c:2344:1: start of procedure av_new_stream()
2342. }
2343.
2344. AVStream *av_new_stream(AVFormatContext *s, int id)
^
2345. {
2346. AVStream *st;
libavformat/utils.c:2349:9: Taking true branch
2347. int i;
2348.
2349. if (s->nb_streams >= MAX_STREAMS)
^
2350. return NULL;
2351.
libavformat/utils.c:2350:9:
2348.
2349. if (s->nb_streams >= MAX_STREAMS)
2350. return NULL;
^
2351.
2352. st = av_mallocz(sizeof(AVStream));
libavformat/utils.c:2383:1: return from a call to av_new_stream
2381. s->streams[s->nb_streams++] = st;
2382. return st;
2383. }
^
2384.
2385. AVProgram *av_new_program(AVFormatContext *ac, int id)
ffmpeg.c:3103:10: Taking true branch
3101.
3102. st = av_new_stream(oc, oc->nb_streams);
3103. if (!st) {
^
3104. fprintf(stderr, "Could not alloc stream\n");
3105. av_exit(1);
ffmpeg.c:3104:9:
3102. st = av_new_stream(oc, oc->nb_streams);
3103. if (!st) {
3104. fprintf(stderr, "Could not alloc stream\n");
^
3105. av_exit(1);
3106. }
ffmpeg.c:3105:9: Skipping av_exit(): empty list of specs
3103. if (!st) {
3104. fprintf(stderr, "Could not alloc stream\n");
3105. av_exit(1);
^
3106. }
3107. avcodec_get_context_defaults2(st->codec, CODEC_TYPE_AUDIO);
ffmpeg.c:3107:5:
3105. av_exit(1);
3106. }
3107. avcodec_get_context_defaults2(st->codec, CODEC_TYPE_AUDIO);
^
3108.
3109. bitstream_filters[nb_output_files][oc->nb_streams - 1]= audio_bitstream_filters;
|
https://github.com/libav/libav/blob/9aaa2077e5879b153d2ce6bea2e42f0c349a083f/ffmpeg.c/#L3107
|
d2a_code_trace_data_44829
|
int test_gf2m_mod_mul(BIO *bp, BN_CTX *ctx)
{
BIGNUM *a, *b[2], *c, *d, *e, *f, *g, *h;
int i, j, ret = 0;
int p0[] = { 163, 7, 6, 3, 0, -1 };
int p1[] = { 193, 15, 0, -1 };
a = BN_new();
b[0] = BN_new();
b[1] = BN_new();
c = BN_new();
d = BN_new();
e = BN_new();
f = BN_new();
g = BN_new();
h = BN_new();
BN_GF2m_arr2poly(p0, b[0]);
BN_GF2m_arr2poly(p1, b[1]);
for (i = 0; i < num0; i++) {
BN_bntest_rand(a, 1024, 0, 0);
BN_bntest_rand(c, 1024, 0, 0);
BN_bntest_rand(d, 1024, 0, 0);
for (j = 0; j < 2; j++) {
BN_GF2m_mod_mul(e, a, c, b[j], ctx);
BN_GF2m_add(f, a, d);
BN_GF2m_mod_mul(g, f, c, b[j], ctx);
BN_GF2m_mod_mul(h, d, c, b[j], ctx);
BN_GF2m_add(f, e, g);
BN_GF2m_add(f, f, h);
if (!BN_is_zero(f)) {
fprintf(stderr,
"GF(2^m) modular multiplication test failed!\n");
goto err;
}
}
}
ret = 1;
err:
BN_free(a);
BN_free(b[0]);
BN_free(b[1]);
BN_free(c);
BN_free(d);
BN_free(e);
BN_free(f);
BN_free(g);
BN_free(h);
return ret;
}
test/bntest.c:1351: error: MEMORY_LEAK
memory dynamically allocated by call to `BN_new()` at line 1317, column 9 is not reachable after line 1351, column 5.
Showing all 221 steps of the trace
test/bntest.c:1310:1: start of procedure test_gf2m_mod_mul()
1308. }
1309.
1310. > int test_gf2m_mod_mul(BIO *bp, BN_CTX *ctx)
1311. {
1312. BIGNUM *a, *b[2], *c, *d, *e, *f, *g, *h;
test/bntest.c:1313:5:
1311. {
1312. BIGNUM *a, *b[2], *c, *d, *e, *f, *g, *h;
1313. > int i, j, ret = 0;
1314. int p0[] = { 163, 7, 6, 3, 0, -1 };
1315. int p1[] = { 193, 15, 0, -1 };
test/bntest.c:1314:5:
1312. BIGNUM *a, *b[2], *c, *d, *e, *f, *g, *h;
1313. int i, j, ret = 0;
1314. > int p0[] = { 163, 7, 6, 3, 0, -1 };
1315. int p1[] = { 193, 15, 0, -1 };
1316.
test/bntest.c:1315:5:
1313. int i, j, ret = 0;
1314. int p0[] = { 163, 7, 6, 3, 0, -1 };
1315. > int p1[] = { 193, 15, 0, -1 };
1316.
1317. a = BN_new();
test/bntest.c:1317:5:
1315. int p1[] = { 193, 15, 0, -1 };
1316.
1317. > a = BN_new();
1318. b[0] = BN_new();
1319. b[1] = 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:1318:5:
1316.
1317. a = BN_new();
1318. > b[0] = BN_new();
1319. b[1] = BN_new();
1320. 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:1319:5:
1317. a = BN_new();
1318. b[0] = BN_new();
1319. > b[1] = BN_new();
1320. c = BN_new();
1321. 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:1320:5:
1318. b[0] = BN_new();
1319. b[1] = BN_new();
1320. > c = BN_new();
1321. d = BN_new();
1322. 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:1321:5:
1319. b[1] = BN_new();
1320. c = BN_new();
1321. > d = BN_new();
1322. e = BN_new();
1323. f = 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:1322:5:
1320. c = BN_new();
1321. d = BN_new();
1322. > e = BN_new();
1323. f = BN_new();
1324. g = 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:1323:5:
1321. d = BN_new();
1322. e = BN_new();
1323. > f = BN_new();
1324. g = BN_new();
1325. h = 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:1324:5:
1322. e = BN_new();
1323. f = BN_new();
1324. > g = BN_new();
1325. h = BN_new();
1326.
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:1325:5:
1323. f = BN_new();
1324. g = BN_new();
1325. > h = BN_new();
1326.
1327. BN_GF2m_arr2poly(p0, b[0]);
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:1327:5: Skipping BN_GF2m_arr2poly(): empty list of specs
1325. h = BN_new();
1326.
1327. BN_GF2m_arr2poly(p0, b[0]);
^
1328. BN_GF2m_arr2poly(p1, b[1]);
1329.
test/bntest.c:1328:5: Skipping BN_GF2m_arr2poly(): empty list of specs
1326.
1327. BN_GF2m_arr2poly(p0, b[0]);
1328. BN_GF2m_arr2poly(p1, b[1]);
^
1329.
1330. for (i = 0; i < num0; i++) {
test/bntest.c:1330:10:
1328. BN_GF2m_arr2poly(p1, b[1]);
1329.
1330. > for (i = 0; i < num0; i++) {
1331. BN_bntest_rand(a, 1024, 0, 0);
1332. BN_bntest_rand(c, 1024, 0, 0);
test/bntest.c:1330:17: Loop condition is false. Leaving loop
1328. BN_GF2m_arr2poly(p1, b[1]);
1329.
1330. for (i = 0; i < num0; i++) {
^
1331. BN_bntest_rand(a, 1024, 0, 0);
1332. BN_bntest_rand(c, 1024, 0, 0);
test/bntest.c:1349:5:
1347. }
1348. }
1349. > ret = 1;
1350. err:
1351. BN_free(a);
test/bntest.c:1350:2:
1348. }
1349. ret = 1;
1350. > err:
1351. BN_free(a);
1352. BN_free(b[0]);
test/bntest.c:1351:5:
1349. ret = 1;
1350. err:
1351. > BN_free(a);
1352. BN_free(b[0]);
1353. BN_free(b[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/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/test/bntest.c/#L1351
|
d2a_code_trace_data_44830
|
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/statem/statem.c:377: error: INTEGER_OVERFLOW_L2
([0, max(0, `s->session_ctx->sessions->num_items`)] - 1):unsigned64 by call to `tls_setup_handshake`.
Showing all 15 steps of the trace
ssl/statem/statem.c:277:1: Parameter `s->session_ctx->sessions->num_items`
275. * <=0: NBIO or error
276. */
277. > static int state_machine(SSL *s, int server)
278. {
279. BUF_MEM *buf = NULL;
ssl/statem/statem.c:377:18: Call
375. if ((SSL_in_before(s))
376. || s->renegotiate) {
377. if (!tls_setup_handshake(s)) {
^
378. ossl_statem_set_error(s);
379. goto end;
ssl/statem/statem_lib.c:75:1: Parameter `s->session_ctx->sessions->num_items`
73. }
74.
75. > int tls_setup_handshake(SSL *s)
76. {
77. if (!ssl3_init_finished_mac(s))
ssl/statem/statem_lib.c:91:13: Call
89. if (ssl_get_min_max_version(s, &ver_min, &ver_max) != 0) {
90. SSLerr(SSL_F_TLS_SETUP_HANDSHAKE, ERR_R_INTERNAL_ERROR);
91. ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR);
^
92. return 0;
93. }
ssl/s3_msg.c:63:1: Parameter `s->session_ctx->sessions->num_items`
61. }
62.
63. > int ssl3_send_alert(SSL *s, int level, int desc)
64. {
65. /* Map tls/ssl alert value to correct one */
ssl/s3_msg.c:77:9: Call
75. /* If a fatal one, remove from cache */
76. if ((level == SSL3_AL_FATAL) && (s->session != NULL))
77. SSL_CTX_remove_session(s->session_ctx, s->session);
^
78.
79. s->s3->alert_dispatch = 1;
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:689:1: Parameter `lh->num_items`
687. } CLIENTHELLO_MSG;
688.
689. > DEFINE_LHASH_OF(SSL_SESSION);
690. /* Needed in ssl_cert.c */
691. DEFINE_LHASH_OF(X509_NAME);
ssl/ssl_locl.h:689:1: Call
687. } CLIENTHELLO_MSG;
688.
689. > DEFINE_LHASH_OF(SSL_SESSION);
690. /* Needed in ssl_cert.c */
691. 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->session_ctx->sessions->num_items)] - 1):unsigned64 by call to `tls_setup_handshake`
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/b6e3250671654e0344127be9dd49b3fb4a82f94b/crypto/lhash/lhash.c/#L123
|
d2a_code_trace_data_44831
|
int ssl_handshake_hash(SSL *s, unsigned char *out, int outlen)
{
EVP_MD_CTX *ctx = NULL;
EVP_MD_CTX *hdgst = s->s3->handshake_dgst;
int ret = EVP_MD_CTX_size(hdgst);
if (ret < 0 || ret > outlen) {
ret = 0;
goto err;
}
ctx = EVP_MD_CTX_new();
if (ctx == NULL) {
ret = 0;
goto err;
}
if (!EVP_MD_CTX_copy_ex(ctx, hdgst)
|| EVP_DigestFinal_ex(ctx, out, NULL) <= 0)
ret = 0;
err:
EVP_MD_CTX_free(ctx);
return ret;
}
ssl/ssl_lib.c:3217: error: NULL_DEREFERENCE
pointer `ctx` last assigned on line 3208 could be null and is dereferenced by call to `EVP_MD_CTX_free()` at line 3217, column 5.
Showing all 37 steps of the trace
ssl/ssl_lib.c:3199:1: start of procedure ssl_handshake_hash()
3197.
3198. /* Retrieve handshake hashes */
3199. > int ssl_handshake_hash(SSL *s, unsigned char *out, int outlen)
3200. {
3201. EVP_MD_CTX *ctx = NULL;
ssl/ssl_lib.c:3201:5:
3199. int ssl_handshake_hash(SSL *s, unsigned char *out, int outlen)
3200. {
3201. > EVP_MD_CTX *ctx = NULL;
3202. EVP_MD_CTX *hdgst = s->s3->handshake_dgst;
3203. int ret = EVP_MD_CTX_size(hdgst);
ssl/ssl_lib.c:3202:5:
3200. {
3201. EVP_MD_CTX *ctx = NULL;
3202. > EVP_MD_CTX *hdgst = s->s3->handshake_dgst;
3203. int ret = EVP_MD_CTX_size(hdgst);
3204. if (ret < 0 || ret > outlen) {
ssl/ssl_lib.c:3203:5:
3201. EVP_MD_CTX *ctx = NULL;
3202. EVP_MD_CTX *hdgst = s->s3->handshake_dgst;
3203. > int ret = EVP_MD_CTX_size(hdgst);
3204. if (ret < 0 || ret > outlen) {
3205. ret = 0;
crypto/evp/evp_lib.c:436:1: start of procedure EVP_MD_CTX_md()
434. }
435.
436. > const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx)
437. {
438. if (!ctx)
crypto/evp/evp_lib.c:438:10: Taking false branch
436. const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx)
437. {
438. if (!ctx)
^
439. return NULL;
440. return ctx->digest;
crypto/evp/evp_lib.c:440:5:
438. if (!ctx)
439. return NULL;
440. > return ctx->digest;
441. }
442.
crypto/evp/evp_lib.c:441:1: return from a call to EVP_MD_CTX_md
439. return NULL;
440. return ctx->digest;
441. > }
442.
443. EVP_PKEY_CTX *EVP_MD_CTX_pkey_ctx(const EVP_MD_CTX *ctx)
crypto/evp/evp_lib.c:300:1: start of procedure EVP_MD_size()
298. }
299.
300. > int EVP_MD_size(const EVP_MD *md)
301. {
302. if (!md) {
crypto/evp/evp_lib.c:302:10: Taking false branch
300. int EVP_MD_size(const EVP_MD *md)
301. {
302. if (!md) {
^
303. EVPerr(EVP_F_EVP_MD_SIZE, EVP_R_MESSAGE_DIGEST_IS_NULL);
304. return -1;
crypto/evp/evp_lib.c:306:5:
304. return -1;
305. }
306. > return md->md_size;
307. }
308.
crypto/evp/evp_lib.c:307:1: return from a call to EVP_MD_size
305. }
306. return md->md_size;
307. > }
308.
309. unsigned long EVP_MD_flags(const EVP_MD *md)
ssl/ssl_lib.c:3204:9: Taking false branch
3202. EVP_MD_CTX *hdgst = s->s3->handshake_dgst;
3203. int ret = EVP_MD_CTX_size(hdgst);
3204. if (ret < 0 || ret > outlen) {
^
3205. ret = 0;
3206. goto err;
ssl/ssl_lib.c:3204:20: Taking false branch
3202. EVP_MD_CTX *hdgst = s->s3->handshake_dgst;
3203. int ret = EVP_MD_CTX_size(hdgst);
3204. if (ret < 0 || ret > outlen) {
^
3205. ret = 0;
3206. goto err;
ssl/ssl_lib.c:3208:5:
3206. goto err;
3207. }
3208. > ctx = EVP_MD_CTX_new();
3209. if (ctx == NULL) {
3210. ret = 0;
crypto/evp/digest.c:153:1: start of procedure EVP_MD_CTX_new()
151. }
152.
153. > EVP_MD_CTX *EVP_MD_CTX_new(void)
154. {
155. return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
crypto/evp/digest.c:155:5:
153. EVP_MD_CTX *EVP_MD_CTX_new(void)
154. {
155. > return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
156. }
157.
crypto/mem.c:312:1: start of procedure CRYPTO_zalloc()
310. }
311.
312. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
313. {
314. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:314:5:
312. void *CRYPTO_zalloc(size_t num, const char *file, int line)
313. {
314. > void *ret = CRYPTO_malloc(num, file, line);
315.
316. if (ret != NULL)
crypto/mem.c:279:1: start of procedure CRYPTO_malloc()
277. }
278.
279. > void *CRYPTO_malloc(size_t num, const char *file, int line)
280. {
281. void *ret = NULL;
crypto/mem.c:281:5:
279. void *CRYPTO_malloc(size_t num, const char *file, int line)
280. {
281. > void *ret = NULL;
282.
283. if (num <= 0)
crypto/mem.c:283:9: Taking false branch
281. void *ret = NULL;
282.
283. if (num <= 0)
^
284. return NULL;
285.
crypto/mem.c:286:9: Taking true branch
284. return NULL;
285.
286. if (allow_customize)
^
287. allow_customize = 0;
288. if (malloc_debug_func != NULL) {
crypto/mem.c:287:9:
285.
286. if (allow_customize)
287. > allow_customize = 0;
288. if (malloc_debug_func != NULL) {
289. if (allow_customize_debug)
crypto/mem.c:288:9: Taking false branch
286. if (allow_customize)
287. allow_customize = 0;
288. if (malloc_debug_func != NULL) {
^
289. if (allow_customize_debug)
290. allow_customize_debug = 0;
crypto/mem.c:293:5: Skipping __function_pointer__(): unresolved function pointer
291. malloc_debug_func(NULL, num, file, line, 0);
292. }
293. ret = malloc_ex_func(num, file, line);
^
294. if (malloc_debug_func != NULL)
295. malloc_debug_func(ret, num, file, line, 1);
crypto/mem.c:294:9: Taking false branch
292. }
293. ret = malloc_ex_func(num, file, line);
294. if (malloc_debug_func != NULL)
^
295. malloc_debug_func(ret, num, file, line, 1);
296.
crypto/mem.c:309:5:
307. #endif
308.
309. > return ret;
310. }
311.
crypto/mem.c:310:1: return from a call to CRYPTO_malloc
308.
309. return ret;
310. > }
311.
312. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:316:9: Taking false branch
314. void *ret = CRYPTO_malloc(num, file, line);
315.
316. if (ret != NULL)
^
317. memset(ret, 0, num);
318. return ret;
crypto/mem.c:318:5:
316. if (ret != NULL)
317. memset(ret, 0, num);
318. > return ret;
319. }
320.
crypto/mem.c:319:1: return from a call to CRYPTO_zalloc
317. memset(ret, 0, num);
318. return ret;
319. > }
320.
321. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/evp/digest.c:156:1: return from a call to EVP_MD_CTX_new
154. {
155. return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
156. > }
157.
158. void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
ssl/ssl_lib.c:3209:9: Taking true branch
3207. }
3208. ctx = EVP_MD_CTX_new();
3209. if (ctx == NULL) {
^
3210. ret = 0;
3211. goto err;
ssl/ssl_lib.c:3210:9:
3208. ctx = EVP_MD_CTX_new();
3209. if (ctx == NULL) {
3210. > ret = 0;
3211. goto err;
3212. }
ssl/ssl_lib.c:3216:2:
3214. || EVP_DigestFinal_ex(ctx, out, NULL) <= 0)
3215. ret = 0;
3216. > err:
3217. EVP_MD_CTX_free(ctx);
3218. return ret;
ssl/ssl_lib.c:3217:5:
3215. ret = 0;
3216. err:
3217. > EVP_MD_CTX_free(ctx);
3218. return ret;
3219. }
|
https://github.com/openssl/openssl/blob/57ce7b617c602ae8513c22daa2bda31f179edb0f/ssl/ssl_lib.c/#L3217
|
d2a_code_trace_data_44832
|
int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm)
{
SSL_COMP *comp;
if (cm == NULL || cm->type == NID_undef)
return 1;
if (id < 193 || id > 255)
{
SSLerr(SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD,SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE);
return 0;
}
MemCheck_off();
comp=(SSL_COMP *)OPENSSL_malloc(sizeof(SSL_COMP));
comp->id=id;
comp->method=cm;
load_builtin_compressions();
if (ssl_comp_methods
&& sk_SSL_COMP_find(ssl_comp_methods,comp) >= 0)
{
OPENSSL_free(comp);
MemCheck_on();
SSLerr(SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD,SSL_R_DUPLICATE_COMPRESSION_ID);
return(1);
}
else if ((ssl_comp_methods == NULL)
|| !sk_SSL_COMP_push(ssl_comp_methods,comp))
{
OPENSSL_free(comp);
MemCheck_on();
SSLerr(SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD,ERR_R_MALLOC_FAILURE);
return(1);
}
else
{
MemCheck_on();
return(0);
}
}
ssl/ssl_ciph.c:1811: error: NULL_DEREFERENCE
pointer `comp` last assigned on line 1810 could be null and is dereferenced at line 1811, column 2.
Showing all 44 steps of the trace
ssl/ssl_ciph.c:1790:1: start of procedure SSL_COMP_add_compression_method()
1788. }
1789.
1790. > int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm)
1791. {
1792. SSL_COMP *comp;
ssl/ssl_ciph.c:1794:13: Taking false branch
1792. SSL_COMP *comp;
1793.
1794. if (cm == NULL || cm->type == NID_undef)
^
1795. return 1;
1796.
ssl/ssl_ciph.c:1794:27: Taking false branch
1792. SSL_COMP *comp;
1793.
1794. if (cm == NULL || cm->type == NID_undef)
^
1795. return 1;
1796.
ssl/ssl_ciph.c:1803:6: Taking false branch
1801. 64 to 192: external party methods assigned by IANA
1802. 193 to 255: reserved for private use */
1803. if (id < 193 || id > 255)
^
1804. {
1805. SSLerr(SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD,SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE);
ssl/ssl_ciph.c:1803:18: Taking false branch
1801. 64 to 192: external party methods assigned by IANA
1802. 193 to 255: reserved for private use */
1803. if (id < 193 || id > 255)
^
1804. {
1805. SSLerr(SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD,SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE);
ssl/ssl_ciph.c:1809:2:
1807. }
1808.
1809. > MemCheck_off();
1810. comp=(SSL_COMP *)OPENSSL_malloc(sizeof(SSL_COMP));
1811. comp->id=id;
crypto/mem_dbg.c:216:1: start of procedure CRYPTO_mem_ctrl()
214. }
215.
216. > int CRYPTO_mem_ctrl(int mode)
217. {
218. int ret=mh_mode;
crypto/mem_dbg.c:218:2:
216. int CRYPTO_mem_ctrl(int mode)
217. {
218. > int ret=mh_mode;
219.
220. CRYPTO_w_lock(CRYPTO_LOCK_MALLOC);
crypto/mem_dbg.c:220:2:
218. int ret=mh_mode;
219.
220. > CRYPTO_w_lock(CRYPTO_LOCK_MALLOC);
221. switch (mode)
222. {
crypto/lock.c:426:1: start of procedure CRYPTO_lock()
424. }
425.
426. > void CRYPTO_lock(int mode, int type, const char *file, int line)
427. {
428. #ifdef LOCK_DEBUG
crypto/lock.c:453:6: Taking false branch
451. }
452. #endif
453. if (type < 0)
^
454. {
455. if (dynlock_lock_callback != NULL)
crypto/lock.c:468:7: Taking true branch
466. }
467. else
468. if (locking_callback != NULL)
^
469. locking_callback(mode,type,file,line);
470. }
crypto/lock.c:469:4: Skipping __function_pointer__(): unresolved function pointer
467. else
468. if (locking_callback != NULL)
469. locking_callback(mode,type,file,line);
^
470. }
471.
crypto/lock.c:453:2:
451. }
452. #endif
453. > if (type < 0)
454. {
455. if (dynlock_lock_callback != NULL)
crypto/lock.c:470:2: return from a call to CRYPTO_lock
468. if (locking_callback != NULL)
469. locking_callback(mode,type,file,line);
470. }
^
471.
472. int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,
crypto/mem_dbg.c:221:2:
219.
220. CRYPTO_w_lock(CRYPTO_LOCK_MALLOC);
221. > switch (mode)
222. {
223. /* for applications (not to be called while multiple threads
crypto/mem_dbg.c:225:2: Switch condition is false. Skipping switch case
223. /* for applications (not to be called while multiple threads
224. * use the library): */
225. case CRYPTO_MEM_CHECK_ON: /* aka MemCheck_start() */
^
226. mh_mode = CRYPTO_MEM_CHECK_ON|CRYPTO_MEM_CHECK_ENABLE;
227. num_disable = 0;
crypto/mem_dbg.c:229:2: Switch condition is false. Skipping switch case
227. num_disable = 0;
228. break;
229. case CRYPTO_MEM_CHECK_OFF: /* aka MemCheck_stop() */
^
230. mh_mode = 0;
231. num_disable = 0; /* should be true *before* MemCheck_stop is used,
crypto/mem_dbg.c:236:2: Switch condition is true. Entering switch case
234.
235. /* switch off temporarily (for library-internal use): */
236. case CRYPTO_MEM_CHECK_DISABLE: /* aka MemCheck_off() */
^
237. if (mh_mode & CRYPTO_MEM_CHECK_ON)
238. {
crypto/mem_dbg.c:237:7: Taking false branch
235. /* switch off temporarily (for library-internal use): */
236. case CRYPTO_MEM_CHECK_DISABLE: /* aka MemCheck_off() */
237. if (mh_mode & CRYPTO_MEM_CHECK_ON)
^
238. {
239. CRYPTO_THREADID cur;
crypto/mem_dbg.c:282:2:
280. break;
281. }
282. > CRYPTO_w_unlock(CRYPTO_LOCK_MALLOC);
283. return(ret);
284. }
crypto/lock.c:426:1: start of procedure CRYPTO_lock()
424. }
425.
426. > void CRYPTO_lock(int mode, int type, const char *file, int line)
427. {
428. #ifdef LOCK_DEBUG
crypto/lock.c:453:6: Taking false branch
451. }
452. #endif
453. if (type < 0)
^
454. {
455. if (dynlock_lock_callback != NULL)
crypto/lock.c:468:7: Taking true branch
466. }
467. else
468. if (locking_callback != NULL)
^
469. locking_callback(mode,type,file,line);
470. }
crypto/lock.c:469:4: Skipping __function_pointer__(): unresolved function pointer
467. else
468. if (locking_callback != NULL)
469. locking_callback(mode,type,file,line);
^
470. }
471.
crypto/lock.c:453:2:
451. }
452. #endif
453. > if (type < 0)
454. {
455. if (dynlock_lock_callback != NULL)
crypto/lock.c:470:2: return from a call to CRYPTO_lock
468. if (locking_callback != NULL)
469. locking_callback(mode,type,file,line);
470. }
^
471.
472. int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,
crypto/mem_dbg.c:283:2:
281. }
282. CRYPTO_w_unlock(CRYPTO_LOCK_MALLOC);
283. > return(ret);
284. }
285.
crypto/mem_dbg.c:284:2: return from a call to CRYPTO_mem_ctrl
282. CRYPTO_w_unlock(CRYPTO_LOCK_MALLOC);
283. return(ret);
284. }
^
285.
286. int CRYPTO_is_mem_check_on(void)
ssl/ssl_ciph.c:1810:2:
1808.
1809. MemCheck_off();
1810. > comp=(SSL_COMP *)OPENSSL_malloc(sizeof(SSL_COMP));
1811. comp->id=id;
1812. comp->method=cm;
crypto/mem.c:297:1: start of procedure CRYPTO_malloc()
295. }
296.
297. > void *CRYPTO_malloc(int num, const char *file, int line)
298. {
299. void *ret = NULL;
crypto/mem.c:299:2:
297. void *CRYPTO_malloc(int num, const char *file, int line)
298. {
299. > void *ret = NULL;
300.
301. if (num <= 0) return NULL;
crypto/mem.c:301:6: Taking false branch
299. void *ret = NULL;
300.
301. if (num <= 0) return NULL;
^
302.
303. allow_customize = 0;
crypto/mem.c:303:2:
301. if (num <= 0) return NULL;
302.
303. > allow_customize = 0;
304. if (malloc_debug_func != NULL)
305. {
crypto/mem.c:304:6: Taking true branch
302.
303. allow_customize = 0;
304. if (malloc_debug_func != NULL)
^
305. {
306. allow_customize_debug = 0;
crypto/mem.c:306:3:
304. if (malloc_debug_func != NULL)
305. {
306. > allow_customize_debug = 0;
307. malloc_debug_func(NULL, num, file, line, 0);
308. }
crypto/mem.c:307:3: Skipping __function_pointer__(): unresolved function pointer
305. {
306. allow_customize_debug = 0;
307. malloc_debug_func(NULL, num, file, line, 0);
^
308. }
309. ret = malloc_ex_func(num,file,line);
crypto/mem.c:309:2: Skipping __function_pointer__(): unresolved function pointer
307. malloc_debug_func(NULL, num, file, line, 0);
308. }
309. ret = malloc_ex_func(num,file,line);
^
310. #ifdef LEVITTE_DEBUG_MEM
311. fprintf(stderr, "LEVITTE_DEBUG_MEM: > 0x%p (%d)\n", ret, num);
crypto/mem.c:313:6: Taking true branch
311. fprintf(stderr, "LEVITTE_DEBUG_MEM: > 0x%p (%d)\n", ret, num);
312. #endif
313. if (malloc_debug_func != NULL)
^
314. malloc_debug_func(ret, num, file, line, 1);
315.
crypto/mem.c:314:3: Skipping __function_pointer__(): unresolved function pointer
312. #endif
313. if (malloc_debug_func != NULL)
314. malloc_debug_func(ret, num, file, line, 1);
^
315.
316. #ifndef OPENSSL_CPUID_OBJ
crypto/mem.c:320:12: Taking false branch
318. * sanitisation function can't be optimised out. NB: We only do
319. * this for >2Kb so the overhead doesn't bother us. */
320. if(ret && (num > 2048))
^
321. { extern unsigned char cleanse_ctr;
322. ((unsigned char *)ret)[0] = cleanse_ctr;
crypto/mem.c:326:2:
324. #endif
325.
326. > return ret;
327. }
328. char *CRYPTO_strdup(const char *str, const char *file, int line)
crypto/mem.c:327:2: return from a call to CRYPTO_malloc
325.
326. return ret;
327. }
^
328. char *CRYPTO_strdup(const char *str, const char *file, int line)
329. {
ssl/ssl_ciph.c:1811:2:
1809. MemCheck_off();
1810. comp=(SSL_COMP *)OPENSSL_malloc(sizeof(SSL_COMP));
1811. > comp->id=id;
1812. comp->method=cm;
1813. load_builtin_compressions();
|
https://github.com/openssl/openssl/blob/2ff5ac55c531de169597110e83873b280c9ea3dd/ssl/ssl_ciph.c/#L1811
|
d2a_code_trace_data_44833
|
int ssl_parse_clienthello_use_srtp_ext(SSL *s, unsigned char *d, int len,int *al)
{
SRTP_PROTECTION_PROFILE *cprof,*sprof;
STACK_OF(SRTP_PROTECTION_PROFILE) *clnt=0,*srvr;
int i,j;
int id;
int ret;
if(len%2)
{
SSLerr(SSL_F_SSL_PARSE_CLIENTHELLO_USE_SRTP_EXT,SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST);
*al=SSL_AD_DECODE_ERROR;
return 1;
}
clnt=sk_SRTP_PROTECTION_PROFILE_new_null();
while(len)
{
n2s(d,id);
len-=2;
if(!find_profile_by_num(id,&cprof))
{
sk_SRTP_PROTECTION_PROFILE_push(clnt,cprof);
}
else
{
;
}
}
srvr=SSL_get_srtp_profiles(s);
for(i=0;i<sk_SRTP_PROTECTION_PROFILE_num(srvr);i++)
{
sprof=sk_SRTP_PROTECTION_PROFILE_value(srvr,i);
for(j=0;j<sk_SRTP_PROTECTION_PROFILE_num(clnt);j++)
{
cprof=sk_SRTP_PROTECTION_PROFILE_value(clnt,j);
if(cprof->id==sprof->id)
{
s->srtp_profile=sprof;
*al=0;
ret=0;
goto done;
}
}
}
ret=0;
done:
if(clnt) sk_SRTP_PROTECTION_PROFILE_free(clnt);
return ret;
}
ssl/d1_srtp.c:323: error: NULL_DEREFERENCE
pointer `clnt` last assigned on line 314 could be null and is dereferenced by call to `sk_push()` at line 323, column 4.
Showing all 32 steps of the trace
ssl/d1_srtp.c:299:1: start of procedure ssl_parse_clienthello_use_srtp_ext()
297.
298.
299. > int ssl_parse_clienthello_use_srtp_ext(SSL *s, unsigned char *d, int len,int *al)
300. {
301. SRTP_PROTECTION_PROFILE *cprof,*sprof;
ssl/d1_srtp.c:302:2:
300. {
301. SRTP_PROTECTION_PROFILE *cprof,*sprof;
302. > STACK_OF(SRTP_PROTECTION_PROFILE) *clnt=0,*srvr;
303. int i,j;
304. int id;
ssl/d1_srtp.c:307:5: Taking false branch
305. int ret;
306.
307. if(len%2)
^
308. {
309. SSLerr(SSL_F_SSL_PARSE_CLIENTHELLO_USE_SRTP_EXT,SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST);
ssl/d1_srtp.c:314:2:
312. }
313.
314. > clnt=sk_SRTP_PROTECTION_PROFILE_new_null();
315.
316. while(len)
crypto/stack/stack.c:115:1: start of procedure sk_new_null()
113. }
114.
115. > _STACK *sk_new_null(void)
116. {
117. return sk_new((int (*)(const void *, const void *))0);
crypto/stack/stack.c:117:2:
115. _STACK *sk_new_null(void)
116. {
117. > return sk_new((int (*)(const void *, const void *))0);
118. }
119.
crypto/stack/stack.c:120:1: start of procedure sk_new()
118. }
119.
120. > _STACK *sk_new(int (*c)(const void *, const void *))
121. {
122. _STACK *ret;
crypto/stack/stack.c:125:6:
123. int i;
124.
125. > if ((ret=OPENSSL_malloc(sizeof(_STACK))) == NULL)
126. goto err;
127. if ((ret->data=OPENSSL_malloc(sizeof(char *)*MIN_NODES)) == NULL)
crypto/mem.c:297:1: start of procedure CRYPTO_malloc()
295. }
296.
297. > void *CRYPTO_malloc(int num, const char *file, int line)
298. {
299. void *ret = NULL;
crypto/mem.c:299:2:
297. void *CRYPTO_malloc(int num, const char *file, int line)
298. {
299. > void *ret = NULL;
300.
301. if (num <= 0) return NULL;
crypto/mem.c:301:6: Taking false branch
299. void *ret = NULL;
300.
301. if (num <= 0) return NULL;
^
302.
303. allow_customize = 0;
crypto/mem.c:303:2:
301. if (num <= 0) return NULL;
302.
303. > allow_customize = 0;
304. if (malloc_debug_func != NULL)
305. {
crypto/mem.c:304:6: Taking false branch
302.
303. allow_customize = 0;
304. if (malloc_debug_func != NULL)
^
305. {
306. allow_customize_debug = 0;
crypto/mem.c:309:2: Skipping __function_pointer__(): unresolved function pointer
307. malloc_debug_func(NULL, num, file, line, 0);
308. }
309. ret = malloc_ex_func(num,file,line);
^
310. #ifdef LEVITTE_DEBUG_MEM
311. fprintf(stderr, "LEVITTE_DEBUG_MEM: > 0x%p (%d)\n", ret, num);
crypto/mem.c:313:6: Taking false branch
311. fprintf(stderr, "LEVITTE_DEBUG_MEM: > 0x%p (%d)\n", ret, num);
312. #endif
313. if (malloc_debug_func != NULL)
^
314. malloc_debug_func(ret, num, file, line, 1);
315.
crypto/mem.c:320:12: Taking false branch
318. * sanitisation function can't be optimised out. NB: We only do
319. * this for >2Kb so the overhead doesn't bother us. */
320. if(ret && (num > 2048))
^
321. { extern unsigned char cleanse_ctr;
322. ((unsigned char *)ret)[0] = cleanse_ctr;
crypto/mem.c:326:2:
324. #endif
325.
326. > return ret;
327. }
328. char *CRYPTO_strdup(const char *str, const char *file, int line)
crypto/mem.c:327:2: return from a call to CRYPTO_malloc
325.
326. return ret;
327. }
^
328. char *CRYPTO_strdup(const char *str, const char *file, int line)
329. {
crypto/stack/stack.c:125:6: Taking true branch
123. int i;
124.
125. if ((ret=OPENSSL_malloc(sizeof(_STACK))) == NULL)
^
126. goto err;
127. if ((ret->data=OPENSSL_malloc(sizeof(char *)*MIN_NODES)) == NULL)
crypto/stack/stack.c:136:1:
134. ret->sorted=0;
135. return(ret);
136. > err:
137. if(ret)
138. OPENSSL_free(ret);
crypto/stack/stack.c:137:5: Taking false branch
135. return(ret);
136. err:
137. if(ret)
^
138. OPENSSL_free(ret);
139. return(NULL);
crypto/stack/stack.c:139:2:
137. if(ret)
138. OPENSSL_free(ret);
139. > return(NULL);
140. }
141.
crypto/stack/stack.c:140:2: return from a call to sk_new
138. OPENSSL_free(ret);
139. return(NULL);
140. }
^
141.
142. int sk_insert(_STACK *st, void *data, int loc)
crypto/stack/stack.c:118:2: return from a call to sk_new_null
116. {
117. return sk_new((int (*)(const void *, const void *))0);
118. }
^
119.
120. _STACK *sk_new(int (*c)(const void *, const void *))
ssl/d1_srtp.c:316:8: Loop condition is true. Entering loop body
314. clnt=sk_SRTP_PROTECTION_PROFILE_new_null();
315.
316. while(len)
^
317. {
318. n2s(d,id);
ssl/d1_srtp.c:318:3:
316. while(len)
317. {
318. > n2s(d,id);
319. len-=2;
320.
ssl/d1_srtp.c:319:3:
317. {
318. n2s(d,id);
319. > len-=2;
320.
321. if(!find_profile_by_num(id,&cprof))
ssl/d1_srtp.c:321:7: Taking true branch
319. len-=2;
320.
321. if(!find_profile_by_num(id,&cprof))
^
322. {
323. sk_SRTP_PROTECTION_PROFILE_push(clnt,cprof);
ssl/d1_srtp.c:323:4: Condition is true
321. if(!find_profile_by_num(id,&cprof))
322. {
323. sk_SRTP_PROTECTION_PROFILE_push(clnt,cprof);
^
324. }
325. else
ssl/d1_srtp.c:323:4: Condition is true
321. if(!find_profile_by_num(id,&cprof))
322. {
323. sk_SRTP_PROTECTION_PROFILE_push(clnt,cprof);
^
324. }
325. else
crypto/stack/stack.c:244:1: start of procedure sk_push()
242. }
243.
244. > int sk_push(_STACK *st, void *data)
245. {
246. return(sk_insert(st,data,st->num));
crypto/stack/stack.c:246:2: Skipping sk_insert(): empty list of specs
244. int sk_push(_STACK *st, void *data)
245. {
246. return(sk_insert(st,data,st->num));
^
247. }
248.
|
https://github.com/openssl/openssl/blob/d674bb4bc84e6e8cf510adfe7049cb19a2c29cf8/ssl/d1_srtp.c/#L323
|
d2a_code_trace_data_44834
|
int 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,
size_t 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);
size_t md_size, md_block_size = 64;
size_t 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;
size_t 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];
size_t i, j;
unsigned md_out_size_u;
EVP_MD_CTX *md_ctx = NULL;
size_t md_length_size = 8;
char length_is_big_endian = 1;
int ret;
OPENSSL_assert(data_plus_mac_plus_padding_size < 1024 * 1024);
switch (EVP_MD_CTX_type(ctx)) {
case NID_md5:
if (MD5_Init((MD5_CTX *)md_state.c) <= 0)
return 0;
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:
if (SHA1_Init((SHA_CTX *)md_state.c) <= 0)
return 0;
md_final_raw = tls1_sha1_final_raw;
md_transform =
(void (*)(void *ctx, const unsigned char *block))SHA1_Transform;
md_size = 20;
break;
case NID_sha224:
if (SHA224_Init((SHA256_CTX *)md_state.c) <= 0)
return 0;
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:
if (SHA256_Init((SHA256_CTX *)md_state.c) <= 0)
return 0;
md_final_raw = tls1_sha256_final_raw;
md_transform =
(void (*)(void *ctx, const unsigned char *block))SHA256_Transform;
md_size = 32;
break;
case NID_sha384:
if (SHA384_Init((SHA512_CTX *)md_state.c) <= 0)
return 0;
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:
if (SHA512_Init((SHA512_CTX *)md_state.c) <= 0)
return 0;
md_final_raw = tls1_sha512_final_raw;
md_transform =
(void (*)(void *ctx, const unsigned char *block))SHA512_Transform;
md_size = 64;
md_block_size = 128;
md_length_size = 16;
break;
default:
OPENSSL_assert(0);
if (md_out_size)
*md_out_size = 0;
return 0;
}
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) {
size_t overhang;
if (header_length <= md_block_size) {
return 0;
}
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_s(i, index_a);
unsigned char is_block_b = constant_time_eq_8_s(i, index_b);
for (j = 0; j < md_block_size; j++) {
unsigned char b = 0, is_past_c, is_past_cp1;
if (k < header_length)
b = header[k];
else if (k < data_plus_mac_plus_padding_size + header_length)
b = data[k - header_length];
k++;
is_past_c = is_block_a & constant_time_ge_8_s(j, c);
is_past_cp1 = is_block_a & constant_time_ge_8_s(j, c + 1);
b = constant_time_select_8(is_past_c, 0x80, b);
b = b & ~is_past_cp1;
b &= ~is_block_b | is_block_a;
if (j >= md_block_size - md_length_size) {
b = constant_time_select_8(is_block_b,
length_bytes[j -
(md_block_size -
md_length_size)], b);
}
block[j] = b;
}
md_transform(md_state.c, block);
md_final_raw(md_state.c, block);
for (j = 0; j < md_size; j++)
mac_out[j] |= block[j] & is_block_b;
}
md_ctx = EVP_MD_CTX_new();
if (md_ctx == NULL)
goto err;
if (EVP_DigestInit_ex(md_ctx, EVP_MD_CTX_md(ctx), NULL ) <= 0)
goto err;
if (is_sslv3) {
memset(hmac_pad, 0x5c, sslv3_pad_length);
if (EVP_DigestUpdate(md_ctx, mac_secret, mac_secret_length) <= 0
|| EVP_DigestUpdate(md_ctx, hmac_pad, sslv3_pad_length) <= 0
|| EVP_DigestUpdate(md_ctx, mac_out, md_size) <= 0)
goto err;
} else {
for (i = 0; i < md_block_size; i++)
hmac_pad[i] ^= 0x6a;
if (EVP_DigestUpdate(md_ctx, hmac_pad, md_block_size) <= 0
|| EVP_DigestUpdate(md_ctx, mac_out, md_size) <= 0)
goto err;
}
ret = EVP_DigestFinal(md_ctx, md_out, &md_out_size_u);
if (ret && md_out_size)
*md_out_size = md_out_size_u;
EVP_MD_CTX_free(md_ctx);
return 1;
err:
EVP_MD_CTX_free(md_ctx);
return 0;
}
ssl/s3_cbc.c:439: error: INTEGER_OVERFLOW_L2
([48, 127] - [48, 120]):unsigned64.
Showing all 5 steps of the trace
ssl/s3_cbc.c:145:5: <LHS trace>
143. void (*md_final_raw) (void *ctx, unsigned char *md_out);
144. void (*md_transform) (void *ctx, const unsigned char *block);
145. size_t md_size, md_block_size = 64;
^
146. size_t sslv3_pad_length = 40, header_length, variance_blocks,
147. len, max_mac_bytes, num_blocks,
ssl/s3_cbc.c:145:5: Assignment
143. void (*md_final_raw) (void *ctx, unsigned char *md_out);
144. void (*md_transform) (void *ctx, const unsigned char *block);
145. size_t md_size, md_block_size = 64;
^
146. size_t sslv3_pad_length = 40, header_length, variance_blocks,
147. len, max_mac_bytes, num_blocks,
ssl/s3_cbc.c:145:5: <RHS trace>
143. void (*md_final_raw) (void *ctx, unsigned char *md_out);
144. void (*md_transform) (void *ctx, const unsigned char *block);
145. size_t md_size, md_block_size = 64;
^
146. size_t sslv3_pad_length = 40, header_length, variance_blocks,
147. len, max_mac_bytes, num_blocks,
ssl/s3_cbc.c:145:5: Assignment
143. void (*md_final_raw) (void *ctx, unsigned char *md_out);
144. void (*md_transform) (void *ctx, const unsigned char *block);
145. size_t md_size, md_block_size = 64;
^
146. size_t sslv3_pad_length = 40, header_length, variance_blocks,
147. len, max_mac_bytes, num_blocks,
ssl/s3_cbc.c:439:44: Binary operation: ([48, 127] - [48, 120]):unsigned64
437. /* If this is index_b, write a length byte. */
438. b = constant_time_select_8(is_block_b,
439. length_bytes[j -
^
440. (md_block_size -
441. md_length_size)], b);
|
https://github.com/openssl/openssl/blob/6438632420cee9821409221ef6717edc5ee408c1/ssl/s3_cbc.c/#L439
|
d2a_code_trace_data_44835
|
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/recordlentest.c:140: error: INTEGER_OVERFLOW_L2
([0, +oo] - 1):unsigned64 by call to `SSL_accept`.
Showing all 21 steps of the trace
test/recordlentest.c:121:10: Call
119. }
120.
121. if (!create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL, NULL)) {
^
122. printf("Unable to create SSL objects\n");
123. goto end;
test/ssltestlib.c:579:21: Call
577.
578. if (*sssl == NULL)
579. serverssl = SSL_new(serverctx);
^
580. else
581. serverssl = *sssl;
ssl/ssl_lib.c:523:1: Parameter `ctx->sessions->num_items`
521. }
522.
523. > SSL *SSL_new(SSL_CTX *ctx)
524. {
525. SSL *s;
test/recordlentest.c:140:13: Call
138. }
139.
140. if (SSL_accept(serverssl) > 0) {
^
141. printf("Unexpected success reading plaintext record\n");
142. goto end;
ssl/ssl_lib.c:1460:1: Parameter `s->session_ctx->sessions->num_items`
1458. }
1459.
1460. > int SSL_accept(SSL *s)
1461. {
1462. if (s->handshake_func == NULL) {
ssl/ssl_lib.c:1467:12: Call
1465. }
1466.
1467. return SSL_do_handshake(s);
^
1468. }
1469.
ssl/ssl_lib.c:3246:1: Parameter `s->session_ctx->sessions->num_items`
3244. }
3245.
3246. > int SSL_do_handshake(SSL *s)
3247. {
3248. int ret = 1;
ssl/ssl_lib.c:3258:17: Call
3256. int edfin;
3257.
3258. edfin = ssl_write_early_finish(s);
^
3259. if (edfin <= 0)
3260. return edfin;
ssl/ssl_lib.c:1866:1: Parameter `s->session_ctx->sessions->num_items`
1864. }
1865.
1866. > static int ssl_write_early_finish(SSL *s)
1867. {
1868. int ret;
ssl/ssl_lib.c:1876:11: Call
1874.
1875. s->early_data_state = SSL_EARLY_DATA_WRITING;
1876. ret = ssl3_send_alert(s, SSL3_AL_WARNING, SSL_AD_END_OF_EARLY_DATA);
^
1877. if (ret <= 0) {
1878. s->early_data_state = SSL_EARLY_DATA_WRITE_RETRY;
ssl/s3_msg.c:63:1: Parameter `s->session_ctx->sessions->num_items`
61. }
62.
63. > int ssl3_send_alert(SSL *s, int level, int desc)
64. {
65. /* Map tls/ssl alert value to correct one */
ssl/s3_msg.c:77:9: Call
75. /* If a fatal one, remove from cache */
76. if ((level == SSL3_AL_FATAL) && (s->session != NULL))
77. SSL_CTX_remove_session(s->session_ctx, s->session);
^
78.
79. s->s3->alert_dispatch = 1;
ssl/ssl_sess.c:724:1: Parameter `ctx->sessions->num_items`
722. }
723.
724. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
725. {
726. return remove_session_lock(ctx, c, 1);
ssl/ssl_sess.c:726:12: Call
724. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
725. {
726. return remove_session_lock(ctx, c, 1);
^
727. }
728.
ssl/ssl_sess.c:729:1: Parameter `ctx->sessions->num_items`
727. }
728.
729. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck)
730. {
731. SSL_SESSION *r;
ssl/ssl_sess.c:739:17: Call
737. if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) == c) {
738. ret = 1;
739. r = lh_SSL_SESSION_delete(ctx->sessions, c);
^
740. SSL_SESSION_list_remove(ctx, c);
741. }
ssl/ssl_locl.h:688:1: Parameter `lh->num_items`
686. } CLIENTHELLO_MSG;
687.
688. > DEFINE_LHASH_OF(SSL_SESSION);
689. /* Needed in ssl_cert.c */
690. DEFINE_LHASH_OF(X509_NAME);
ssl/ssl_locl.h:688:1: Call
686. } CLIENTHELLO_MSG;
687.
688. > DEFINE_LHASH_OF(SSL_SESSION);
689. /* Needed in ssl_cert.c */
690. 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_accept`
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/ee6d9dfb39ff90a31027c51b80362d274918e3dd/crypto/lhash/lhash.c/#L123
|
d2a_code_trace_data_44836
|
static av_always_inline int epzs_motion_search_internal(MpegEncContext * s, int *mx_ptr, int *my_ptr,
int P[10][2], int src_index, int ref_index, int16_t (*last_mv)[2],
int ref_mv_scale, int flags, int size, int h)
{
MotionEstContext * const c= &s->me;
int best[2]={0, 0};
int d;
int dmin;
int map_generation;
int penalty_factor;
const int ref_mv_stride= s->mb_stride;
const int ref_mv_xy= s->mb_x + s->mb_y*ref_mv_stride;
me_cmp_func cmpf, chroma_cmpf;
LOAD_COMMON
LOAD_COMMON2
if(c->pre_pass){
penalty_factor= c->pre_penalty_factor;
cmpf= s->dsp.me_pre_cmp[size];
chroma_cmpf= s->dsp.me_pre_cmp[size+1];
}else{
penalty_factor= c->penalty_factor;
cmpf= s->dsp.me_cmp[size];
chroma_cmpf= s->dsp.me_cmp[size+1];
}
map_generation= update_map_generation(c);
assert(cmpf);
dmin= cmp(s, 0, 0, 0, 0, size, h, ref_index, src_index, cmpf, chroma_cmpf, flags);
map[0]= map_generation;
score_map[0]= dmin;
if((s->pict_type == FF_B_TYPE && !(c->flags & FLAG_DIRECT)) || s->flags&CODEC_FLAG_MV0)
dmin += (mv_penalty[pred_x] + mv_penalty[pred_y])*penalty_factor;
if (s->first_slice_line) {
CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift)
CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
}else{
if(dmin<((h*h*s->avctx->mv0_threshold)>>8)
&& ( P_LEFT[0] |P_LEFT[1]
|P_TOP[0] |P_TOP[1]
|P_TOPRIGHT[0]|P_TOPRIGHT[1])==0){
*mx_ptr= 0;
*my_ptr= 0;
c->skip=1;
return dmin;
}
CHECK_MV( P_MEDIAN[0] >>shift , P_MEDIAN[1] >>shift)
CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift) , (P_MEDIAN[1]>>shift)-1)
CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift) , (P_MEDIAN[1]>>shift)+1)
CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift)-1, (P_MEDIAN[1]>>shift) )
CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift)+1, (P_MEDIAN[1]>>shift) )
CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
CHECK_MV(P_LEFT[0] >>shift, P_LEFT[1] >>shift)
CHECK_MV(P_TOP[0] >>shift, P_TOP[1] >>shift)
CHECK_MV(P_TOPRIGHT[0]>>shift, P_TOPRIGHT[1]>>shift)
}
if(dmin>h*h*4){
if(c->pre_pass){
CHECK_CLIPPED_MV((last_mv[ref_mv_xy-1][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy-1][1]*ref_mv_scale + (1<<15))>>16)
if(!s->first_slice_line)
CHECK_CLIPPED_MV((last_mv[ref_mv_xy-ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy-ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16)
}else{
CHECK_CLIPPED_MV((last_mv[ref_mv_xy+1][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy+1][1]*ref_mv_scale + (1<<15))>>16)
if(s->mb_y+1<s->end_mb_y)
CHECK_CLIPPED_MV((last_mv[ref_mv_xy+ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy+ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16)
}
}
if(c->avctx->last_predictor_count){
const int count= c->avctx->last_predictor_count;
const int xstart= FFMAX(0, s->mb_x - count);
const int ystart= FFMAX(0, s->mb_y - count);
const int xend= FFMIN(s->mb_width , s->mb_x + count + 1);
const int yend= FFMIN(s->mb_height, s->mb_y + count + 1);
int mb_y;
for(mb_y=ystart; mb_y<yend; mb_y++){
int mb_x;
for(mb_x=xstart; mb_x<xend; mb_x++){
const int xy= mb_x + 1 + (mb_y + 1)*ref_mv_stride;
int mx= (last_mv[xy][0]*ref_mv_scale + (1<<15))>>16;
int my= (last_mv[xy][1]*ref_mv_scale + (1<<15))>>16;
if(mx>xmax || mx<xmin || my>ymax || my<ymin) continue;
CHECK_MV(mx,my)
}
}
}
dmin= diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
*mx_ptr= best[0];
*my_ptr= best[1];
return dmin;
}
libavcodec/motion_est_template.c:1072: error: Uninitialized Value
The value read from xmin was never initialized.
libavcodec/motion_est_template.c:1072:17:
1070. (last_mv[ref_mv_xy-1][1]*ref_mv_scale + (1<<15))>>16)
1071. if(!s->first_slice_line)
1072. CHECK_CLIPPED_MV((last_mv[ref_mv_xy-ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16,
^
1073. (last_mv[ref_mv_xy-ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16)
1074. }else{
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1072
|
d2a_code_trace_data_44837
|
static int vp3_decode_frame(AVCodecContext *avctx,
void *data, int *got_frame,
AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
Vp3DecodeContext *s = avctx->priv_data;
GetBitContext gb;
int i, ret;
init_get_bits(&gb, buf, buf_size * 8);
if (s->theora && get_bits1(&gb)) {
av_log(avctx, AV_LOG_ERROR,
"Header packet passed to frame decoder, skipping\n");
return -1;
}
s->keyframe = !get_bits1(&gb);
if (!s->theora)
skip_bits(&gb, 1);
for (i = 0; i < 3; i++)
s->last_qps[i] = s->qps[i];
s->nqps = 0;
do {
s->qps[s->nqps++] = get_bits(&gb, 6);
} while (s->theora >= 0x030200 && s->nqps < 3 && get_bits1(&gb));
for (i = s->nqps; i < 3; i++)
s->qps[i] = -1;
if (s->avctx->debug & FF_DEBUG_PICT_INFO)
av_log(s->avctx, AV_LOG_INFO, " VP3 %sframe #%d: Q index = %d\n",
s->keyframe ? "key" : "", avctx->frame_number + 1, s->qps[0]);
s->skip_loop_filter = !s->filter_limit_values[s->qps[0]] ||
avctx->skip_loop_filter >= (s->keyframe ? AVDISCARD_ALL
: AVDISCARD_NONKEY);
if (s->qps[0] != s->last_qps[0])
init_loop_filter(s);
for (i = 0; i < s->nqps; i++)
if (s->qps[i] != s->last_qps[i] || s->qps[0] != s->last_qps[0])
init_dequantizer(s, i);
if (avctx->skip_frame >= AVDISCARD_NONKEY && !s->keyframe)
return buf_size;
s->current_frame.f->pict_type = s->keyframe ? AV_PICTURE_TYPE_I
: AV_PICTURE_TYPE_P;
if (ff_thread_get_buffer(avctx, &s->current_frame, AV_GET_BUFFER_FLAG_REF) < 0) {
av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
goto error;
}
if (!s->edge_emu_buffer)
s->edge_emu_buffer = av_malloc(9 * FFABS(s->current_frame.f->linesize[0]));
if (s->keyframe) {
if (!s->theora) {
skip_bits(&gb, 4);
skip_bits(&gb, 4);
if (s->version) {
s->version = get_bits(&gb, 5);
if (avctx->frame_number == 0)
av_log(s->avctx, AV_LOG_DEBUG,
"VP version: %d\n", s->version);
}
}
if (s->version || s->theora) {
if (get_bits1(&gb))
av_log(s->avctx, AV_LOG_ERROR,
"Warning, unsupported keyframe coding type?!\n");
skip_bits(&gb, 2);
}
} else {
if (!s->golden_frame.f->data[0]) {
av_log(s->avctx, AV_LOG_WARNING,
"vp3: first frame not a keyframe\n");
s->golden_frame.f->pict_type = AV_PICTURE_TYPE_I;
if (ff_thread_get_buffer(avctx, &s->golden_frame,
AV_GET_BUFFER_FLAG_REF) < 0) {
av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
goto error;
}
ff_thread_release_buffer(avctx, &s->last_frame);
if ((ret = ff_thread_ref_frame(&s->last_frame,
&s->golden_frame)) < 0)
goto error;
ff_thread_report_progress(&s->last_frame, INT_MAX, 0);
}
}
memset(s->all_fragments, 0, s->fragment_count * sizeof(Vp3Fragment));
ff_thread_finish_setup(avctx);
if (unpack_superblocks(s, &gb)) {
av_log(s->avctx, AV_LOG_ERROR, "error in unpack_superblocks\n");
goto error;
}
if (unpack_modes(s, &gb)) {
av_log(s->avctx, AV_LOG_ERROR, "error in unpack_modes\n");
goto error;
}
if (unpack_vectors(s, &gb)) {
av_log(s->avctx, AV_LOG_ERROR, "error in unpack_vectors\n");
goto error;
}
if (unpack_block_qpis(s, &gb)) {
av_log(s->avctx, AV_LOG_ERROR, "error in unpack_block_qpis\n");
goto error;
}
if (unpack_dct_coeffs(s, &gb)) {
av_log(s->avctx, AV_LOG_ERROR, "error in unpack_dct_coeffs\n");
goto error;
}
for (i = 0; i < 3; i++) {
int height = s->height >> (i && s->chroma_y_shift);
if (s->flipped_image)
s->data_offset[i] = 0;
else
s->data_offset[i] = (height - 1) * s->current_frame.f->linesize[i];
}
s->last_slice_end = 0;
for (i = 0; i < s->c_superblock_height; i++)
render_slice(s, i);
for (i = 0; i < 3; i++) {
int row = (s->height >> (3 + (i && s->chroma_y_shift))) - 1;
apply_loop_filter(s, i, row, row + 1);
}
vp3_draw_horiz_band(s, s->avctx->height);
if ((ret = av_frame_ref(data, s->current_frame.f)) < 0)
return ret;
*got_frame = 1;
if (!HAVE_THREADS || !(s->avctx->active_thread_type & FF_THREAD_FRAME)) {
ret = update_frames(avctx);
if (ret < 0)
return ret;
}
return buf_size;
error:
ff_thread_report_progress(&s->current_frame, INT_MAX, 0);
if (!HAVE_THREADS || !(s->avctx->active_thread_type & FF_THREAD_FRAME))
av_frame_unref(s->current_frame.f);
return -1;
}
libavcodec/vp3.c:1992: error: Null Dereference
pointer `&gb->buffer` last assigned on line 1990 could be null and is dereferenced by call to `get_bits1()` at line 1992, column 22.
libavcodec/vp3.c:1980:1: start of procedure vp3_decode_frame()
1978. }
1979.
1980. static int vp3_decode_frame(AVCodecContext *avctx,
^
1981. void *data, int *got_frame,
1982. AVPacket *avpkt)
libavcodec/vp3.c:1984:5:
1982. AVPacket *avpkt)
1983. {
1984. const uint8_t *buf = avpkt->data;
^
1985. int buf_size = avpkt->size;
1986. Vp3DecodeContext *s = avctx->priv_data;
libavcodec/vp3.c:1985:5:
1983. {
1984. const uint8_t *buf = avpkt->data;
1985. int buf_size = avpkt->size;
^
1986. Vp3DecodeContext *s = avctx->priv_data;
1987. GetBitContext gb;
libavcodec/vp3.c:1986:5:
1984. const uint8_t *buf = avpkt->data;
1985. int buf_size = avpkt->size;
1986. Vp3DecodeContext *s = avctx->priv_data;
^
1987. GetBitContext gb;
1988. int i, ret;
libavcodec/vp3.c:1990:5:
1988. int i, ret;
1989.
1990. init_get_bits(&gb, buf, buf_size * 8);
^
1991.
1992. if (s->theora && get_bits1(&gb)) {
libavcodec/get_bits.h:376:1: start of procedure init_get_bits()
374. * @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow.
375. */
376. static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer,
^
377. int bit_size)
378. {
libavcodec/get_bits.h:380:5:
378. {
379. int buffer_size;
380. int ret = 0;
^
381.
382. if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) {
libavcodec/get_bits.h:382:9: Taking true branch
380. int ret = 0;
381.
382. if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) {
^
383. bit_size = 0;
384. buffer = NULL;
libavcodec/get_bits.h:383:9:
381.
382. if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) {
383. bit_size = 0;
^
384. buffer = NULL;
385. ret = AVERROR_INVALIDDATA;
libavcodec/get_bits.h:384:9:
382. if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) {
383. bit_size = 0;
384. buffer = NULL;
^
385. ret = AVERROR_INVALIDDATA;
386. }
libavcodec/get_bits.h:385:9:
383. bit_size = 0;
384. buffer = NULL;
385. ret = AVERROR_INVALIDDATA;
^
386. }
387.
libavcodec/get_bits.h:388:5:
386. }
387.
388. buffer_size = (bit_size + 7) >> 3;
^
389.
390. s->buffer = buffer;
libavcodec/get_bits.h:390:5:
388. buffer_size = (bit_size + 7) >> 3;
389.
390. s->buffer = buffer;
^
391. s->size_in_bits = bit_size;
392. #if !UNCHECKED_BITSTREAM_READER
libavcodec/get_bits.h:391:5:
389.
390. s->buffer = buffer;
391. s->size_in_bits = bit_size;
^
392. #if !UNCHECKED_BITSTREAM_READER
393. s->size_in_bits_plus8 = bit_size + 8;
libavcodec/get_bits.h:393:5:
391. s->size_in_bits = bit_size;
392. #if !UNCHECKED_BITSTREAM_READER
393. s->size_in_bits_plus8 = bit_size + 8;
^
394. #endif
395. s->buffer_end = buffer + buffer_size;
libavcodec/get_bits.h:395:5:
393. s->size_in_bits_plus8 = bit_size + 8;
394. #endif
395. s->buffer_end = buffer + buffer_size;
^
396. s->index = 0;
397.
libavcodec/get_bits.h:396:5:
394. #endif
395. s->buffer_end = buffer + buffer_size;
396. s->index = 0;
^
397.
398. return ret;
libavcodec/get_bits.h:398:5:
396. s->index = 0;
397.
398. return ret;
^
399. }
400.
libavcodec/get_bits.h:399:1: return from a call to init_get_bits
397.
398. return ret;
399. }
^
400.
401. /**
libavcodec/vp3.c:1992:9: Taking true branch
1990. init_get_bits(&gb, buf, buf_size * 8);
1991.
1992. if (s->theora && get_bits1(&gb)) {
^
1993. av_log(avctx, AV_LOG_ERROR,
1994. "Header packet passed to frame decoder, skipping\n");
libavcodec/vp3.c:1992:22:
1990. init_get_bits(&gb, buf, buf_size * 8);
1991.
1992. if (s->theora && get_bits1(&gb)) {
^
1993. av_log(avctx, AV_LOG_ERROR,
1994. "Header packet passed to frame decoder, skipping\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/vp3.c/#L1992
|
d2a_code_trace_data_44838
|
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:1214: error: INTEGER_OVERFLOW_L2
([0, +oo] - [`pkt->written`, `pkt->written` + 6]):unsigned64 by call to `WPACKET_put_bytes__`.
Showing all 12 steps of the trace
ssl/statem/extensions_srvr.c:1213:21: Call
1211.
1212. if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_early_data)
1213. || !WPACKET_start_sub_packet_u16(pkt)
^
1214. || !WPACKET_put_bytes_u32(pkt, s->max_early_data)
1215. || !WPACKET_close(pkt)) {
ssl/packet.c:270:1: Parameter `pkt->buf->length`
268. }
269.
270. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes)
271. {
272. WPACKET_SUB *sub;
ssl/statem/extensions_srvr.c:1214:21: Call
1212. if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_early_data)
1213. || !WPACKET_start_sub_packet_u16(pkt)
1214. || !WPACKET_put_bytes_u32(pkt, s->max_early_data)
^
1215. || !WPACKET_close(pkt)) {
1216. SSLerr(SSL_F_TLS_CONSTRUCT_STOC_EARLY_DATA, 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 + 6]):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_44839
|
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/decode.c:422: error: Null Dereference
pointer `desc` last assigned on line 421 could be null and is dereferenced at line 422, column 12.
libavcodec/decode.c:419:1: start of procedure is_hwaccel_pix_fmt()
417. }
418.
419. static int is_hwaccel_pix_fmt(enum AVPixelFormat pix_fmt)
^
420. {
421. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
libavcodec/decode.c:421:5:
419. static int is_hwaccel_pix_fmt(enum AVPixelFormat pix_fmt)
420. {
421. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
^
422. return desc->flags & AV_PIX_FMT_FLAG_HWACCEL;
423. }
libavutil/pixdesc.c:1914:1: start of procedure av_pix_fmt_desc_get()
1912. }
1913.
1914. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
^
1915. {
1916. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
libavutil/pixdesc.c:1916:9: Taking false branch
1914. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
1915. {
1916. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
^
1917. return NULL;
1918. return &av_pix_fmt_descriptors[pix_fmt];
libavutil/pixdesc.c:1916:24: Taking true branch
1914. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
1915. {
1916. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
^
1917. return NULL;
1918. return &av_pix_fmt_descriptors[pix_fmt];
libavutil/pixdesc.c:1917:9:
1915. {
1916. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
1917. return NULL;
^
1918. return &av_pix_fmt_descriptors[pix_fmt];
1919. }
libavutil/pixdesc.c:1919:1: return from a call to av_pix_fmt_desc_get
1917. return NULL;
1918. return &av_pix_fmt_descriptors[pix_fmt];
1919. }
^
1920.
1921. const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)
libavcodec/decode.c:422:5:
420. {
421. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
422. return desc->flags & AV_PIX_FMT_FLAG_HWACCEL;
^
423. }
424.
|
https://github.com/libav/libav/blob/3fe2a01df7f2c193805809f57b61d79607572351/libavcodec/decode.c/#L422
|
d2a_code_trace_data_44840
|
int 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,
size_t 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);
size_t md_size, md_block_size = 64;
size_t 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;
size_t 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];
size_t i, j;
unsigned md_out_size_u;
EVP_MD_CTX *md_ctx = NULL;
size_t md_length_size = 8;
char length_is_big_endian = 1;
int ret;
if (!ossl_assert(data_plus_mac_plus_padding_size < 1024 * 1024))
return 0;
switch (EVP_MD_CTX_type(ctx)) {
case NID_md5:
if (MD5_Init((MD5_CTX *)md_state.c) <= 0)
return 0;
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:
if (SHA1_Init((SHA_CTX *)md_state.c) <= 0)
return 0;
md_final_raw = tls1_sha1_final_raw;
md_transform =
(void (*)(void *ctx, const unsigned char *block))SHA1_Transform;
md_size = 20;
break;
case NID_sha224:
if (SHA224_Init((SHA256_CTX *)md_state.c) <= 0)
return 0;
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:
if (SHA256_Init((SHA256_CTX *)md_state.c) <= 0)
return 0;
md_final_raw = tls1_sha256_final_raw;
md_transform =
(void (*)(void *ctx, const unsigned char *block))SHA256_Transform;
md_size = 32;
break;
case NID_sha384:
if (SHA384_Init((SHA512_CTX *)md_state.c) <= 0)
return 0;
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:
if (SHA512_Init((SHA512_CTX *)md_state.c) <= 0)
return 0;
md_final_raw = tls1_sha512_final_raw;
md_transform =
(void (*)(void *ctx, const unsigned char *block))SHA512_Transform;
md_size = 64;
md_block_size = 128;
md_length_size = 16;
break;
default:
if (md_out_size != NULL)
*md_out_size = 0;
return ossl_assert(0);
}
if (!ossl_assert(md_length_size <= MAX_HASH_BIT_COUNT_BYTES)
|| !ossl_assert(md_block_size <= MAX_HASH_BLOCK_SIZE)
|| !ossl_assert(md_size <= EVP_MAX_MD_SIZE))
return 0;
header_length = 13;
if (is_sslv3) {
header_length = mac_secret_length + sslv3_pad_length + 8 +
1 +
2 ;
}
variance_blocks = is_sslv3 ? 2 : ( ((255 + 1 + md_size + md_block_size - 1) / md_block_size) + 1);
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);
if (!ossl_assert(mac_secret_length <= sizeof(hmac_pad)))
return 0;
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) {
size_t overhang;
if (header_length <= md_block_size) {
return 0;
}
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_s(i, index_a);
unsigned char is_block_b = constant_time_eq_8_s(i, index_b);
for (j = 0; j < md_block_size; j++) {
unsigned char b = 0, is_past_c, is_past_cp1;
if (k < header_length)
b = header[k];
else if (k < data_plus_mac_plus_padding_size + header_length)
b = data[k - header_length];
k++;
is_past_c = is_block_a & constant_time_ge_8_s(j, c);
is_past_cp1 = is_block_a & constant_time_ge_8_s(j, c + 1);
b = constant_time_select_8(is_past_c, 0x80, b);
b = b & ~is_past_cp1;
b &= ~is_block_b | is_block_a;
if (j >= md_block_size - md_length_size) {
b = constant_time_select_8(is_block_b,
length_bytes[j -
(md_block_size -
md_length_size)], b);
}
block[j] = b;
}
md_transform(md_state.c, block);
md_final_raw(md_state.c, block);
for (j = 0; j < md_size; j++)
mac_out[j] |= block[j] & is_block_b;
}
md_ctx = EVP_MD_CTX_new();
if (md_ctx == NULL)
goto err;
if (EVP_DigestInit_ex(md_ctx, EVP_MD_CTX_md(ctx), NULL ) <= 0)
goto err;
if (is_sslv3) {
memset(hmac_pad, 0x5c, sslv3_pad_length);
if (EVP_DigestUpdate(md_ctx, mac_secret, mac_secret_length) <= 0
|| EVP_DigestUpdate(md_ctx, hmac_pad, sslv3_pad_length) <= 0
|| EVP_DigestUpdate(md_ctx, mac_out, md_size) <= 0)
goto err;
} else {
for (i = 0; i < md_block_size; i++)
hmac_pad[i] ^= 0x6a;
if (EVP_DigestUpdate(md_ctx, hmac_pad, md_block_size) <= 0
|| EVP_DigestUpdate(md_ctx, mac_out, md_size) <= 0)
goto err;
}
ret = EVP_DigestFinal(md_ctx, md_out, &md_out_size_u);
if (ret && md_out_size)
*md_out_size = md_out_size_u;
EVP_MD_CTX_free(md_ctx);
return 1;
err:
EVP_MD_CTX_free(md_ctx);
return 0;
}
ssl/record/ssl3_record.c:1235: error: BUFFER_OVERRUN_L3
Offset added: [-63, +oo] Size: 128 by call to `ssl3_cbc_digest_record`.
Showing all 11 steps of the trace
ssl/record/ssl3_record.c:1199:9: Call
1197. }
1198.
1199. t = EVP_MD_CTX_size(hash);
^
1200. if (t < 0)
1201. return 0;
crypto/evp/evp_lib.c:318:9: Assignment
316. if (!md) {
317. EVPerr(EVP_F_EVP_MD_SIZE, EVP_R_MESSAGE_DIGEST_IS_NULL);
318. return -1;
^
319. }
320.
ssl/record/ssl3_record.c:1199:5: Assignment
1197. }
1198.
1199. t = EVP_MD_CTX_size(hash);
^
1200. if (t < 0)
1201. return 0;
ssl/record/ssl3_record.c:1202:5: Assignment
1200. if (t < 0)
1201. return 0;
1202. md_size = t;
^
1203. npad = (48 / md_size) * md_size;
1204.
ssl/record/ssl3_record.c:1235:13: Call
1233.
1234. /* Final param == is SSLv3 */
1235. if (ssl3_cbc_digest_record(hash,
^
1236. md, &md_size,
1237. header, rec->input,
ssl/s3_cbc.c:144:5: <Offset trace>
142. void (*md_final_raw) (void *ctx, unsigned char *md_out);
143. void (*md_transform) (void *ctx, const unsigned char *block);
144. size_t md_size, md_block_size = 64;
^
145. size_t sslv3_pad_length = 40, header_length, variance_blocks,
146. len, max_mac_bytes, num_blocks,
ssl/s3_cbc.c:144:5: Assignment
142. void (*md_final_raw) (void *ctx, unsigned char *md_out);
143. void (*md_transform) (void *ctx, const unsigned char *block);
144. size_t md_size, md_block_size = 64;
^
145. size_t sslv3_pad_length = 40, header_length, variance_blocks,
146. len, max_mac_bytes, num_blocks,
ssl/s3_cbc.c:377:13: Assignment
375. return 0;
376. }
377. overhang = header_length - md_block_size;
^
378. md_transform(md_state.c, header);
379. memcpy(first_block, header + md_block_size, overhang);
ssl/s3_cbc.c:128:1: <Length trace>
126. * Returns 1 on success or 0 on error
127. */
128. > int ssl3_cbc_digest_record(const EVP_MD_CTX *ctx,
129. unsigned char *md_out,
130. size_t *md_out_size,
ssl/s3_cbc.c:128:1: Array declaration
126. * Returns 1 on success or 0 on error
127. */
128. > int ssl3_cbc_digest_record(const EVP_MD_CTX *ctx,
129. unsigned char *md_out,
130. size_t *md_out_size,
ssl/s3_cbc.c:379:13: Array access: Offset added: [-63, +oo] Size: 128 by call to `ssl3_cbc_digest_record`
377. overhang = header_length - md_block_size;
378. md_transform(md_state.c, header);
379. memcpy(first_block, header + md_block_size, overhang);
^
380. memcpy(first_block + overhang, data, md_block_size - overhang);
381. md_transform(md_state.c, first_block);
|
https://github.com/openssl/openssl/blob/866cc2334c95c8602eb4d018bfc224357c47b511/ssl/s3_cbc.c/#L379
|
d2a_code_trace_data_44841
|
AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
{
AVFilterBufferRef *ret = NULL;
av_unused char buf[16];
FF_DPRINTF_START(NULL, get_video_buffer); ff_dlog_link(NULL, link, 0);
av_dlog(NULL, " perms:%s w:%d h:%d\n", ff_get_ref_perms_string(buf, sizeof(buf), perms), w, h);
if (link->dstpad->get_video_buffer)
ret = link->dstpad->get_video_buffer(link, perms, w, h);
if (!ret)
ret = avfilter_default_get_video_buffer(link, perms, w, h);
if (ret)
ret->type = AVMEDIA_TYPE_VIDEO;
FF_DPRINTF_START(NULL, get_video_buffer); ff_dlog_link(NULL, link, 0); av_dlog(NULL, " returning "); ff_dlog_ref(NULL, ret, 1);
return ret;
}
libavfilter/avfilter.c:303: error: Null Dereference
pointer `ret` last assigned on line 298 could be null and is dereferenced by call to `ff_dlog_ref()` at line 303, column 106.
libavfilter/avfilter.c:286:1: start of procedure avfilter_get_video_buffer()
284. #define FF_DPRINTF_START(ctx, func) av_dlog(NULL, "%-16s: ", #func)
285.
286. AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
^
287. {
288. AVFilterBufferRef *ret = NULL;
libavfilter/avfilter.c:288:5:
286. AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
287. {
288. AVFilterBufferRef *ret = NULL;
^
289.
290. av_unused char buf[16];
libavfilter/avfilter.c:291:47:
289.
290. av_unused char buf[16];
291. FF_DPRINTF_START(NULL, get_video_buffer); ff_dlog_link(NULL, link, 0);
^
292. av_dlog(NULL, " perms:%s w:%d h:%d\n", ff_get_ref_perms_string(buf, sizeof(buf), perms), w, h);
293.
libavfilter/avfilter.c:260:1: start of procedure ff_dlog_link()
258. }
259.
260. static void ff_dlog_link(void *ctx, AVFilterLink *link, int end)
^
261. {
262. if (link->type == AVMEDIA_TYPE_VIDEO) {
libavfilter/avfilter.c:262:9: Taking false branch
260. static void ff_dlog_link(void *ctx, AVFilterLink *link, int end)
261. {
262. if (link->type == AVMEDIA_TYPE_VIDEO) {
^
263. av_dlog(ctx,
264. "link[%p s:%dx%d fmt:%-16s %-16s->%-16s]%s",
libavfilter/avfilter.c:272:9: Skipping av_get_channel_layout_string(): empty list of specs
270. } else {
271. char buf[128];
272. av_get_channel_layout_string(buf, sizeof(buf), -1, link->channel_layout);
^
273.
274. av_dlog(ctx,
libavfilter/avfilter.c:262:5:
260. static void ff_dlog_link(void *ctx, AVFilterLink *link, int end)
261. {
262. if (link->type == AVMEDIA_TYPE_VIDEO) {
^
263. av_dlog(ctx,
264. "link[%p s:%dx%d fmt:%-16s %-16s->%-16s]%s",
libavfilter/avfilter.c:282:1: return from a call to ff_dlog_link
280. end ? "\n" : "");
281. }
282. }
^
283.
284. #define FF_DPRINTF_START(ctx, func) av_dlog(NULL, "%-16s: ", #func)
libavfilter/avfilter.c:294:9: Taking true branch
292. av_dlog(NULL, " perms:%s w:%d h:%d\n", ff_get_ref_perms_string(buf, sizeof(buf), perms), w, h);
293.
294. if (link->dstpad->get_video_buffer)
^
295. ret = link->dstpad->get_video_buffer(link, perms, w, h);
296.
libavfilter/avfilter.c:295:9: Skipping __function_pointer__(): unresolved function pointer
293.
294. if (link->dstpad->get_video_buffer)
295. ret = link->dstpad->get_video_buffer(link, perms, w, h);
^
296.
297. if (!ret)
libavfilter/avfilter.c:297:10: Taking true branch
295. ret = link->dstpad->get_video_buffer(link, perms, w, h);
296.
297. if (!ret)
^
298. ret = avfilter_default_get_video_buffer(link, perms, w, h);
299.
libavfilter/avfilter.c:298:9: Skipping avfilter_default_get_video_buffer(): empty list of specs
296.
297. if (!ret)
298. ret = avfilter_default_get_video_buffer(link, perms, w, h);
^
299.
300. if (ret)
libavfilter/avfilter.c:300:9: Taking false branch
298. ret = avfilter_default_get_video_buffer(link, perms, w, h);
299.
300. if (ret)
^
301. ret->type = AVMEDIA_TYPE_VIDEO;
302.
libavfilter/avfilter.c:303:47:
301. ret->type = AVMEDIA_TYPE_VIDEO;
302.
303. FF_DPRINTF_START(NULL, get_video_buffer); ff_dlog_link(NULL, link, 0); av_dlog(NULL, " returning "); ff_dlog_ref(NULL, ret, 1);
^
304.
305. return ret;
libavfilter/avfilter.c:260:1: start of procedure ff_dlog_link()
258. }
259.
260. static void ff_dlog_link(void *ctx, AVFilterLink *link, int end)
^
261. {
262. if (link->type == AVMEDIA_TYPE_VIDEO) {
libavfilter/avfilter.c:262:9: Taking false branch
260. static void ff_dlog_link(void *ctx, AVFilterLink *link, int end)
261. {
262. if (link->type == AVMEDIA_TYPE_VIDEO) {
^
263. av_dlog(ctx,
264. "link[%p s:%dx%d fmt:%-16s %-16s->%-16s]%s",
libavfilter/avfilter.c:272:9: Skipping av_get_channel_layout_string(): empty list of specs
270. } else {
271. char buf[128];
272. av_get_channel_layout_string(buf, sizeof(buf), -1, link->channel_layout);
^
273.
274. av_dlog(ctx,
libavfilter/avfilter.c:262:5:
260. static void ff_dlog_link(void *ctx, AVFilterLink *link, int end)
261. {
262. if (link->type == AVMEDIA_TYPE_VIDEO) {
^
263. av_dlog(ctx,
264. "link[%p s:%dx%d fmt:%-16s %-16s->%-16s]%s",
libavfilter/avfilter.c:282:1: return from a call to ff_dlog_link
280. end ? "\n" : "");
281. }
282. }
^
283.
284. #define FF_DPRINTF_START(ctx, func) av_dlog(NULL, "%-16s: ", #func)
libavfilter/avfilter.c:303:106:
301. ret->type = AVMEDIA_TYPE_VIDEO;
302.
303. FF_DPRINTF_START(NULL, get_video_buffer); ff_dlog_link(NULL, link, 0); av_dlog(NULL, " returning "); ff_dlog_ref(NULL, ret, 1);
^
304.
305. return ret;
libavfilter/avfilter.c:230:1: start of procedure ff_dlog_ref()
228. }
229.
230. static void ff_dlog_ref(void *ctx, AVFilterBufferRef *ref, int end)
^
231. {
232. av_unused char buf[16];
libavfilter/avfilter.c:239:9: Taking false branch
237. ref->pts, ref->pos);
238.
239. if (ref->video) {
^
240. av_dlog(ctx, " a:%d/%d s:%dx%d i:%c iskey:%d type:%c",
241. ref->video->pixel_aspect.num, ref->video->pixel_aspect.den,
|
https://github.com/libav/libav/blob/5dc65a3d0374ffd85e5ff1c89f5917d392897920/libavfilter/avfilter.c/#L303
|
d2a_code_trace_data_44842
|
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:1056: error: Uninitialized Value
The value read from ymax was never initialized.
libavcodec/motion_est_template.c:1056:9:
1054. return dmin;
1055. }
1056. CHECK_MV( P_MEDIAN[0] >>shift , P_MEDIAN[1] >>shift)
^
1057. CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift) , (P_MEDIAN[1]>>shift)-1)
1058. CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift) , (P_MEDIAN[1]>>shift)+1)
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1056
|
d2a_code_trace_data_44843
|
static inline void mc_dir_part(AVSContext *h, AVFrame *pic,
int chroma_height,int delta,int list,uint8_t *dest_y,
uint8_t *dest_cb,uint8_t *dest_cr,int src_x_offset,
int src_y_offset,qpel_mc_func *qpix_op,
h264_chroma_mc_func chroma_op,cavs_vector *mv)
{
const int mx= mv->x + src_x_offset*8;
const int my= mv->y + src_y_offset*8;
const int luma_xy= (mx&3) + ((my&3)<<2);
uint8_t * src_y = pic->data[0] + (mx >> 2) + (my >> 2) * h->l_stride;
uint8_t * src_cb = pic->data[1] + (mx >> 3) + (my >> 3) * h->c_stride;
uint8_t * src_cr = pic->data[2] + (mx >> 3) + (my >> 3) * h->c_stride;
int extra_width = 0;
int extra_height= extra_width;
int emu=0;
const int full_mx= mx>>2;
const int full_my= my>>2;
const int pic_width = 16*h->mb_width;
const int pic_height = 16*h->mb_height;
if (!pic->data[0])
return;
if(mx&7) extra_width -= 3;
if(my&7) extra_height -= 3;
if( full_mx < 0-extra_width
|| full_my < 0-extra_height
|| full_mx + 16 > pic_width + extra_width
|| full_my + 16 > pic_height + extra_height){
h->vdsp.emulated_edge_mc(h->edge_emu_buffer, src_y - 2 - 2*h->l_stride, h->l_stride,
16+5, 16+5 , full_mx-2, full_my-2, pic_width, pic_height);
src_y= h->edge_emu_buffer + 2 + 2*h->l_stride;
emu=1;
}
qpix_op[luma_xy](dest_y, src_y, h->l_stride);
if(emu){
h->vdsp.emulated_edge_mc(h->edge_emu_buffer, src_cb, h->c_stride,
9, 9 , (mx>>3), (my>>3), pic_width>>1, pic_height>>1);
src_cb= h->edge_emu_buffer;
}
chroma_op(dest_cb, src_cb, h->c_stride, chroma_height, mx&7, my&7);
if(emu){
h->vdsp.emulated_edge_mc(h->edge_emu_buffer, src_cr, h->c_stride,
9, 9 , (mx>>3), (my>>3), pic_width>>1, pic_height>>1);
src_cr= h->edge_emu_buffer;
}
chroma_op(dest_cr, src_cr, h->c_stride, chroma_height, mx&7, my&7);
}
libavcodec/cavs.c:476: error: Buffer Overrun L2
Offset: [1, 16] (⇐ 1 + [0, 15]) Size: 2 by call to `mc_part_std`.
libavcodec/cavs.c:463:1: Parameter `h->cdsp.put_cavs_qpel_pixels_tab[*]`
461. }
462.
463. void ff_cavs_inter(AVSContext *h, enum cavs_mb mb_type) {
^
464. if(ff_cavs_partition_flags[mb_type] == 0){ // 16x16
465. mc_part_std(h, 8, 0, h->cy, h->cu, h->cv, 0, 0,
libavcodec/cavs.c:476:9: Call
474. h->cdsp.avg_cavs_qpel_pixels_tab[1],
475. h->dsp.avg_h264_chroma_pixels_tab[1],&h->mv[MV_FWD_X0]);
476. mc_part_std(h, 4, 0, h->cy, h->cu, h->cv, 4, 0,
^
477. h->cdsp.put_cavs_qpel_pixels_tab[1],
478. h->dsp.put_h264_chroma_pixels_tab[1],
libavcodec/cavs.c:430:1: Parameter `*qpix_put`
428. }
429.
430. static inline void mc_part_std(AVSContext *h,int chroma_height,int delta,
^
431. uint8_t *dest_y,uint8_t *dest_cb,uint8_t *dest_cr,
432. int x_offset, int y_offset,qpel_mc_func *qpix_put,
libavcodec/cavs.c:436:5: Assignment
434. h264_chroma_mc_func chroma_avg, cavs_vector *mv)
435. {
436. qpel_mc_func *qpix_op= qpix_put;
^
437. h264_chroma_mc_func chroma_op= chroma_put;
438.
libavcodec/cavs.c:447:9: Call
445. if(mv->ref >= 0){
446. AVFrame *ref = h->DPB[mv->ref].f;
447. mc_dir_part(h, ref, chroma_height, delta, 0,
^
448. dest_y, dest_cb, dest_cr, x_offset, y_offset,
449. qpix_op, chroma_op, mv);
libavcodec/cavs.c:378:1: <Offset trace>
376. ****************************************************************************/
377.
378. static inline void mc_dir_part(AVSContext *h, AVFrame *pic,
^
379. int chroma_height,int delta,int list,uint8_t *dest_y,
380. uint8_t *dest_cb,uint8_t *dest_cr,int src_x_offset,
libavcodec/cavs.c:378:1: Parameter `src_x_offset`
376. ****************************************************************************/
377.
378. static inline void mc_dir_part(AVSContext *h, AVFrame *pic,
^
379. int chroma_height,int delta,int list,uint8_t *dest_y,
380. uint8_t *dest_cb,uint8_t *dest_cr,int src_x_offset,
libavcodec/cavs.c:384:5: Assignment
382. h264_chroma_mc_func chroma_op,cavs_vector *mv)
383. {
384. const int mx= mv->x + src_x_offset*8;
^
385. const int my= mv->y + src_y_offset*8;
386. const int luma_xy= (mx&3) + ((my&3)<<2);
libavcodec/cavs.c:386:5: Assignment
384. const int mx= mv->x + src_x_offset*8;
385. const int my= mv->y + src_y_offset*8;
386. const int luma_xy= (mx&3) + ((my&3)<<2);
^
387. uint8_t * src_y = pic->data[0] + (mx >> 2) + (my >> 2) * h->l_stride;
388. uint8_t * src_cb = pic->data[1] + (mx >> 3) + (my >> 3) * h->c_stride;
libavcodec/cavs.c:378:1: <Length trace>
376. ****************************************************************************/
377.
378. static inline void mc_dir_part(AVSContext *h, AVFrame *pic,
^
379. int chroma_height,int delta,int list,uint8_t *dest_y,
380. uint8_t *dest_cb,uint8_t *dest_cr,int src_x_offset,
libavcodec/cavs.c:378:1: Parameter `*qpix_op`
376. ****************************************************************************/
377.
378. static inline void mc_dir_part(AVSContext *h, AVFrame *pic,
^
379. int chroma_height,int delta,int list,uint8_t *dest_y,
380. uint8_t *dest_cb,uint8_t *dest_cr,int src_x_offset,
libavcodec/cavs.c:413:5: Array access: Offset: [1, 16] (⇐ 1 + [0, 15]) Size: 2 by call to `mc_part_std`
411. }
412.
413. qpix_op[luma_xy](dest_y, src_y, h->l_stride); //FIXME try variable height perhaps?
^
414.
415. if(emu){
|
https://github.com/libav/libav/blob/c76daa89ab91ebbd9e29d289d207bf88213255ae/libavcodec/cavs.c/#L413
|
d2a_code_trace_data_44844
|
void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data)
{
unsigned long hash;
OPENSSL_LH_NODE *nn, **rn;
void *ret;
lh->error = 0;
rn = getrn(lh, data, &hash);
if (*rn == NULL) {
lh->num_no_delete++;
return NULL;
} else {
nn = *rn;
*rn = nn->next;
ret = nn->data;
OPENSSL_free(nn);
lh->num_delete++;
}
lh->num_items--;
if ((lh->num_nodes > MIN_NODES) &&
(lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
contract(lh);
return ret;
}
test/sslapitest.c:5681: error: INTEGER_OVERFLOW_L2
([0, +oo] - 1):unsigned64 by call to `SSL_free`.
Showing all 17 steps of the trace
test/sslapitest.c:5672:10: Call
5670. SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT,
5671. verify_cb);
5672. if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl,
^
5673. NULL, NULL))
5674. || !TEST_true(create_ssl_connection(serverssl, clientssl,
test/ssltestlib.c:669:15: Call
667. if (*sssl != NULL)
668. serverssl = *sssl;
669. else if (!TEST_ptr(serverssl = SSL_new(serverctx)))
^
670. goto error;
671. if (*cssl != NULL)
ssl/ssl_lib.c:671:1: Parameter `ctx->sessions->num_items`
669. }
670.
671. > SSL *SSL_new(SSL_CTX *ctx)
672. {
673. SSL *s;
test/sslapitest.c:5681:5: Call
5679.
5680. end:
5681. SSL_free(serverssl);
^
5682. SSL_free(clientssl);
5683. SSL_CTX_free(sctx);
ssl/ssl_lib.c:1133:1: Parameter `s->session_ctx->sessions->num_items`
1131. }
1132.
1133. > void SSL_free(SSL *s)
1134. {
1135. int i;
ssl/ssl_lib.c:1164:9: Call
1162. /* Make the next call work :-) */
1163. if (s->session != NULL) {
1164. ssl_clear_bad_session(s);
^
1165. SSL_SESSION_free(s->session);
1166. }
ssl/ssl_sess.c:1124:1: Parameter `s->session_ctx->sessions->num_items`
1122. }
1123.
1124. > int ssl_clear_bad_session(SSL *s)
1125. {
1126. if ((s->session != NULL) &&
ssl/ssl_sess.c:1129:9: Call
1127. !(s->shutdown & SSL_SENT_SHUTDOWN) &&
1128. !(SSL_in_init(s) || SSL_in_before(s))) {
1129. SSL_CTX_remove_session(s->session_ctx, s->session);
^
1130. return 1;
1131. } else
ssl/ssl_sess.c:742:1: Parameter `ctx->sessions->num_items`
740. }
741.
742. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
743. {
744. return remove_session_lock(ctx, c, 1);
ssl/ssl_sess.c:744:12: Call
742. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
743. {
744. return remove_session_lock(ctx, c, 1);
^
745. }
746.
ssl/ssl_sess.c:747:1: Parameter `ctx->sessions->num_items`
745. }
746.
747. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck)
748. {
749. SSL_SESSION *r;
ssl/ssl_sess.c:757:17: Call
755. if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) != NULL) {
756. ret = 1;
757. r = lh_SSL_SESSION_delete(ctx->sessions, r);
^
758. SSL_SESSION_list_remove(ctx, r);
759. }
ssl/ssl_locl.h:732:1: Parameter `lh->num_items`
730. } TLSEXT_INDEX;
731.
732. > DEFINE_LHASH_OF(SSL_SESSION);
733. /* Needed in ssl_cert.c */
734. DEFINE_LHASH_OF(X509_NAME);
ssl/ssl_locl.h:732:1: Call
730. } TLSEXT_INDEX;
731.
732. > DEFINE_LHASH_OF(SSL_SESSION);
733. /* Needed in ssl_cert.c */
734. DEFINE_LHASH_OF(X509_NAME);
crypto/lhash/lhash.c:128:1: <LHS trace>
126. }
127.
128. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data)
129. {
130. unsigned long hash;
crypto/lhash/lhash.c:128:1: Parameter `lh->num_items`
126. }
127.
128. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data)
129. {
130. unsigned long hash;
crypto/lhash/lhash.c:148:5: Binary operation: ([0, +oo] - 1):unsigned64 by call to `SSL_free`
146. }
147.
148. lh->num_items--;
^
149. if ((lh->num_nodes > MIN_NODES) &&
150. (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
|
https://github.com/openssl/openssl/blob/6e46c065b9b97212d63ef1f321b08fb7fa6b320d/crypto/lhash/lhash.c/#L148
|
d2a_code_trace_data_44845
|
static void imdct36(int *out, int *buf, int *in, int *win)
{
int i, j, t0, t1, t2, t3, s0, s1, s2, s3;
int tmp[18], *tmp1, *in1;
for(i=17;i>=1;i--)
in[i] += in[i-1];
for(i=17;i>=3;i-=2)
in[i] += in[i-2];
for(j=0;j<2;j++) {
tmp1 = tmp + j;
in1 = in + j;
#if 0
int64_t t0, t1, t2, t3;
t2 = in1[2*4] + in1[2*8] - in1[2*2];
t3 = (in1[2*0] + (int64_t)(in1[2*6]>>1))<<32;
t1 = in1[2*0] - in1[2*6];
tmp1[ 6] = t1 - (t2>>1);
tmp1[16] = t1 + t2;
t0 = MUL64(2*(in1[2*2] + in1[2*4]), C2);
t1 = MUL64( in1[2*4] - in1[2*8] , -2*C8);
t2 = MUL64(2*(in1[2*2] + in1[2*8]), -C4);
tmp1[10] = (t3 - t0 - t2) >> 32;
tmp1[ 2] = (t3 + t0 + t1) >> 32;
tmp1[14] = (t3 + t2 - t1) >> 32;
tmp1[ 4] = MULH(2*(in1[2*5] + in1[2*7] - in1[2*1]), -C3);
t2 = MUL64(2*(in1[2*1] + in1[2*5]), C1);
t3 = MUL64( in1[2*5] - in1[2*7] , -2*C7);
t0 = MUL64(2*in1[2*3], C3);
t1 = MUL64(2*(in1[2*1] + in1[2*7]), -C5);
tmp1[ 0] = (t2 + t3 + t0) >> 32;
tmp1[12] = (t2 + t1 - t0) >> 32;
tmp1[ 8] = (t3 - t1 - t0) >> 32;
#else
t2 = in1[2*4] + in1[2*8] - in1[2*2];
t3 = in1[2*0] + (in1[2*6]>>1);
t1 = in1[2*0] - in1[2*6];
tmp1[ 6] = t1 - (t2>>1);
tmp1[16] = t1 + t2;
t0 = MULH(2*(in1[2*2] + in1[2*4]), C2);
t1 = MULH( in1[2*4] - in1[2*8] , -2*C8);
t2 = MULH(2*(in1[2*2] + in1[2*8]), -C4);
tmp1[10] = t3 - t0 - t2;
tmp1[ 2] = t3 + t0 + t1;
tmp1[14] = t3 + t2 - t1;
tmp1[ 4] = MULH(2*(in1[2*5] + in1[2*7] - in1[2*1]), -C3);
t2 = MULH(2*(in1[2*1] + in1[2*5]), C1);
t3 = MULH( in1[2*5] - in1[2*7] , -2*C7);
t0 = MULH(2*in1[2*3], C3);
t1 = MULH(2*(in1[2*1] + in1[2*7]), -C5);
tmp1[ 0] = t2 + t3 + t0;
tmp1[12] = t2 + t1 - t0;
tmp1[ 8] = t3 - t1 - t0;
#endif
}
i = 0;
for(j=0;j<4;j++) {
t0 = tmp[i];
t1 = tmp[i + 2];
s0 = t1 + t0;
s2 = t1 - t0;
t2 = tmp[i + 1];
t3 = tmp[i + 3];
s1 = MULH(2*(t3 + t2), icos36h[j]);
s3 = MULL(t3 - t2, icos36[8 - j]);
t0 = s0 + s1;
t1 = s0 - s1;
out[(9 + j)*SBLIMIT] = MULH(t1, win[9 + j]) + buf[9 + j];
out[(8 - j)*SBLIMIT] = MULH(t1, win[8 - j]) + buf[8 - j];
buf[9 + j] = MULH(t0, win[18 + 9 + j]);
buf[8 - j] = MULH(t0, win[18 + 8 - j]);
t0 = s2 + s3;
t1 = s2 - s3;
out[(9 + 8 - j)*SBLIMIT] = MULH(t1, win[9 + 8 - j]) + buf[9 + 8 - j];
out[( j)*SBLIMIT] = MULH(t1, win[ j]) + buf[ j];
buf[9 + 8 - j] = MULH(t0, win[18 + 9 + 8 - j]);
buf[ + j] = MULH(t0, win[18 + j]);
i += 4;
}
s0 = tmp[16];
s1 = MULH(2*tmp[17], icos36h[4]);
t0 = s0 + s1;
t1 = s0 - s1;
out[(9 + 4)*SBLIMIT] = MULH(t1, win[9 + 4]) + buf[9 + 4];
out[(8 - 4)*SBLIMIT] = MULH(t1, win[8 - 4]) + buf[8 - 4];
buf[9 + 4] = MULH(t0, win[18 + 9 + 4]);
buf[8 - 4] = MULH(t0, win[18 + 8 - 4]);
}
libavcodec/mpegaudiodec.c:1091: error: Uninitialized Value
The value read from tmp[_] was never initialized.
libavcodec/mpegaudiodec.c:1091:9:
1089. s2 = t1 - t0;
1090.
1091. t2 = tmp[i + 1];
^
1092. t3 = tmp[i + 3];
1093. s1 = MULH(2*(t3 + t2), icos36h[j]);
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/mpegaudiodec.c/#L1091
|
d2a_code_trace_data_44846
|
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:1473: error: Buffer Overrun L1
Offset: 8 Size: 4 by call to `ff_epzs_motion_search`.
libavcodec/motion_est.c:1473:12: Call
1471. }
1472.
1473. dmin = ff_epzs_motion_search(s, &mx, &my, P, 0, 0, s->p_mv_table, (1<<16)>>shift, 0, 16);
^
1474.
1475. s->p_mv_table[xy][0] = mx<<shift;
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_epzs_motion_search`
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_44847
|
static int ssl3_get_client_key_exchange(SSL *s)
{
int i,al,ok;
long n;
unsigned long l;
unsigned char *p;
#ifndef OPENSSL_NO_RSA
RSA *rsa=NULL;
EVP_PKEY *pkey=NULL;
#endif
#ifndef OPENSSL_NO_DH
BIGNUM *pub=NULL;
DH *dh_srvr;
#endif
#ifndef OPENSSL_NO_KRB5
KSSL_ERR kssl_err;
#endif
#ifndef OPENSSL_NO_ECDH
EC_KEY *srvr_ecdh = NULL;
EVP_PKEY *clnt_pub_pkey = NULL;
EC_POINT *clnt_ecpoint = NULL;
BN_CTX *bn_ctx = NULL;
#endif
n=ssl3_get_message(s,
SSL3_ST_SR_KEY_EXCH_A,
SSL3_ST_SR_KEY_EXCH_B,
SSL3_MT_CLIENT_KEY_EXCHANGE,
2048,
&ok);
if (!ok) return((int)n);
p=(unsigned char *)s->init_msg;
l=s->s3->tmp.new_cipher->algorithms;
#ifndef OPENSSL_NO_RSA
if (l & SSL_kRSA)
{
if (s->s3->tmp.use_rsa_tmp)
{
if ((s->cert != NULL) && (s->cert->rsa_tmp != NULL))
rsa=s->cert->rsa_tmp;
if (rsa == NULL)
{
al=SSL_AD_HANDSHAKE_FAILURE;
SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,SSL_R_MISSING_TMP_RSA_PKEY);
goto f_err;
}
}
else
{
pkey=s->cert->pkeys[SSL_PKEY_RSA_ENC].privatekey;
if ( (pkey == NULL) ||
(pkey->type != EVP_PKEY_RSA) ||
(pkey->pkey.rsa == NULL))
{
al=SSL_AD_HANDSHAKE_FAILURE;
SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,SSL_R_MISSING_RSA_CERTIFICATE);
goto f_err;
}
rsa=pkey->pkey.rsa;
}
if (s->version > SSL3_VERSION)
{
n2s(p,i);
if (n != i+2)
{
if (!(s->options & SSL_OP_TLS_D5_BUG))
{
SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG);
goto err;
}
else
p-=2;
}
else
n=i;
}
i=RSA_private_decrypt((int)n,p,p,rsa,RSA_PKCS1_PADDING);
al = -1;
if (i != SSL_MAX_MASTER_KEY_LENGTH)
{
al=SSL_AD_DECODE_ERROR;
}
if ((al == -1) && !((p[0] == (s->client_version>>8)) && (p[1] == (s->client_version & 0xff))))
{
if (!((s->options & SSL_OP_TLS_ROLLBACK_BUG) &&
(p[0] == (s->version>>8)) && (p[1] == (s->version & 0xff))))
{
al=SSL_AD_DECODE_ERROR;
}
}
if (al != -1)
{
ERR_clear_error();
i = SSL_MAX_MASTER_KEY_LENGTH;
p[0] = s->client_version >> 8;
p[1] = s->client_version & 0xff;
RAND_pseudo_bytes(p+2, i-2);
}
s->session->master_key_length=
s->method->ssl3_enc->generate_master_secret(s,
s->session->master_key,
p,i);
OPENSSL_cleanse(p,i);
}
else
#endif
#ifndef OPENSSL_NO_DH
if (l & (SSL_kEDH|SSL_kDHr|SSL_kDHd))
{
n2s(p,i);
if (n != i+2)
{
if (!(s->options & SSL_OP_SSLEAY_080_CLIENT_DH_BUG))
{
SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG);
goto err;
}
else
{
p-=2;
i=(int)n;
}
}
if (n == 0L)
{
al=SSL_AD_HANDSHAKE_FAILURE;
SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,SSL_R_UNABLE_TO_DECODE_DH_CERTS);
goto f_err;
}
else
{
if (s->s3->tmp.dh == NULL)
{
al=SSL_AD_HANDSHAKE_FAILURE;
SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,SSL_R_MISSING_TMP_DH_KEY);
goto f_err;
}
else
dh_srvr=s->s3->tmp.dh;
}
pub=BN_bin2bn(p,i,NULL);
if (pub == NULL)
{
SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,SSL_R_BN_LIB);
goto err;
}
i=DH_compute_key(p,pub,dh_srvr);
if (i <= 0)
{
SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,ERR_R_DH_LIB);
goto err;
}
DH_free(s->s3->tmp.dh);
s->s3->tmp.dh=NULL;
BN_clear_free(pub);
pub=NULL;
s->session->master_key_length=
s->method->ssl3_enc->generate_master_secret(s,
s->session->master_key,p,i);
OPENSSL_cleanse(p,i);
}
else
#endif
#ifndef OPENSSL_NO_KRB5
if (l & SSL_kKRB5)
{
krb5_error_code krb5rc;
krb5_data enc_ticket;
krb5_data authenticator;
krb5_data enc_pms;
KSSL_CTX *kssl_ctx = s->kssl_ctx;
EVP_CIPHER_CTX ciph_ctx;
EVP_CIPHER *enc = NULL;
unsigned char iv[EVP_MAX_IV_LENGTH];
unsigned char pms[SSL_MAX_MASTER_KEY_LENGTH
+ EVP_MAX_BLOCK_LENGTH];
int padl, outl;
krb5_timestamp authtime = 0;
krb5_ticket_times ttimes;
EVP_CIPHER_CTX_init(&ciph_ctx);
if (!kssl_ctx) kssl_ctx = kssl_ctx_new();
n2s(p,i);
enc_ticket.length = i;
enc_ticket.data = (char *)p;
p+=enc_ticket.length;
n2s(p,i);
authenticator.length = i;
authenticator.data = (char *)p;
p+=authenticator.length;
n2s(p,i);
enc_pms.length = i;
enc_pms.data = (char *)p;
p+=enc_pms.length;
if(enc_pms.length > sizeof pms)
{
SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,
SSL_R_DATA_LENGTH_TOO_LONG);
goto err;
}
if (n != enc_ticket.length + authenticator.length +
enc_pms.length + 6)
{
SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,
SSL_R_DATA_LENGTH_TOO_LONG);
goto err;
}
if ((krb5rc = kssl_sget_tkt(kssl_ctx, &enc_ticket, &ttimes,
&kssl_err)) != 0)
{
#ifdef KSSL_DEBUG
printf("kssl_sget_tkt rtn %d [%d]\n",
krb5rc, kssl_err.reason);
if (kssl_err.text)
printf("kssl_err text= %s\n", kssl_err.text);
#endif
SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE,
kssl_err.reason);
goto err;
}
if ((krb5rc = kssl_check_authent(kssl_ctx, &authenticator,
&authtime, &kssl_err)) != 0)
{
#ifdef KSSL_DEBUG
printf("kssl_check_authent rtn %d [%d]\n",
krb5rc, kssl_err.reason);
if (kssl_err.text)
printf("kssl_err text= %s\n", kssl_err.text);
#endif
SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE,
kssl_err.reason);
goto err;
}
if ((krb5rc = kssl_validate_times(authtime, &ttimes)) != 0)
{
SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE, krb5rc);
goto err;
}
#ifdef KSSL_DEBUG
kssl_ctx_show(kssl_ctx);
#endif
enc = kssl_map_enc(kssl_ctx->enctype);
if (enc == NULL)
goto err;
memset(iv, 0, sizeof iv);
if (!EVP_DecryptInit_ex(&ciph_ctx,enc,NULL,kssl_ctx->key,iv))
{
SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,
SSL_R_DECRYPTION_FAILED);
goto err;
}
if (!EVP_DecryptUpdate(&ciph_ctx, pms,&outl,
(unsigned char *)enc_pms.data, enc_pms.length))
{
SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,
SSL_R_DECRYPTION_FAILED);
goto err;
}
if (outl > SSL_MAX_MASTER_KEY_LENGTH)
{
SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,
SSL_R_DATA_LENGTH_TOO_LONG);
goto err;
}
if (!EVP_DecryptFinal_ex(&ciph_ctx,&(pms[outl]),&padl))
{
SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,
SSL_R_DECRYPTION_FAILED);
goto err;
}
outl += padl;
if (outl > SSL_MAX_MASTER_KEY_LENGTH)
{
SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,
SSL_R_DATA_LENGTH_TOO_LONG);
goto err;
}
EVP_CIPHER_CTX_cleanup(&ciph_ctx);
s->session->master_key_length=
s->method->ssl3_enc->generate_master_secret(s,
s->session->master_key, pms, outl);
if (kssl_ctx->client_princ)
{
int len = strlen(kssl_ctx->client_princ);
if ( len < SSL_MAX_KRB5_PRINCIPAL_LENGTH )
{
s->session->krb5_client_princ_len = len;
memcpy(s->session->krb5_client_princ,kssl_ctx->client_princ,len);
}
}
}
else
#endif
#ifndef OPENSSL_NO_ECDH
if ((l & SSL_kECDH) || (l & SSL_kECDHE))
{
int ret = 1;
int field_size = 0;
if ((srvr_ecdh = EC_KEY_new()) == NULL)
{
SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,
ERR_R_MALLOC_FAILURE);
goto err;
}
if (l & SSL_kECDH)
{
srvr_ecdh->group = s->cert->key->privatekey-> \
pkey.eckey->group;
srvr_ecdh->priv_key = s->cert->key->privatekey-> \
pkey.eckey->priv_key;
}
else
{
srvr_ecdh->group = s->s3->tmp.ecdh->group;
srvr_ecdh->priv_key = s->s3->tmp.ecdh->priv_key;
}
if ((clnt_ecpoint = EC_POINT_new(srvr_ecdh->group))
== NULL)
{
SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,
ERR_R_MALLOC_FAILURE);
goto err;
}
if (n == 0L)
{
if (l & SSL_kECDHE)
{
al=SSL_AD_HANDSHAKE_FAILURE;
SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,SSL_R_MISSING_TMP_ECDH_KEY);
goto f_err;
}
if (((clnt_pub_pkey=X509_get_pubkey(s->session->peer))
== NULL) ||
(clnt_pub_pkey->type != EVP_PKEY_EC))
{
al=SSL_AD_HANDSHAKE_FAILURE;
SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,
SSL_R_UNABLE_TO_DECODE_ECDH_CERTS);
goto f_err;
}
EC_POINT_copy(clnt_ecpoint,
clnt_pub_pkey->pkey.eckey->pub_key);
ret = 2;
}
else
{
if ((bn_ctx = BN_CTX_new()) == NULL)
{
SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,
ERR_R_MALLOC_FAILURE);
goto err;
}
i = *p;
p += 1;
if (EC_POINT_oct2point(srvr_ecdh->group,
clnt_ecpoint, p, i, bn_ctx) == 0)
{
SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,
ERR_R_EC_LIB);
goto err;
}
p=(unsigned char *)s->init_buf->data;
}
field_size = EC_GROUP_get_degree(srvr_ecdh->group);
if (field_size <= 0)
{
SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,
ERR_R_ECDH_LIB);
goto err;
}
if (field_size <= 24 * 8)
i = ECDH_compute_key(p, KDF1_SHA1_len, clnt_ecpoint, srvr_ecdh, KDF1_SHA1);
else
i = ECDH_compute_key(p, (field_size+7)/8, clnt_ecpoint, srvr_ecdh, NULL);
if (i <= 0)
{
SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,
ERR_R_ECDH_LIB);
goto err;
}
EVP_PKEY_free(clnt_pub_pkey);
EC_POINT_free(clnt_ecpoint);
if (srvr_ecdh != NULL)
{
srvr_ecdh->priv_key = NULL;
srvr_ecdh->group = NULL;
EC_KEY_free(srvr_ecdh);
}
BN_CTX_free(bn_ctx);
s->session->master_key_length = s->method->ssl3_enc-> \
generate_master_secret(s, s->session->master_key, p, i);
OPENSSL_cleanse(p, i);
return (ret);
}
else
#endif
{
al=SSL_AD_HANDSHAKE_FAILURE;
SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,
SSL_R_UNKNOWN_CIPHER_TYPE);
goto f_err;
}
return(1);
f_err:
ssl3_send_alert(s,SSL3_AL_FATAL,al);
#if !defined(OPENSSL_NO_DH) || !defined(OPENSSL_NO_RSA) || !defined(OPENSSL_NO_ECDH)
err:
#endif
#ifndef OPENSSL_NO_ECDH
EVP_PKEY_free(clnt_pub_pkey);
EC_POINT_free(clnt_ecpoint);
if (srvr_ecdh != NULL)
{
srvr_ecdh->priv_key = NULL;
srvr_ecdh->group = NULL;
EC_KEY_free(srvr_ecdh);
}
BN_CTX_free(bn_ctx);
#endif
return(-1);
}
ssl/s3_srvr.c:2122: error: NULL_DEREFERENCE
pointer `clnt_pub_pkey` last assigned on line 1618 could be null and is dereferenced by call to `EVP_PKEY_free()` at line 2122, column 2.
Showing all 38 steps of the trace
ssl/s3_srvr.c:1598:1: start of procedure ssl3_get_client_key_exchange()
1596. }
1597.
1598. > static int ssl3_get_client_key_exchange(SSL *s)
1599. {
1600. int i,al,ok;
ssl/s3_srvr.c:1605:2:
1603. unsigned char *p;
1604. #ifndef OPENSSL_NO_RSA
1605. > RSA *rsa=NULL;
1606. EVP_PKEY *pkey=NULL;
1607. #endif
ssl/s3_srvr.c:1606:2:
1604. #ifndef OPENSSL_NO_RSA
1605. RSA *rsa=NULL;
1606. > EVP_PKEY *pkey=NULL;
1607. #endif
1608. #ifndef OPENSSL_NO_DH
ssl/s3_srvr.c:1609:2:
1607. #endif
1608. #ifndef OPENSSL_NO_DH
1609. > BIGNUM *pub=NULL;
1610. DH *dh_srvr;
1611. #endif
ssl/s3_srvr.c:1617:2:
1615.
1616. #ifndef OPENSSL_NO_ECDH
1617. > EC_KEY *srvr_ecdh = NULL;
1618. EVP_PKEY *clnt_pub_pkey = NULL;
1619. EC_POINT *clnt_ecpoint = NULL;
ssl/s3_srvr.c:1618:2:
1616. #ifndef OPENSSL_NO_ECDH
1617. EC_KEY *srvr_ecdh = NULL;
1618. > EVP_PKEY *clnt_pub_pkey = NULL;
1619. EC_POINT *clnt_ecpoint = NULL;
1620. BN_CTX *bn_ctx = NULL;
ssl/s3_srvr.c:1619:2:
1617. EC_KEY *srvr_ecdh = NULL;
1618. EVP_PKEY *clnt_pub_pkey = NULL;
1619. > EC_POINT *clnt_ecpoint = NULL;
1620. BN_CTX *bn_ctx = NULL;
1621. #endif
ssl/s3_srvr.c:1620:2:
1618. EVP_PKEY *clnt_pub_pkey = NULL;
1619. EC_POINT *clnt_ecpoint = NULL;
1620. > BN_CTX *bn_ctx = NULL;
1621. #endif
1622.
ssl/s3_srvr.c:1623:2: Skipping ssl3_get_message(): empty list of specs
1621. #endif
1622.
1623. n=ssl3_get_message(s,
^
1624. SSL3_ST_SR_KEY_EXCH_A,
1625. SSL3_ST_SR_KEY_EXCH_B,
ssl/s3_srvr.c:1630:7: Taking false branch
1628. &ok);
1629.
1630. if (!ok) return((int)n);
^
1631. p=(unsigned char *)s->init_msg;
1632.
ssl/s3_srvr.c:1631:2:
1629.
1630. if (!ok) return((int)n);
1631. > p=(unsigned char *)s->init_msg;
1632.
1633. l=s->s3->tmp.new_cipher->algorithms;
ssl/s3_srvr.c:1633:2:
1631. p=(unsigned char *)s->init_msg;
1632.
1633. > l=s->s3->tmp.new_cipher->algorithms;
1634.
1635. #ifndef OPENSSL_NO_RSA
ssl/s3_srvr.c:1636:6: Taking true branch
1634.
1635. #ifndef OPENSSL_NO_RSA
1636. if (l & SSL_kRSA)
^
1637. {
1638. /* FIX THIS UP EAY EAY EAY EAY */
ssl/s3_srvr.c:1639:7: Taking false branch
1637. {
1638. /* FIX THIS UP EAY EAY EAY EAY */
1639. if (s->s3->tmp.use_rsa_tmp)
^
1640. {
1641. if ((s->cert != NULL) && (s->cert->rsa_tmp != NULL))
ssl/s3_srvr.c:1655:4:
1653. else
1654. {
1655. > pkey=s->cert->pkeys[SSL_PKEY_RSA_ENC].privatekey;
1656. if ( (pkey == NULL) ||
1657. (pkey->type != EVP_PKEY_RSA) ||
ssl/s3_srvr.c:1656:10: Taking false branch
1654. {
1655. pkey=s->cert->pkeys[SSL_PKEY_RSA_ENC].privatekey;
1656. if ( (pkey == NULL) ||
^
1657. (pkey->type != EVP_PKEY_RSA) ||
1658. (pkey->pkey.rsa == NULL))
ssl/s3_srvr.c:1657:6: Taking false branch
1655. pkey=s->cert->pkeys[SSL_PKEY_RSA_ENC].privatekey;
1656. if ( (pkey == NULL) ||
1657. (pkey->type != EVP_PKEY_RSA) ||
^
1658. (pkey->pkey.rsa == NULL))
1659. {
ssl/s3_srvr.c:1658:6: Taking false branch
1656. if ( (pkey == NULL) ||
1657. (pkey->type != EVP_PKEY_RSA) ||
1658. (pkey->pkey.rsa == NULL))
^
1659. {
1660. al=SSL_AD_HANDSHAKE_FAILURE;
ssl/s3_srvr.c:1664:4:
1662. goto f_err;
1663. }
1664. > rsa=pkey->pkey.rsa;
1665. }
1666.
ssl/s3_srvr.c:1668:7: Taking true branch
1666.
1667. /* TLS */
1668. if (s->version > SSL3_VERSION)
^
1669. {
1670. n2s(p,i);
ssl/s3_srvr.c:1670:4:
1668. if (s->version > SSL3_VERSION)
1669. {
1670. > n2s(p,i);
1671. if (n != i+2)
1672. {
ssl/s3_srvr.c:1671:8: Taking true branch
1669. {
1670. n2s(p,i);
1671. if (n != i+2)
^
1672. {
1673. if (!(s->options & SSL_OP_TLS_D5_BUG))
ssl/s3_srvr.c:1673:11: Taking true branch
1671. if (n != i+2)
1672. {
1673. if (!(s->options & SSL_OP_TLS_D5_BUG))
^
1674. {
1675. SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG);
ssl/s3_srvr.c:1675:6:
1673. if (!(s->options & SSL_OP_TLS_D5_BUG))
1674. {
1675. > SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG);
1676. goto err;
1677. }
crypto/err/err.c:630:1: start of procedure ERR_put_error()
628. /********************************************************/
629.
630. > void ERR_put_error(int lib, int func, int reason, const char *file,
631. int line)
632. {
crypto/err/err.c:654:2: Skipping ERR_get_state(): empty list of specs
652. }
653. #endif
654. es=ERR_get_state();
^
655.
656. es->top=(es->top+1)%ERR_NUM_ERRORS;
crypto/err/err.c:656:2:
654. es=ERR_get_state();
655.
656. > es->top=(es->top+1)%ERR_NUM_ERRORS;
657. if (es->top == es->bottom)
658. es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
crypto/err/err.c:657:6: Taking false branch
655.
656. es->top=(es->top+1)%ERR_NUM_ERRORS;
657. if (es->top == es->bottom)
^
658. es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
659. es->err_flags[es->top]=0;
crypto/err/err.c:659:2:
657. if (es->top == es->bottom)
658. es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
659. > es->err_flags[es->top]=0;
660. es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
661. es->err_file[es->top]=file;
crypto/err/err.c:660:2:
658. es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
659. es->err_flags[es->top]=0;
660. > es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
661. es->err_file[es->top]=file;
662. es->err_line[es->top]=line;
crypto/err/err.c:661:2:
659. es->err_flags[es->top]=0;
660. es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
661. > es->err_file[es->top]=file;
662. es->err_line[es->top]=line;
663. err_clear_data(es,es->top);
crypto/err/err.c:662:2:
660. es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
661. es->err_file[es->top]=file;
662. > es->err_line[es->top]=line;
663. err_clear_data(es,es->top);
664. }
crypto/err/err.c:663:2: Taking true branch
661. es->err_file[es->top]=file;
662. es->err_line[es->top]=line;
663. err_clear_data(es,es->top);
^
664. }
665.
crypto/err/err.c:663:2: Taking false branch
661. es->err_file[es->top]=file;
662. es->err_line[es->top]=line;
663. err_clear_data(es,es->top);
^
664. }
665.
crypto/err/err.c:663:2: Loop condition is false. Leaving loop
661. es->err_file[es->top]=file;
662. es->err_line[es->top]=line;
663. err_clear_data(es,es->top);
^
664. }
665.
crypto/err/err.c:664:2: return from a call to ERR_put_error
662. es->err_line[es->top]=line;
663. err_clear_data(es,es->top);
664. }
^
665.
666. void ERR_clear_error(void)
ssl/s3_srvr.c:2119:1:
2117. ssl3_send_alert(s,SSL3_AL_FATAL,al);
2118. #if !defined(OPENSSL_NO_DH) || !defined(OPENSSL_NO_RSA) || !defined(OPENSSL_NO_ECDH)
2119. > err:
2120. #endif
2121. #ifndef OPENSSL_NO_ECDH
ssl/s3_srvr.c:2122:2:
2120. #endif
2121. #ifndef OPENSSL_NO_ECDH
2122. > EVP_PKEY_free(clnt_pub_pkey);
2123. EC_POINT_free(clnt_ecpoint);
2124. if (srvr_ecdh != NULL)
|
https://github.com/openssl/openssl/blob/9ea72d3705697b3d83023326f2d453530e5b4802/ssl/s3_srvr.c/#L2122
|
d2a_code_trace_data_44848
|
size_t CRYPTO_128_unwrap_pad(void *key, const unsigned char *icv,
unsigned char *out,
const unsigned char *in, size_t inlen, block128_f block)
{
size_t n = inlen / 8 - 1;
size_t padded_len;
size_t padding_len;
size_t ptext_len;
unsigned char aiv[8];
static unsigned char zeros[8] = {0x0};
size_t ret;
if ((inlen & 0x7) != 0 || inlen < 16 || inlen >= CRYPTO128_WRAP_MAX)
return 0;
memmove(out, in, inlen);
if (inlen == 16)
{
block(out, out, key);
memcpy(aiv, out, 8);
memmove(out, out + 8, 8);
padded_len = 8;
}
else
{
padded_len = inlen - 8;
ret = crypto_128_unwrap_raw(key, aiv, out, out, inlen, block);
if (padded_len != ret)
{
OPENSSL_cleanse(out, inlen);
return 0;
}
}
if ((!icv && CRYPTO_memcmp(aiv, default_aiv, 4))
|| (icv && CRYPTO_memcmp(aiv, icv, 4)))
{
OPENSSL_cleanse(out, inlen);
return 0;
}
ptext_len = (aiv[4] << 24) | (aiv[5] << 16) | (aiv[6] << 8) | aiv[7];
if (8*(n-1) >= ptext_len || ptext_len > 8*n)
{
OPENSSL_cleanse(out, inlen);
return 0;
}
padding_len = padded_len - ptext_len;
if (CRYPTO_memcmp(out + ptext_len, zeros, padding_len) != 0)
{
OPENSSL_cleanse(out, inlen);
return 0;
}
return ptext_len;
}
crypto/modes/wrap128.c:302: error: INTEGER_OVERFLOW_L2
([0, `inlen`] - 1):unsigned64.
Showing all 3 steps of the trace
crypto/modes/wrap128.c:297:1: <LHS trace>
295. * Output length if unwrapping succeeded and IV matches.
296. */
297. > size_t CRYPTO_128_unwrap_pad(void *key, const unsigned char *icv,
298. unsigned char *out,
299. const unsigned char *in, size_t inlen, block128_f block)
crypto/modes/wrap128.c:297:1: Parameter `inlen`
295. * Output length if unwrapping succeeded and IV matches.
296. */
297. > size_t CRYPTO_128_unwrap_pad(void *key, const unsigned char *icv,
298. unsigned char *out,
299. const unsigned char *in, size_t inlen, block128_f block)
crypto/modes/wrap128.c:302:2: Binary operation: ([0, inlen] - 1):unsigned64
300. {
301. /* n: number of 64-bit blocks in the padded key data */
302. size_t n = inlen / 8 - 1;
^
303. size_t padded_len;
304. size_t padding_len;
|
https://github.com/openssl/openssl/blob/50bba6852df4d978d0b15ca8a087c6b0ac1a6e87/crypto/modes/wrap128.c/#L302
|
d2a_code_trace_data_44849
|
static int do_not_call_session_ticket_cb(SSL *s, unsigned char *key_name,
unsigned char *iv,
EVP_CIPHER_CTX *ctx,
HMAC_CTX *hctx, int enc)
{
HANDSHAKE_EX_DATA *ex_data =
(HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx));
ex_data->session_ticket_do_not_call = 1;
return 0;
}
test/handshake_helper.c:163: error: NULL_DEREFERENCE
pointer `ex_data` last assigned on line 161 could be null and is dereferenced at line 163, column 5.
Showing all 10 steps of the trace
test/handshake_helper.c:156:1: start of procedure do_not_call_session_ticket_cb()
154. }
155.
156. > static int do_not_call_session_ticket_cb(SSL *s, unsigned char *key_name,
157. unsigned char *iv,
158. EVP_CIPHER_CTX *ctx,
test/handshake_helper.c:161:5:
159. HMAC_CTX *hctx, int enc)
160. {
161. > HANDSHAKE_EX_DATA *ex_data =
162. (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx));
163. ex_data->session_ticket_do_not_call = 1;
ssl/ssl_lib.c:3496:1: start of procedure SSL_get_ex_data()
3494. }
3495.
3496. > void *SSL_get_ex_data(const SSL *s, int idx)
3497. {
3498. return (CRYPTO_get_ex_data(&s->ex_data, idx));
ssl/ssl_lib.c:3498:5:
3496. void *SSL_get_ex_data(const SSL *s, int idx)
3497. {
3498. > return (CRYPTO_get_ex_data(&s->ex_data, idx));
3499. }
3500.
crypto/ex_data.c:369:1: start of procedure CRYPTO_get_ex_data()
367. * particular index in the class used by this variable
368. */
369. > void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx)
370. {
371. if (ad->sk == NULL || idx >= sk_void_num(ad->sk))
crypto/ex_data.c:371:9: Taking true branch
369. void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx)
370. {
371. if (ad->sk == NULL || idx >= sk_void_num(ad->sk))
^
372. return NULL;
373. return sk_void_value(ad->sk, idx);
crypto/ex_data.c:372:9:
370. {
371. if (ad->sk == NULL || idx >= sk_void_num(ad->sk))
372. > return NULL;
373. return sk_void_value(ad->sk, idx);
374. }
crypto/ex_data.c:374:1: return from a call to CRYPTO_get_ex_data
372. return NULL;
373. return sk_void_value(ad->sk, idx);
374. > }
ssl/ssl_lib.c:3499:1: return from a call to SSL_get_ex_data
3497. {
3498. return (CRYPTO_get_ex_data(&s->ex_data, idx));
3499. > }
3500.
3501. int SSL_CTX_set_ex_data(SSL_CTX *s, int idx, void *arg)
test/handshake_helper.c:163:5:
161. HANDSHAKE_EX_DATA *ex_data =
162. (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx));
163. > ex_data->session_ticket_do_not_call = 1;
164. return 0;
165. }
|
https://github.com/openssl/openssl/blob/70c22888c1648fe8652e77107f3c74bf2212de36/test/handshake_helper.c/#L163
|
d2a_code_trace_data_44850
|
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;
}
test/sm2crypttest.c:118: error: BUFFER_OVERRUN_L3
Offset added: [8, +oo] Size: [0, 67108856] by call to `EC_GROUP_set_generator`.
Showing all 23 steps of the trace
test/sm2crypttest.c:116:5: Call
114.
115. BN_hex2bn(&order, order_hex);
116. BN_hex2bn(&cof, cof_hex);
^
117.
118. if (EC_GROUP_set_generator(group, generator, order, cof) == 0)
crypto/bn/bn_print.c:126:1: Parameter `(*bn)->top`
124. }
125.
126. > int BN_hex2bn(BIGNUM **bn, const char *a)
127. {
128. BIGNUM *ret = NULL;
test/sm2crypttest.c:118:9: Call
116. BN_hex2bn(&cof, cof_hex);
117.
118. if (EC_GROUP_set_generator(group, generator, order, cof) == 0)
^
119. return NULL;
120.
crypto/ec/ec_lib.c:266:1: Parameter `group->order->top`
264. static int ec_precompute_mont_data(EC_GROUP *);
265.
266. > int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator,
267. const BIGNUM *order, const BIGNUM *cofactor)
268. {
crypto/ec/ec_lib.c:283:14: Call
281.
282. if (order != NULL) {
283. if (!BN_copy(group->order, order))
^
284. return 0;
285. } else
crypto/bn/bn_lib.c:285:1: Parameter `a->top`
283. }
284.
285. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
286. {
287. bn_check_top(b);
crypto/bn/bn_lib.c:291:9: Call
289. if (a == b)
290. return a;
291. if (bn_wexpand(a, b->top) == NULL)
^
292. return NULL;
293.
crypto/bn/bn_lib.c:910:1: Parameter `a->top`
908. }
909.
910. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
911. {
912. return (words <= a->dmax) ? a : bn_expand2(a, words);
crypto/bn/bn_lib.c:912:37: Call
910. BIGNUM *bn_wexpand(BIGNUM *a, int words)
911. {
912. return (words <= a->dmax) ? a : bn_expand2(a, words);
^
913. }
914.
crypto/bn/bn_lib.c:246:1: Parameter `b->top`
244. */
245.
246. > BIGNUM *bn_expand2(BIGNUM *b, int words)
247. {
248. bn_check_top(b);
crypto/bn/bn_lib.c:251:23: Call
249.
250. if (words > b->dmax) {
251. BN_ULONG *a = bn_expand_internal(b, words);
^
252. if (!a)
253. return NULL;
crypto/bn/bn_lib.c:208:1: <Offset trace>
206. /* This is used by bn_expand2() */
207. /* The caller MUST check that words > b->dmax before calling this */
208. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
209. {
210. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:208:1: Parameter `b->top`
206. /* This is used by bn_expand2() */
207. /* The caller MUST check that words > b->dmax before calling this */
208. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
209. {
210. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:208:1: <Length trace>
206. /* This is used by bn_expand2() */
207. /* The caller MUST check that words > b->dmax before calling this */
208. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
209. {
210. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:208:1: Parameter `words`
206. /* This is used by bn_expand2() */
207. /* The caller MUST check that words > b->dmax before calling this */
208. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
209. {
210. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:225:13: Call
223. a = OPENSSL_secure_zalloc(words * sizeof(*a));
224. else
225. a = OPENSSL_zalloc(words * sizeof(*a));
^
226. if (a == NULL) {
227. BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE);
crypto/mem.c:228:1: Parameter `num`
226. }
227.
228. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
229. {
230. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:230:17: Call
228. void *CRYPTO_zalloc(size_t num, const char *file, int line)
229. {
230. void *ret = CRYPTO_malloc(num, file, line);
^
231.
232. FAILTEST();
crypto/mem.c:201:9: Assignment
199.
200. if (num == 0)
201. return NULL;
^
202.
203. FAILTEST();
crypto/mem.c:230:5: Assignment
228. void *CRYPTO_zalloc(size_t num, const char *file, int line)
229. {
230. void *ret = CRYPTO_malloc(num, file, line);
^
231.
232. FAILTEST();
crypto/mem.c:235:5: Assignment
233. if (ret != NULL)
234. memset(ret, 0, num);
235. return ret;
^
236. }
237.
crypto/bn/bn_lib.c:225:9: Assignment
223. a = OPENSSL_secure_zalloc(words * sizeof(*a));
224. else
225. a = OPENSSL_zalloc(words * sizeof(*a));
^
226. if (a == NULL) {
227. BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE);
crypto/bn/bn_lib.c:233:9: Array access: Offset added: [8, +oo] Size: [0, 67108856] by call to `EC_GROUP_set_generator`
231. assert(b->top <= words);
232. if (b->top > 0)
233. memcpy(a, b->d, sizeof(*a) * b->top);
^
234.
235. return a;
|
https://github.com/openssl/openssl/blob/440bce8f813fa661437ce52378c3df38e2fd073b/crypto/bn/bn_lib.c/#L233
|
d2a_code_trace_data_44851
|
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/s23_clnt.c:215: error: INTEGER_OVERFLOW_L2
([0, max(0, `s->ctx->sessions->num_items`)] - 1):unsigned64 by call to `ssl23_client_hello`.
Showing all 13 steps of the trace
ssl/s23_clnt.c:143:1: Parameter `s->ctx->sessions->num_items`
141. ssl23_get_client_method)
142.
143. > int ssl23_connect(SSL *s)
144. {
145. BUF_MEM *buf=NULL;
ssl/s23_clnt.c:215:8: Call
213.
214. s->shutdown=0;
215. ret=ssl23_client_hello(s);
^
216. if (ret <= 0) goto end;
217. s->state=SSL23_ST_CR_SRVR_HELLO_A;
ssl/s23_clnt.c:277:1: Parameter `s->ctx->sessions->num_items`
275. }
276.
277. > static int ssl23_client_hello(SSL *s)
278. {
279. unsigned char *buf;
ssl/s23_clnt.c:440:4: Call
438. if ((p = ssl_add_clienthello_tlsext(s, p, buf+SSL3_RT_MAX_PLAIN_LENGTH, &al)) == NULL)
439. {
440. ssl3_send_alert(s,SSL3_AL_FATAL,al);
^
441. SSLerr(SSL_F_SSL23_CLIENT_HELLO,ERR_R_INTERNAL_ERROR);
442. return -1;
ssl/s3_pkt.c:1787:1: Parameter `s->ctx->sessions->num_items`
1785. }
1786.
1787. > int ssl3_send_alert(SSL *s, int level, int desc)
1788. {
1789. /* Map tls/ssl alert value to correct one */
ssl/s3_pkt.c:1796:3: Call
1794. /* If a fatal one, remove from cache */
1795. if ((level == SSL3_AL_FATAL) && (s->session != NULL))
1796. SSL_CTX_remove_session(s->ctx,s->session);
^
1797.
1798. s->s3->alert_dispatch=1;
ssl/ssl_sess.c:682:1: Parameter `ctx->sessions->num_items`
680. }
681.
682. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
683. {
684. return remove_session_lock(ctx, c, 1);
ssl/ssl_sess.c:684:9: Call
682. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
683. {
684. return remove_session_lock(ctx, c, 1);
^
685. }
686.
ssl/ssl_sess.c:687:1: Parameter `ctx->sessions->num_items`
685. }
686.
687. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck)
688. {
689. SSL_SESSION *r;
ssl/ssl_sess.c:698:6: Call
696. {
697. ret=1;
698. r=lh_SSL_SESSION_delete(ctx->sessions,c);
^
699. SSL_SESSION_list_remove(ctx,c);
700. }
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 `ssl23_client_hello`
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/d15f5df70d890f9bd71a4d665699cb96f441f741/crypto/lhash/lhash.c/#L240
|
d2a_code_trace_data_44852
|
int
dtls1_buffer_message(SSL *s, int is_ccs)
{
pitem *item;
hm_fragment *frag;
unsigned char seq64be[8];
OPENSSL_assert(s->init_off == 0);
frag = dtls1_hm_fragment_new(s->init_num, 0);
memcpy(frag->fragment, s->init_buf->data, s->init_num);
if ( is_ccs)
{
OPENSSL_assert(s->d1->w_msg_hdr.msg_len +
((s->version==DTLS1_VERSION)?DTLS1_CCS_HEADER_LENGTH:3) == (unsigned int)s->init_num);
}
else
{
OPENSSL_assert(s->d1->w_msg_hdr.msg_len +
DTLS1_HM_HEADER_LENGTH == (unsigned int)s->init_num);
}
frag->msg_header.msg_len = s->d1->w_msg_hdr.msg_len;
frag->msg_header.seq = s->d1->w_msg_hdr.seq;
frag->msg_header.type = s->d1->w_msg_hdr.type;
frag->msg_header.frag_off = 0;
frag->msg_header.frag_len = s->d1->w_msg_hdr.msg_len;
frag->msg_header.is_ccs = is_ccs;
frag->msg_header.saved_retransmit_state.enc_write_ctx = s->enc_write_ctx;
frag->msg_header.saved_retransmit_state.write_hash = s->write_hash;
frag->msg_header.saved_retransmit_state.compress = s->compress;
frag->msg_header.saved_retransmit_state.session = s->session;
frag->msg_header.saved_retransmit_state.epoch = s->d1->w_epoch;
memset(seq64be,0,sizeof(seq64be));
seq64be[6] = (unsigned char)(dtls1_get_queue_priority(frag->msg_header.seq,
frag->msg_header.is_ccs)>>8);
seq64be[7] = (unsigned char)(dtls1_get_queue_priority(frag->msg_header.seq,
frag->msg_header.is_ccs));
item = pitem_new(seq64be, frag);
if ( item == NULL)
{
dtls1_hm_fragment_free(frag);
return 0;
}
#if 0
fprintf( stderr, "buffered messge: \ttype = %xx\n", msg_buf->type);
fprintf( stderr, "\t\t\t\t\tlen = %d\n", msg_buf->len);
fprintf( stderr, "\t\t\t\t\tseq_num = %d\n", msg_buf->seq_num);
#endif
pqueue_insert(s->d1->sent_messages, item);
return 1;
}
ssl/d1_both.c:1113: error: NULL_DEREFERENCE
pointer `frag` last assigned on line 1111 could be null and is dereferenced at line 1113, column 9.
Showing all 22 steps of the trace
ssl/d1_both.c:1100:1: start of procedure dtls1_buffer_message()
1098. }
1099.
1100. > int
1101. dtls1_buffer_message(SSL *s, int is_ccs)
1102. {
ssl/d1_both.c:1109:2: Condition is true
1107. /* this function is called immediately after a message has
1108. * been serialized */
1109. OPENSSL_assert(s->init_off == 0);
^
1110.
1111. frag = dtls1_hm_fragment_new(s->init_num, 0);
ssl/d1_both.c:1111:2:
1109. OPENSSL_assert(s->init_off == 0);
1110.
1111. > frag = dtls1_hm_fragment_new(s->init_num, 0);
1112.
1113. memcpy(frag->fragment, s->init_buf->data, s->init_num);
ssl/d1_both.c:172:1: start of procedure dtls1_hm_fragment_new()
170. long max, int *ok);
171.
172. > static hm_fragment *
173. dtls1_hm_fragment_new(unsigned long frag_len, int reassembly)
174. {
ssl/d1_both.c:175:2:
173. dtls1_hm_fragment_new(unsigned long frag_len, int reassembly)
174. {
175. > hm_fragment *frag = NULL;
176. unsigned char *buf = NULL;
177. unsigned char *bitmask = NULL;
ssl/d1_both.c:176:2:
174. {
175. hm_fragment *frag = NULL;
176. > unsigned char *buf = NULL;
177. unsigned char *bitmask = NULL;
178.
ssl/d1_both.c:177:2:
175. hm_fragment *frag = NULL;
176. unsigned char *buf = NULL;
177. > unsigned char *bitmask = NULL;
178.
179. frag = (hm_fragment *)OPENSSL_malloc(sizeof(hm_fragment));
ssl/d1_both.c:179:2:
177. unsigned char *bitmask = NULL;
178.
179. > frag = (hm_fragment *)OPENSSL_malloc(sizeof(hm_fragment));
180. if ( frag == NULL)
181. return NULL;
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. {
ssl/d1_both.c:180:7: Taking true branch
178.
179. frag = (hm_fragment *)OPENSSL_malloc(sizeof(hm_fragment));
180. if ( frag == NULL)
^
181. return NULL;
182.
ssl/d1_both.c:181:3:
179. frag = (hm_fragment *)OPENSSL_malloc(sizeof(hm_fragment));
180. if ( frag == NULL)
181. > return NULL;
182.
183. if (frag_len)
ssl/d1_both.c:212:2: return from a call to dtls1_hm_fragment_new
210.
211. return frag;
212. }
^
213.
214. static void
ssl/d1_both.c:1113:2:
1111. frag = dtls1_hm_fragment_new(s->init_num, 0);
1112.
1113. > memcpy(frag->fragment, s->init_buf->data, s->init_num);
1114.
1115. if ( is_ccs)
|
https://github.com/openssl/openssl/blob/80ccc66d7eedb2d06050130c77c482ae1584199a/ssl/d1_both.c/#L1113
|
d2a_code_trace_data_44853
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
crypto/rsa/rsa_eay.c:441: error: INTEGER_OVERFLOW_L2
([0, +oo] - 1):unsigned32 by call to `BN_MONT_CTX_set_locked`.
Showing all 28 steps of the trace
crypto/rsa/rsa_eay.c:365:2: Call
363.
364. if ((ctx=BN_CTX_new()) == NULL) goto err;
365. BN_CTX_start(ctx);
^
366. f = BN_CTX_get(ctx);
367. br = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:255:1: Parameter `ctx->stack.depth`
253. }
254.
255. > void BN_CTX_start(BN_CTX *ctx)
256. {
257. CTXDBG_ENTRY("BN_CTX_start", ctx);
crypto/rsa/rsa_eay.c:441:3: Call
439. d= rsa->d;
440.
441. MONT_HELPER(rsa->_method_mod_n, ctx, rsa->n, rsa->flags & RSA_FLAG_CACHE_PUBLIC, goto err);
^
442.
443. if (!rsa->meth->bn_mod_exp(ret,f,d,rsa->n,ctx,
crypto/bn/bn_mont.c:530:1: Parameter `ctx->stack.depth`
528. }
529.
530. > BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, int lock,
531. const BIGNUM *mod, BN_CTX *ctx)
532. {
crypto/bn/bn_mont.c:546:16: Call
544. {
545. ret = BN_MONT_CTX_new();
546. if (ret && !BN_MONT_CTX_set(ret, mod, ctx))
^
547. BN_MONT_CTX_free(ret);
548. else
crypto/bn/bn_mont.c:412:1: Parameter `ctx->stack.depth`
410. }
411.
412. > int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
413. {
414. int ret = 0;
crypto/bn/bn_mont.c:417:2: Call
415. BIGNUM *Ri,*R;
416.
417. BN_CTX_start(ctx);
^
418. if((Ri = BN_CTX_get(ctx)) == NULL) goto err;
419. R= &(mont->RR); /* grab RR as a temp */
crypto/bn/bn_ctx.c:255:1: Parameter `ctx->stack.depth`
253. }
254.
255. > void BN_CTX_start(BN_CTX *ctx)
256. {
257. CTXDBG_ENTRY("BN_CTX_start", ctx);
crypto/bn/bn_mont.c:473:8: Call
471. tmod.top = buf[0] != 0 ? 1 : 0;
472. /* Ri = R^-1 mod N*/
473. if ((BN_mod_inverse(Ri,R,&tmod,ctx)) == NULL)
^
474. goto err;
475. if (!BN_lshift(Ri,Ri,BN_BITS2)) goto err; /* R*Ri */
crypto/bn/bn_gcd.c:208:1: Parameter `ctx->stack.depth`
206. static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
207. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx);
208. > BIGNUM *BN_mod_inverse(BIGNUM *in,
209. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx)
210. {
crypto/bn/bn_gcd.c:217:10: Call
215. if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0) || (BN_get_flags(n, BN_FLG_CONSTTIME) != 0))
216. {
217. return BN_mod_inverse_no_branch(in, a, n, ctx);
^
218. }
219.
crypto/bn/bn_gcd.c:506:1: Parameter `ctx->stack.depth`
504. * It does not contain branches that may leak sensitive information.
505. */
506. > static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
507. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx)
508. {
crypto/bn/bn_gcd.c:518:2: Call
516. bn_check_top(n);
517.
518. BN_CTX_start(ctx);
^
519. A = BN_CTX_get(ctx);
520. B = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:255:1: Parameter `ctx->stack.depth`
253. }
254.
255. > void BN_CTX_start(BN_CTX *ctx)
256. {
257. CTXDBG_ENTRY("BN_CTX_start", ctx);
crypto/bn/bn_gcd.c:547:8: Call
545. pB = &local_B;
546. BN_with_flags(pB, B, BN_FLG_CONSTTIME);
547. if (!BN_nnmod(B, pB, A, ctx)) goto err;
^
548. }
549. sign = -1;
crypto/bn/bn_mod.c:127:1: Parameter `ctx->stack.depth`
125.
126.
127. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx)
128. {
129. /* like BN_mod, but returns non-negative remainder
crypto/bn/bn_mod.c:132:8: Call
130. * (i.e., 0 <= r < |d| always holds) */
131.
132. if (!(BN_mod(r,m,d,ctx)))
^
133. return 0;
134. if (!r->neg)
crypto/bn/bn_div.c:181:1: Parameter `ctx->stack.depth`
179. static int BN_div_no_branch(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num,
180. const BIGNUM *divisor, BN_CTX *ctx);
181. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
182. BN_CTX *ctx)
183. {
crypto/bn/bn_div.c:192:10: Call
190. if ((BN_get_flags(num, BN_FLG_CONSTTIME) != 0) || (BN_get_flags(divisor, BN_FLG_CONSTTIME) != 0))
191. {
192. return BN_div_no_branch(dv, rm, num, divisor, ctx);
^
193. }
194.
crypto/bn/bn_div.c:414:1: Parameter `ctx->stack.depth`
412. * branches that may leak sensitive information.
413. */
414. > static int BN_div_no_branch(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num,
415. const BIGNUM *divisor, BN_CTX *ctx)
416. {
crypto/bn/bn_div.c:434:2: Call
432. }
433.
434. BN_CTX_start(ctx);
^
435. tmp=BN_CTX_get(ctx);
436. snum=BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:255:1: Parameter `ctx->stack.depth`
253. }
254.
255. > void BN_CTX_start(BN_CTX *ctx)
256. {
257. CTXDBG_ENTRY("BN_CTX_start", ctx);
crypto/bn/bn_div.c:630:2: Call
628. }
629. bn_correct_top(res);
630. BN_CTX_end(ctx);
^
631. return(1);
632. err:
crypto/bn/bn_ctx.c:270:1: Parameter `ctx->stack.depth`
268. }
269.
270. > void BN_CTX_end(BN_CTX *ctx)
271. {
272. CTXDBG_ENTRY("BN_CTX_end", ctx);
crypto/bn/bn_ctx.c:277:21: Call
275. else
276. {
277. unsigned int fp = BN_STACK_pop(&ctx->stack);
^
278. /* Does this stack frame have anything to release? */
279. if(fp < ctx->used)
crypto/bn/bn_ctx.c:351:1: <LHS trace>
349. }
350.
351. > static unsigned int BN_STACK_pop(BN_STACK *st)
352. {
353. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:351:1: Parameter `st->depth`
349. }
350.
351. > static unsigned int BN_STACK_pop(BN_STACK *st)
352. {
353. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:353:9: Binary operation: ([0, +oo] - 1):unsigned32 by call to `BN_MONT_CTX_set_locked`
351. static unsigned int BN_STACK_pop(BN_STACK *st)
352. {
353. return st->indexes[--(st->depth)];
^
354. }
355.
|
https://github.com/openssl/openssl/blob/56c7754cab3da9745e52e36b0bf998f8356fd6d5/crypto/bn/bn_ctx.c/#L353
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.