crypto/evp/evp_pbe.c:187: error: NULL_DEREFERENCE
  pointer `pbetmp` last assigned on line 185 could be null and is dereferenced at line 187, column 12.
Showing all 26 steps of the trace


crypto/evp/evp_pbe.c:173:1: start of procedure EVP_PBE_find()
171.   	}
172.   
173. > int EVP_PBE_find(int type, int pbe_nid,
174.   			int *pcnid, int *pmnid, EVP_PBE_KEYGEN **pkeygen)
175.   	{

crypto/evp/evp_pbe.c:178:6: Taking false branch
176.   	EVP_PBE_CTL *pbetmp, pbelu;
177.   	int i;
178.   	if (pbe_nid == NID_undef)
            ^
179.   		return 0;
180.   	pbelu.pbe_type = type;

crypto/evp/evp_pbe.c:180:2: 
178.   	if (pbe_nid == NID_undef)
179.   		return 0;
180. > 	pbelu.pbe_type = type;
181.   	pbelu.pbe_nid = pbe_nid;
182.   	i = sk_find(pbe_algs, (char *)&pbelu);

crypto/evp/evp_pbe.c:181:2: 
179.   		return 0;
180.   	pbelu.pbe_type = type;
181. > 	pbelu.pbe_nid = pbe_nid;
182.   	i = sk_find(pbe_algs, (char *)&pbelu);
183.   	if (i == -1)

crypto/evp/evp_pbe.c:182:2: 
180.   	pbelu.pbe_type = type;
181.   	pbelu.pbe_nid = pbe_nid;
182. > 	i = sk_find(pbe_algs, (char *)&pbelu);
183.   	if (i == -1)
184.   		return 0;

crypto/stack/stack.c:242:1: start of procedure sk_find()
  240.   	}
  241.   
  242. > int sk_find(STACK *st, char *data)
  243.   	{
  244.   	return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);

crypto/stack/stack.c:244:2: 
  242.   int sk_find(STACK *st, char *data)
  243.   	{
  244. > 	return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);
  245.   	}
  246.   int sk_find_ex(STACK *st, char *data)

crypto/stack/stack.c:213:1: start of procedure internal_find()
    211.   	}
    212.   
    213. > static int internal_find(STACK *st, char *data, int ret_val_options)
    214.   	{
    215.   	char **r;

crypto/stack/stack.c:218:5: Taking false branch
    216.   	int i;
    217.   	int (*comp_func)(const void *,const void *);
    218.   	if(st == NULL) return -1;
               ^
    219.   
    220.   	if (st->comp == NULL)

crypto/stack/stack.c:220:6: Taking true branch
    218.   	if(st == NULL) return -1;
    219.   
    220.   	if (st->comp == NULL)
                ^
    221.   		{
    222.   		for (i=0; i<st->num; i++)

crypto/stack/stack.c:222:8: 
    220.   	if (st->comp == NULL)
    221.   		{
    222. > 		for (i=0; i<st->num; i++)
    223.   			if (st->data[i] == data)
    224.   				return(i);

crypto/stack/stack.c:222:13: Loop condition is true. Entering loop body
    220.   	if (st->comp == NULL)
    221.   		{
    222.   		for (i=0; i<st->num; i++)
                       ^
    223.   			if (st->data[i] == data)
    224.   				return(i);

crypto/stack/stack.c:223:8: Taking true branch
    221.   		{
    222.   		for (i=0; i<st->num; i++)
    223.   			if (st->data[i] == data)
                  ^
    224.   				return(i);
    225.   		return(-1);

crypto/stack/stack.c:224:5: 
    222.   		for (i=0; i<st->num; i++)
    223.   			if (st->data[i] == data)
    224. > 				return(i);
    225.   		return(-1);
    226.   		}

crypto/stack/stack.c:240:2: return from a call to internal_find
    238.   	if (r == NULL) return(-1);
    239.   	return((int)(r-st->data));
    240.   	}
            ^
    241.   
    242.   int sk_find(STACK *st, char *data)

crypto/stack/stack.c:245:2: return from a call to sk_find
  243.   	{
  244.   	return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);
  245.   	}
          ^
  246.   int sk_find_ex(STACK *st, char *data)
  247.   	{

crypto/evp/evp_pbe.c:183:6: Taking false branch
181.   	pbelu.pbe_nid = pbe_nid;
182.   	i = sk_find(pbe_algs, (char *)&pbelu);
183.   	if (i == -1)
            ^
184.   		return 0;
185.   	pbetmp = (EVP_PBE_CTL *)sk_value (pbe_algs, i);

crypto/evp/evp_pbe.c:185:2: 
183.   	if (i == -1)
184.   		return 0;
185. > 	pbetmp = (EVP_PBE_CTL *)sk_value (pbe_algs, i);
186.   	if (pcnid)
187.   		*pcnid = pbetmp->cipher_nid;

crypto/stack/stack.c:307:1: start of procedure sk_value()
  305.   }
  306.   
  307. > char *sk_value(const STACK *st, int i)
  308.   {
  309.   	if(!st || (i < 0) || (i >= st->num)) return NULL;

crypto/stack/stack.c:309:6: Taking false branch
  307.   char *sk_value(const STACK *st, int i)
  308.   {
  309.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
              ^
  310.   	return st->data[i];
  311.   }

crypto/stack/stack.c:309:13: Taking false branch
  307.   char *sk_value(const STACK *st, int i)
  308.   {
  309.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
                     ^
  310.   	return st->data[i];
  311.   }

crypto/stack/stack.c:309:24: Taking true branch
  307.   char *sk_value(const STACK *st, int i)
  308.   {
  309.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
                                ^
  310.   	return st->data[i];
  311.   }

crypto/stack/stack.c:309:39: 
  307.   char *sk_value(const STACK *st, int i)
  308.   {
  309. > 	if(!st || (i < 0) || (i >= st->num)) return NULL;
  310.   	return st->data[i];
  311.   }

crypto/stack/stack.c:311:1: return from a call to sk_value
  309.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
  310.   	return st->data[i];
  311. > }
  312.   
  313.   char *sk_set(STACK *st, int i, char *value)

crypto/evp/evp_pbe.c:186:6: Taking true branch
184.   		return 0;
185.   	pbetmp = (EVP_PBE_CTL *)sk_value (pbe_algs, i);
186.   	if (pcnid)
            ^
187.   		*pcnid = pbetmp->cipher_nid;
188.   	if (pmnid)

crypto/evp/evp_pbe.c:187:3: 
185.   	pbetmp = (EVP_PBE_CTL *)sk_value (pbe_algs, i);
186.   	if (pcnid)
187. > 		*pcnid = pbetmp->cipher_nid;
188.   	if (pmnid)
189.   		*pmnid = pbetmp->md_nid;

int EVP_PBE_find(int type, int pbe_nid,
			int *pcnid, int *pmnid, EVP_PBE_KEYGEN **pkeygen)
	{
	EVP_PBE_CTL *pbetmp, pbelu;
	int i;
	if (pbe_nid == NID_undef)
		return 0;
	pbelu.pbe_type = type;
	pbelu.pbe_nid = pbe_nid;
	i = sk_find(pbe_algs, (char *)&pbelu);
	if (i == -1)
		return 0;
	pbetmp = (EVP_PBE_CTL *)sk_value (pbe_algs, i);
	if (pcnid)
		*pcnid = pbetmp->cipher_nid;
	if (pmnid)
		*pmnid = pbetmp->md_nid;
	if (pkeygen)
		*pkeygen = pbetmp->keygen;
	return 1;
	}
['int EVP_PBE_find(int type, int pbe_nid,\n\t\t\tint *pcnid, int *pmnid, EVP_PBE_KEYGEN **pkeygen)\n\t{\n\tEVP_PBE_CTL *pbetmp, pbelu;\n\tint i;\n\tif (pbe_nid == NID_undef)\n\t\treturn 0;\n\tpbelu.pbe_type = type;\n\tpbelu.pbe_nid = pbe_nid;\n\ti = sk_find(pbe_algs, (char *)&pbelu);\n\tif (i == -1)\n\t\treturn 0;\n\tpbetmp = (EVP_PBE_CTL *)sk_value (pbe_algs, i);\n\tif (pcnid)\n\t\t*pcnid = pbetmp->cipher_nid;\n\tif (pmnid)\n\t\t*pmnid = pbetmp->md_nid;\n\tif (pkeygen)\n\t\t*pkeygen = pbetmp->keygen;\n\treturn 1;\n\t}', 'int sk_find(STACK *st, char *data)\n\t{\n\treturn internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);\n\t}', 'static int internal_find(STACK *st, char *data, int ret_val_options)\n\t{\n\tchar **r;\n\tint i;\n\tint (*comp_func)(const void *,const void *);\n\tif(st == NULL) return -1;\n\tif (st->comp == NULL)\n\t\t{\n\t\tfor (i=0; i<st->num; i++)\n\t\t\tif (st->data[i] == data)\n\t\t\t\treturn(i);\n\t\treturn(-1);\n\t\t}\n\tsk_sort(st);\n\tif (data == NULL) return(-1);\n\tcomp_func=(int (*)(const void *,const void *))(st->comp);\n\tr=(char **)OBJ_bsearch_ex((char *)&data,(char *)st->data,\n\t\tst->num,sizeof(char *),comp_func,ret_val_options);\n\tif (r == NULL) return(-1);\n\treturn((int)(r-st->data));\n\t}', 'char *sk_value(const STACK *st, int i)\n{\n\tif(!st || (i < 0) || (i >= st->num)) return NULL;\n\treturn st->data[i];\n}']