crypto/x509/x509_att.c:214: error: NULL_DEREFERENCE
  pointer `at` last assigned on line 213 could be null and is dereferenced by call to `X509_ATTRIBUTE_count()` at line 214, column 27.
Showing all 14 steps of the trace


crypto/x509/x509_att.c:203:1: start of procedure X509at_get0_data_by_OBJ()
201.   }
202.   
203. > void *X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x,
204.                                 ASN1_OBJECT *obj, int lastpos, int type)
205.   {

crypto/x509/x509_att.c:208:5: Skipping X509at_get_attr_by_OBJ(): empty list of specs
206.       int i;
207.       X509_ATTRIBUTE *at;
208.       i = X509at_get_attr_by_OBJ(x, obj, lastpos);
           ^
209.       if (i == -1)
210.           return NULL;

crypto/x509/x509_att.c:209:9: Taking false branch
207.       X509_ATTRIBUTE *at;
208.       i = X509at_get_attr_by_OBJ(x, obj, lastpos);
209.       if (i == -1)
               ^
210.           return NULL;
211.       if ((lastpos <= -2) && (X509at_get_attr_by_OBJ(x, obj, i) != -1))

crypto/x509/x509_att.c:211:10: Taking true branch
209.       if (i == -1)
210.           return NULL;
211.       if ((lastpos <= -2) && (X509at_get_attr_by_OBJ(x, obj, i) != -1))
                ^
212.           return NULL;
213.       at = X509at_get_attr(x, i);

crypto/x509/x509_att.c:211:29: Taking false branch
209.       if (i == -1)
210.           return NULL;
211.       if ((lastpos <= -2) && (X509at_get_attr_by_OBJ(x, obj, i) != -1))
                                   ^
212.           return NULL;
213.       at = X509at_get_attr(x, i);

crypto/x509/x509_att.c:213:5: 
211.       if ((lastpos <= -2) && (X509at_get_attr_by_OBJ(x, obj, i) != -1))
212.           return NULL;
213. >     at = X509at_get_attr(x, i);
214.       if (lastpos <= -3 && (X509_ATTRIBUTE_count(at) != 1))
215.           return NULL;

crypto/x509/x509_att.c:104:1: start of procedure X509at_get_attr()
  102.   }
  103.   
  104. > X509_ATTRIBUTE *X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *x, int loc)
  105.   {
  106.       if (x == NULL || sk_X509_ATTRIBUTE_num(x) <= loc || loc < 0)

crypto/x509/x509_att.c:106:9: Taking true branch
  104.   X509_ATTRIBUTE *X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *x, int loc)
  105.   {
  106.       if (x == NULL || sk_X509_ATTRIBUTE_num(x) <= loc || loc < 0)
                 ^
  107.           return NULL;
  108.       else

crypto/x509/x509_att.c:107:9: 
  105.   {
  106.       if (x == NULL || sk_X509_ATTRIBUTE_num(x) <= loc || loc < 0)
  107. >         return NULL;
  108.       else
  109.           return sk_X509_ATTRIBUTE_value(x, loc);

crypto/x509/x509_att.c:110:1: return from a call to X509at_get_attr
  108.       else
  109.           return sk_X509_ATTRIBUTE_value(x, loc);
  110. > }
  111.   
  112.   X509_ATTRIBUTE *X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, int loc)

crypto/x509/x509_att.c:214:9: Taking true branch
212.           return NULL;
213.       at = X509at_get_attr(x, i);
214.       if (lastpos <= -3 && (X509_ATTRIBUTE_count(at) != 1))
               ^
215.           return NULL;
216.       return X509_ATTRIBUTE_get0_data(at, 0, type, NULL);

crypto/x509/x509_att.c:214:27: 
212.           return NULL;
213.       at = X509at_get_attr(x, i);
214. >     if (lastpos <= -3 && (X509_ATTRIBUTE_count(at) != 1))
215.           return NULL;
216.       return X509_ATTRIBUTE_get0_data(at, 0, type, NULL);

crypto/x509/x509_att.c:344:1: start of procedure X509_ATTRIBUTE_count()
  342.   }
  343.   
  344. > int X509_ATTRIBUTE_count(X509_ATTRIBUTE *attr)
  345.   {
  346.       if (!attr->single)

crypto/x509/x509_att.c:346:10: Taking true branch
  344.   int X509_ATTRIBUTE_count(X509_ATTRIBUTE *attr)
  345.   {
  346.       if (!attr->single)
                  ^
  347.           return sk_ASN1_TYPE_num(attr->value.set);
  348.       if (attr->value.single)
