crypto/bn/bn_div.c:183: error: NULL_DEREFERENCE
  pointer `tmp` last assigned on line 182 could be null and is dereferenced at line 183, column 2.
Showing all 25 steps of the trace


crypto/bn/bn_div.c:155:1: start of procedure BN_div()
153.   #endif /* NO_ASM */
154.   
155. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
156.   	   BN_CTX *ctx)
157.   	{

crypto/bn/bn_div.c:167:6: Taking false branch
165.   	bn_check_top(divisor);
166.   
167.   	if (BN_is_zero(divisor))
            ^
168.   		{
169.   		BNerr(BN_F_BN_DIV,BN_R_DIV_BY_ZERO);

crypto/bn/bn_div.c:167:6: Taking true branch
165.   	bn_check_top(divisor);
166.   
167.   	if (BN_is_zero(divisor))
            ^
168.   		{
169.   		BNerr(BN_F_BN_DIV,BN_R_DIV_BY_ZERO);

crypto/bn/bn_div.c:167:6: Taking false branch
165.   	bn_check_top(divisor);
166.   
167.   	if (BN_is_zero(divisor))
            ^
168.   		{
169.   		BNerr(BN_F_BN_DIV,BN_R_DIV_BY_ZERO);

crypto/bn/bn_div.c:173:6: 
171.   		}
172.   
173. > 	if (BN_ucmp(num,divisor) < 0)
174.   		{
175.   		if (rm != NULL)

crypto/bn/bn_lib.c:616:1: start of procedure BN_ucmp()
  614.   	}
  615.   
  616. > int BN_ucmp(const BIGNUM *a, const BIGNUM *b)
  617.   	{
  618.   	int i;

crypto/bn/bn_lib.c:624:2: 
  622.   	bn_check_top(b);
  623.   
  624. > 	i=a->top-b->top;
  625.   	if (i != 0) return(i);
  626.   	ap=a->d;

crypto/bn/bn_lib.c:625:6: Taking true branch
  623.   
  624.   	i=a->top-b->top;
  625.   	if (i != 0) return(i);
              ^
  626.   	ap=a->d;
  627.   	bp=b->d;

crypto/bn/bn_lib.c:625:14: 
  623.   
  624.   	i=a->top-b->top;
  625. > 	if (i != 0) return(i);
  626.   	ap=a->d;
  627.   	bp=b->d;

crypto/bn/bn_lib.c:636:2: return from a call to BN_ucmp
  634.   		}
  635.   	return(0);
  636.   	}
          ^
  637.   
  638.   int BN_cmp(const BIGNUM *a, const BIGNUM *b)

crypto/bn/bn_div.c:173:6: Taking false branch
171.   		}
172.   
173.   	if (BN_ucmp(num,divisor) < 0)
            ^
174.   		{
175.   		if (rm != NULL)

crypto/bn/bn_div.c:181:2: 
179.   		}
180.   
181. > 	BN_CTX_start(ctx);
182.   	tmp=BN_CTX_get(ctx);
183.   	tmp->neg=0;

crypto/bn/bn_ctx.c:108:1: start of procedure BN_CTX_start()
  106.   	}
  107.   
  108. > void BN_CTX_start(BN_CTX *ctx)
  109.   	{
  110.   	if (ctx->depth < BN_CTX_NUM_POS)

crypto/bn/bn_ctx.c:110:6: Taking true branch
  108.   void BN_CTX_start(BN_CTX *ctx)
  109.   	{
  110.   	if (ctx->depth < BN_CTX_NUM_POS)
              ^
  111.   		ctx->pos[ctx->depth] = ctx->tos;
  112.   	ctx->depth++;

crypto/bn/bn_ctx.c:111:3: 
  109.   	{
  110.   	if (ctx->depth < BN_CTX_NUM_POS)
  111. > 		ctx->pos[ctx->depth] = ctx->tos;
  112.   	ctx->depth++;
  113.   	}

crypto/bn/bn_ctx.c:112:2: 
  110.   	if (ctx->depth < BN_CTX_NUM_POS)
  111.   		ctx->pos[ctx->depth] = ctx->tos;
  112. > 	ctx->depth++;
  113.   	}
  114.   

crypto/bn/bn_ctx.c:113:2: return from a call to BN_CTX_start
  111.   		ctx->pos[ctx->depth] = ctx->tos;
  112.   	ctx->depth++;
  113.   	}
          ^
  114.   
  115.   BIGNUM *BN_CTX_get(BN_CTX *ctx)

crypto/bn/bn_div.c:182:2: 
180.   
181.   	BN_CTX_start(ctx);
182. > 	tmp=BN_CTX_get(ctx);
183.   	tmp->neg=0;
184.   	snum=BN_CTX_get(ctx);

crypto/bn/bn_ctx.c:115:1: start of procedure BN_CTX_get()
  113.   	}
  114.   
  115. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
  116.   	{
  117.   	if (ctx->depth > BN_CTX_NUM_POS || ctx->tos >= BN_CTX_NUM)

crypto/bn/bn_ctx.c:117:6: Taking false branch
  115.   BIGNUM *BN_CTX_get(BN_CTX *ctx)
  116.   	{
  117.   	if (ctx->depth > BN_CTX_NUM_POS || ctx->tos >= BN_CTX_NUM)
              ^
  118.   		{
  119.   		if (!ctx->too_many)

crypto/bn/bn_ctx.c:117:37: Taking true branch
  115.   BIGNUM *BN_CTX_get(BN_CTX *ctx)
  116.   	{
  117.   	if (ctx->depth > BN_CTX_NUM_POS || ctx->tos >= BN_CTX_NUM)
                                             ^
  118.   		{
  119.   		if (!ctx->too_many)

crypto/bn/bn_ctx.c:119:8: Taking false branch
  117.   	if (ctx->depth > BN_CTX_NUM_POS || ctx->tos >= BN_CTX_NUM)
  118.   		{
  119.   		if (!ctx->too_many)
                ^
  120.   			{
  121.   			BNerr(BN_F_BN_CTX_GET,BN_R_TOO_MANY_TEMPORARY_VARIABLES);

crypto/bn/bn_ctx.c:125:3: 
  123.   			ctx->too_many = 1;
  124.   			}
  125. > 		return NULL;
  126.   		}
  127.   	return (&(ctx->bn[ctx->tos++]));

crypto/bn/bn_ctx.c:128:2: return from a call to BN_CTX_get
  126.   		}
  127.   	return (&(ctx->bn[ctx->tos++]));
  128.   	}
          ^
  129.   
  130.   void BN_CTX_end(BN_CTX *ctx)

crypto/bn/bn_div.c:183:2: 
181.   	BN_CTX_start(ctx);
182.   	tmp=BN_CTX_get(ctx);
183. > 	tmp->neg=0;
184.   	snum=BN_CTX_get(ctx);
185.   	sdiv=BN_CTX_get(ctx);
