crypto/x509/x509_att.c:216: error: NULL_DEREFERENCE
  pointer `at` last assigned on line 213 could be null and is dereferenced by call to `X509_ATTRIBUTE_get0_data()` at line 216, column 12.
Showing all 11 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 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 false 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:216:5: 
214.       if (lastpos <= -3 && (X509_ATTRIBUTE_count(at) != 1))
215.           return NULL;
216. >     return X509_ATTRIBUTE_get0_data(at, 0, type, NULL);
217.   }
218.   

void *X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x,
                              ASN1_OBJECT *obj, int lastpos, int type)
{
    int i;
    X509_ATTRIBUTE *at;
    i = X509at_get_attr_by_OBJ(x, obj, lastpos);
    if (i == -1)
        return NULL;
    if ((lastpos <= -2) && (X509at_get_attr_by_OBJ(x, obj, i) != -1))
        return NULL;
    at = X509at_get_attr(x, i);
    if (lastpos <= -3 && (X509_ATTRIBUTE_count(at) != 1))
        return NULL;
    return X509_ATTRIBUTE_get0_data(at, 0, type, NULL);
}
['void *X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x,\n                              ASN1_OBJECT *obj, int lastpos, int type)\n{\n    int i;\n    X509_ATTRIBUTE *at;\n    i = X509at_get_attr_by_OBJ(x, obj, lastpos);\n    if (i == -1)\n        return NULL;\n    if ((lastpos <= -2) && (X509at_get_attr_by_OBJ(x, obj, i) != -1))\n        return NULL;\n    at = X509at_get_attr(x, i);\n    if (lastpos <= -3 && (X509_ATTRIBUTE_count(at) != 1))\n        return NULL;\n    return X509_ATTRIBUTE_get0_data(at, 0, type, NULL);\n}', 'X509_ATTRIBUTE *X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *x, int loc)\n{\n    if (x == NULL || sk_X509_ATTRIBUTE_num(x) <= loc || loc < 0)\n        return NULL;\n    else\n        return sk_X509_ATTRIBUTE_value(x, loc);\n}']