crypto/asn1/ameth_lib.c:235: error: NULL_DEREFERENCE
  pointer `ameth` last assigned on line 234 could be null and is dereferenced at line 235, column 7.
Showing all 26 steps of the trace


crypto/asn1/ameth_lib.c:206:1: start of procedure EVP_PKEY_asn1_find_str()
204.   	}
205.   
206. > const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find_str(ENGINE **pe,
207.   					const char *str, int len)
208.   	{

crypto/asn1/ameth_lib.c:211:6: Taking true branch
209.   	int i;
210.   	const EVP_PKEY_ASN1_METHOD *ameth;
211.   	if (len == -1)
            ^
212.   		len = strlen(str);
213.   	if (pe)

crypto/asn1/ameth_lib.c:212:3: 
210.   	const EVP_PKEY_ASN1_METHOD *ameth;
211.   	if (len == -1)
212. > 		len = strlen(str);
213.   	if (pe)
214.   		{

crypto/asn1/ameth_lib.c:213:6: Taking false branch
211.   	if (len == -1)
212.   		len = strlen(str);
213.   	if (pe)
            ^
214.   		{
215.   #ifndef OPENSSL_NO_ENGINE

crypto/asn1/ameth_lib.c:232:7: 
230.   		*pe = NULL;
231.   		}
232. > 	for (i = 0; i < EVP_PKEY_asn1_get_count(); i++)
233.   		{
234.   		ameth = EVP_PKEY_asn1_get0(i);

crypto/asn1/ameth_lib.c:232:14: 
230.   		*pe = NULL;
231.   		}
232. > 	for (i = 0; i < EVP_PKEY_asn1_get_count(); i++)
233.   		{
234.   		ameth = EVP_PKEY_asn1_get0(i);

crypto/asn1/ameth_lib.c:133:1: start of procedure EVP_PKEY_asn1_get_count()
  131.   			     const EVP_PKEY_ASN1_METHOD *, ameth);
  132.   
  133. > int EVP_PKEY_asn1_get_count(void)
  134.   	{
  135.   	int num = sizeof(standard_methods)/sizeof(EVP_PKEY_ASN1_METHOD *);

crypto/asn1/ameth_lib.c:135:2: 
  133.   int EVP_PKEY_asn1_get_count(void)
  134.   	{
  135. > 	int num = sizeof(standard_methods)/sizeof(EVP_PKEY_ASN1_METHOD *);
  136.   	if (app_methods)
  137.   		num += sk_EVP_PKEY_ASN1_METHOD_num(app_methods);

crypto/asn1/ameth_lib.c:136:6: Taking false branch
  134.   	{
  135.   	int num = sizeof(standard_methods)/sizeof(EVP_PKEY_ASN1_METHOD *);
  136.   	if (app_methods)
              ^
  137.   		num += sk_EVP_PKEY_ASN1_METHOD_num(app_methods);
  138.   	return num;

crypto/asn1/ameth_lib.c:138:2: 
  136.   	if (app_methods)
  137.   		num += sk_EVP_PKEY_ASN1_METHOD_num(app_methods);
  138. > 	return num;
  139.   	}
  140.   

crypto/asn1/ameth_lib.c:139:2: return from a call to EVP_PKEY_asn1_get_count
  137.   		num += sk_EVP_PKEY_ASN1_METHOD_num(app_methods);
  138.   	return num;
  139.   	}
          ^
  140.   
  141.   const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_get0(int idx)

crypto/asn1/ameth_lib.c:232:14: Loop condition is true. Entering loop body
230.   		*pe = NULL;
231.   		}
232.   	for (i = 0; i < EVP_PKEY_asn1_get_count(); i++)
                    ^
233.   		{
234.   		ameth = EVP_PKEY_asn1_get0(i);

crypto/asn1/ameth_lib.c:234:3: 
232.   	for (i = 0; i < EVP_PKEY_asn1_get_count(); i++)
233.   		{
234. > 		ameth = EVP_PKEY_asn1_get0(i);
235.   		if (ameth->pkey_flags & ASN1_PKEY_ALIAS)
236.   			continue;

crypto/asn1/ameth_lib.c:141:1: start of procedure EVP_PKEY_asn1_get0()
  139.   	}
  140.   
  141. > const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_get0(int idx)
  142.   	{
  143.   	int num = sizeof(standard_methods)/sizeof(EVP_PKEY_ASN1_METHOD *);

crypto/asn1/ameth_lib.c:143:2: 
  141.   const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_get0(int idx)
  142.   	{
  143. > 	int num = sizeof(standard_methods)/sizeof(EVP_PKEY_ASN1_METHOD *);
  144.   	if (idx < 0)
  145.   		return NULL; 

crypto/asn1/ameth_lib.c:144:6: Taking false branch
  142.   	{
  143.   	int num = sizeof(standard_methods)/sizeof(EVP_PKEY_ASN1_METHOD *);
  144.   	if (idx < 0)
              ^
  145.   		return NULL; 
  146.   	if (idx < num)

crypto/asn1/ameth_lib.c:146:6: Taking false branch
  144.   	if (idx < 0)
  145.   		return NULL; 
  146.   	if (idx < num)
              ^
  147.   		return standard_methods[idx];
  148.   	idx -= num;

crypto/asn1/ameth_lib.c:148:2: 
  146.   	if (idx < num)
  147.   		return standard_methods[idx];
  148. > 	idx -= num;
  149.   	return sk_EVP_PKEY_ASN1_METHOD_value(app_methods, idx);
  150.   	}

crypto/asn1/ameth_lib.c:149:9: Condition is true
  147.   		return standard_methods[idx];
  148.   	idx -= num;
  149.   	return sk_EVP_PKEY_ASN1_METHOD_value(app_methods, idx);
                 ^
  150.   	}
  151.   

crypto/asn1/ameth_lib.c:149:2: 
  147.   		return standard_methods[idx];
  148.   	idx -= num;
  149. > 	return sk_EVP_PKEY_ASN1_METHOD_value(app_methods, idx);
  150.   	}
  151.   

crypto/stack/stack.c:300:1: start of procedure sk_value()
    298.   }
    299.   
    300. > void *sk_value(const _STACK *st, int i)
    301.   {
    302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;

crypto/stack/stack.c:302:6: Taking true branch
    300.   void *sk_value(const _STACK *st, int i)
    301.   {
    302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
                ^
    303.   	return st->data[i];
    304.   }

crypto/stack/stack.c:302:39: 
    300.   void *sk_value(const _STACK *st, int i)
    301.   {
    302. > 	if(!st || (i < 0) || (i >= st->num)) return NULL;
    303.   	return st->data[i];
    304.   }

crypto/stack/stack.c:304:1: return from a call to sk_value
    302.   	if(!st || (i < 0) || (i >= st->num)) return NULL;
    303.   	return st->data[i];
    304. > }
    305.   
    306.   void *sk_set(_STACK *st, int i, void *value)

crypto/asn1/ameth_lib.c:150:2: return from a call to EVP_PKEY_asn1_get0
  148.   	idx -= num;
  149.   	return sk_EVP_PKEY_ASN1_METHOD_value(app_methods, idx);
  150.   	}
          ^
  151.   
  152.   static const EVP_PKEY_ASN1_METHOD *pkey_asn1_find(int type)

crypto/asn1/ameth_lib.c:235:7: 
233.   		{
234.   		ameth = EVP_PKEY_asn1_get0(i);
235. > 		if (ameth->pkey_flags & ASN1_PKEY_ALIAS)
236.   			continue;
237.   		if (((int)strlen(ameth->pem_str) == len) && 
