crypto/x509/x509_lu.c:297: error: NULL_DEREFERENCE
  pointer `lu` last assigned on line 296 could be null and is dereferenced by call to `X509_LOOKUP_by_subject()` at line 297, column 6.
Showing all 19 steps of the trace


crypto/x509/x509_lu.c:282:1: start of procedure X509_STORE_get_by_subject()
280.   	}
281.   
282. > int X509_STORE_get_by_subject(X509_STORE_CTX *vs, int type, X509_NAME *name,
283.   	     X509_OBJECT *ret)
284.   	{

crypto/x509/x509_lu.c:285:2: 
283.   	     X509_OBJECT *ret)
284.   	{
285. > 	X509_STORE *ctx=vs->ctx;
286.   	X509_LOOKUP *lu;
287.   	X509_OBJECT stmp,*tmp;

crypto/x509/x509_lu.c:290:2: Skipping X509_OBJECT_retrieve_by_subject(): empty list of specs
288.   	int i,j;
289.   
290.   	tmp=X509_OBJECT_retrieve_by_subject(ctx->objs,type,name);
        ^
291.   
292.   	if (tmp == NULL)

crypto/x509/x509_lu.c:292:6: Taking true branch
290.   	tmp=X509_OBJECT_retrieve_by_subject(ctx->objs,type,name);
291.   
292.   	if (tmp == NULL)
            ^
293.   		{
294.   		for (i=vs->current_method; i<sk_X509_LOOKUP_num(ctx->get_cert_methods); i++)

crypto/x509/x509_lu.c:294:8: 
292.   	if (tmp == NULL)
293.   		{
294. > 		for (i=vs->current_method; i<sk_X509_LOOKUP_num(ctx->get_cert_methods); i++)
295.   			{
296.   			lu=sk_X509_LOOKUP_value(ctx->get_cert_methods,i);

crypto/x509/x509_lu.c:294:30: 
292.   	if (tmp == NULL)
293.   		{
294. > 		for (i=vs->current_method; i<sk_X509_LOOKUP_num(ctx->get_cert_methods); i++)
295.   			{
296.   			lu=sk_X509_LOOKUP_value(ctx->get_cert_methods,i);

crypto/stack/stack.c:302:1: start of procedure sk_num()
  300.   	}
  301.   
  302. > int sk_num(const STACK *st)
  303.   {
  304.   	if(st == NULL) return -1;

crypto/stack/stack.c:304:5: Taking true branch
  302.   int sk_num(const STACK *st)
  303.   {
  304.   	if(st == NULL) return -1;
             ^
  305.   	return st->num;
  306.   }

crypto/stack/stack.c:304:17: 
  302.   int sk_num(const STACK *st)
  303.   {
  304. > 	if(st == NULL) return -1;
  305.   	return st->num;
  306.   }

crypto/stack/stack.c:306:1: return from a call to sk_num
  304.   	if(st == NULL) return -1;
  305.   	return st->num;
  306. > }
  307.   
  308.   char *sk_value(const STACK *st, int i)

crypto/x509/x509_lu.c:294:30: Loop condition is true. Entering loop body
292.   	if (tmp == NULL)
293.   		{
294.   		for (i=vs->current_method; i<sk_X509_LOOKUP_num(ctx->get_cert_methods); i++)
                                    ^
295.   			{
296.   			lu=sk_X509_LOOKUP_value(ctx->get_cert_methods,i);

crypto/x509/x509_lu.c:296:4: 
294.   		for (i=vs->current_method; i<sk_X509_LOOKUP_num(ctx->get_cert_methods); i++)
295.   			{
296. > 			lu=sk_X509_LOOKUP_value(ctx->get_cert_methods,i);
297.   			j=X509_LOOKUP_by_subject(lu,type,name,&stmp);
298.   			if (j < 0)

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

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

crypto/stack/stack.c:310:17: 
  308.   char *sk_value(const STACK *st, int i)
  309.   {
  310. > 	if(st == NULL) return NULL;
  311.   	return st->data[i];
  312.   }

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

crypto/x509/x509_lu.c:297:4: 
295.   			{
296.   			lu=sk_X509_LOOKUP_value(ctx->get_cert_methods,i);
297. > 			j=X509_LOOKUP_by_subject(lu,type,name,&stmp);
298.   			if (j < 0)
299.   				{

crypto/x509/x509_lu.c:122:1: start of procedure X509_LOOKUP_by_subject()
  120.   	}
  121.   
  122. > int X509_LOOKUP_by_subject(X509_LOOKUP *ctx, int type, X509_NAME *name,
  123.   	     X509_OBJECT *ret)
  124.   	{

crypto/x509/x509_lu.c:125:7: 
  123.   	     X509_OBJECT *ret)
  124.   	{
  125. > 	if ((ctx->method == NULL) || (ctx->method->get_by_subject == NULL))
  126.   		return X509_LU_FAIL;
  127.   	if (ctx->skip) return 0;
