crypto/x509v3/v3_cpols.c:189: error: NULL_DEREFERENCE
  pointer `pol` last assigned on line 188 could be null and is dereferenced at line 189, column 13.
Showing all 41 steps of the trace


crypto/x509v3/v3_cpols.c:135:1: start of procedure r2i_certpol()
133.   IMPLEMENT_ASN1_FUNCTIONS(NOTICEREF)
134.   
135. > static STACK_OF(POLICYINFO) *r2i_certpol(X509V3_EXT_METHOD *method,
136.                                            X509V3_CTX *ctx, char *value)
137.   {

crypto/x509v3/v3_cpols.c:138:5: 
136.                                            X509V3_CTX *ctx, char *value)
137.   {
138. >     STACK_OF(POLICYINFO) *pols = NULL;
139.       char *pstr;
140.       POLICYINFO *pol;

crypto/x509v3/v3_cpols.c:145:5: 
143.       CONF_VALUE *cnf;
144.       int i, ia5org;
145. >     pols = sk_POLICYINFO_new_null();
146.       if (pols == NULL) {
147.           X509V3err(X509V3_F_R2I_CERTPOL, ERR_R_MALLOC_FAILURE);

crypto/stack/stack.c:149:1: start of procedure sk_new_null()
  147.   }
  148.   
  149. > _STACK *sk_new_null(void)
  150.   {
  151.       return sk_new((int (*)(const void *, const void *))0);

crypto/stack/stack.c:151:5: Skipping sk_new(): empty list of specs
  149.   _STACK *sk_new_null(void)
  150.   {
  151.       return sk_new((int (*)(const void *, const void *))0);
             ^
  152.   }
  153.   

crypto/stack/stack.c:152:1: return from a call to sk_new_null
  150.   {
  151.       return sk_new((int (*)(const void *, const void *))0);
  152. > }
  153.   
  154.   _STACK *sk_new(int (*c) (const void *, const void *))

crypto/x509v3/v3_cpols.c:146:9: Taking false branch
144.       int i, ia5org;
145.       pols = sk_POLICYINFO_new_null();
146.       if (pols == NULL) {
               ^
147.           X509V3err(X509V3_F_R2I_CERTPOL, ERR_R_MALLOC_FAILURE);
148.           return NULL;

crypto/x509v3/v3_cpols.c:150:5: Skipping X509V3_parse_list(): empty list of specs
148.           return NULL;
149.       }
150.       vals = X509V3_parse_list(value);
           ^
151.       if (vals == NULL) {
152.           X509V3err(X509V3_F_R2I_CERTPOL, ERR_R_X509V3_LIB);

crypto/x509v3/v3_cpols.c:151:9: Taking false branch
149.       }
150.       vals = X509V3_parse_list(value);
151.       if (vals == NULL) {
               ^
152.           X509V3err(X509V3_F_R2I_CERTPOL, ERR_R_X509V3_LIB);
153.           goto err;

crypto/x509v3/v3_cpols.c:155:5: 
153.           goto err;
154.       }
155. >     ia5org = 0;
156.       for (i = 0; i < sk_CONF_VALUE_num(vals); i++) {
157.           cnf = sk_CONF_VALUE_value(vals, i);

crypto/x509v3/v3_cpols.c:156:10: 
154.       }
155.       ia5org = 0;
156. >     for (i = 0; i < sk_CONF_VALUE_num(vals); i++) {
157.           cnf = sk_CONF_VALUE_value(vals, i);
158.           if (cnf->value || !cnf->name) {

crypto/x509v3/v3_cpols.c:156:21: Condition is true
154.       }
155.       ia5org = 0;
156.       for (i = 0; i < sk_CONF_VALUE_num(vals); i++) {
                           ^
157.           cnf = sk_CONF_VALUE_value(vals, i);
158.           if (cnf->value || !cnf->name) {

crypto/x509v3/v3_cpols.c:156:17: 
154.       }
155.       ia5org = 0;
156. >     for (i = 0; i < sk_CONF_VALUE_num(vals); i++) {
157.           cnf = sk_CONF_VALUE_value(vals, i);
158.           if (cnf->value || !cnf->name) {

crypto/stack/stack.c:327:1: start of procedure sk_num()
  325.   }
  326.   
  327. > int sk_num(const _STACK *st)
  328.   {
  329.       if (st == NULL)

crypto/stack/stack.c:329:9: Taking false branch
  327.   int sk_num(const _STACK *st)
  328.   {
  329.       if (st == NULL)
                 ^
  330.           return -1;
  331.       return st->num;

crypto/stack/stack.c:331:5: 
  329.       if (st == NULL)
  330.           return -1;
  331. >     return st->num;
  332.   }
  333.   

crypto/stack/stack.c:332:1: return from a call to sk_num
  330.           return -1;
  331.       return st->num;
  332. > }
  333.   
  334.   void *sk_value(const _STACK *st, int i)

crypto/x509v3/v3_cpols.c:156:17: Loop condition is true. Entering loop body
154.       }
155.       ia5org = 0;
156.       for (i = 0; i < sk_CONF_VALUE_num(vals); i++) {
                       ^
157.           cnf = sk_CONF_VALUE_value(vals, i);
158.           if (cnf->value || !cnf->name) {

crypto/x509v3/v3_cpols.c:157:15: Condition is true
155.       ia5org = 0;
156.       for (i = 0; i < sk_CONF_VALUE_num(vals); i++) {
157.           cnf = sk_CONF_VALUE_value(vals, i);
                     ^
158.           if (cnf->value || !cnf->name) {
159.               X509V3err(X509V3_F_R2I_CERTPOL,

crypto/x509v3/v3_cpols.c:157:9: 
155.       ia5org = 0;
156.       for (i = 0; i < sk_CONF_VALUE_num(vals); i++) {
157. >         cnf = sk_CONF_VALUE_value(vals, i);
158.           if (cnf->value || !cnf->name) {
159.               X509V3err(X509V3_F_R2I_CERTPOL,

crypto/stack/stack.c:334:1: start of procedure sk_value()
  332.   }
  333.   
  334. > void *sk_value(const _STACK *st, int i)
  335.   {
  336.       if (!st || (i < 0) || (i >= st->num))

crypto/stack/stack.c:336:10: Taking false branch
  334.   void *sk_value(const _STACK *st, int i)
  335.   {
  336.       if (!st || (i < 0) || (i >= st->num))
                  ^
  337.           return NULL;
  338.       return st->data[i];

crypto/stack/stack.c:336:17: Taking false branch
  334.   void *sk_value(const _STACK *st, int i)
  335.   {
  336.       if (!st || (i < 0) || (i >= st->num))
                         ^
  337.           return NULL;
  338.       return st->data[i];

crypto/stack/stack.c:336:28: Taking false branch
  334.   void *sk_value(const _STACK *st, int i)
  335.   {
  336.       if (!st || (i < 0) || (i >= st->num))
                                    ^
  337.           return NULL;
  338.       return st->data[i];

crypto/stack/stack.c:338:5: 
  336.       if (!st || (i < 0) || (i >= st->num))
  337.           return NULL;
  338. >     return st->data[i];
  339.   }
  340.   

crypto/stack/stack.c:339:1: return from a call to sk_value
  337.           return NULL;
  338.       return st->data[i];
  339. > }
  340.   
  341.   void *sk_set(_STACK *st, int i, void *value)

crypto/x509v3/v3_cpols.c:158:13: Taking false branch
156.       for (i = 0; i < sk_CONF_VALUE_num(vals); i++) {
157.           cnf = sk_CONF_VALUE_value(vals, i);
158.           if (cnf->value || !cnf->name) {
                   ^
159.               X509V3err(X509V3_F_R2I_CERTPOL,
160.                         X509V3_R_INVALID_POLICY_IDENTIFIER);

crypto/x509v3/v3_cpols.c:158:28: Taking false branch
156.       for (i = 0; i < sk_CONF_VALUE_num(vals); i++) {
157.           cnf = sk_CONF_VALUE_value(vals, i);
158.           if (cnf->value || !cnf->name) {
                                  ^
159.               X509V3err(X509V3_F_R2I_CERTPOL,
160.                         X509V3_R_INVALID_POLICY_IDENTIFIER);

crypto/x509v3/v3_cpols.c:164:9: 
162.               goto err;
163.           }
164. >         pstr = cnf->name;
165.           if (!strcmp(pstr, "ia5org")) {
166.               ia5org = 1;

crypto/x509v3/v3_cpols.c:165:14: Taking false branch
163.           }
164.           pstr = cnf->name;
165.           if (!strcmp(pstr, "ia5org")) {
                    ^
166.               ia5org = 1;
167.               continue;

crypto/x509v3/v3_cpols.c:168:20: Taking false branch
166.               ia5org = 1;
167.               continue;
168.           } else if (*pstr == '@') {
                          ^
169.               STACK_OF(CONF_VALUE) *polsect;
170.               polsect = X509V3_get_section(ctx, pstr + 1);

crypto/x509v3/v3_cpols.c:182:19: Taking false branch
180.                   goto err;
181.           } else {
182.               if (!(pobj = OBJ_txt2obj(cnf->name, 0))) {
                         ^
183.                   X509V3err(X509V3_F_R2I_CERTPOL,
184.                             X509V3_R_INVALID_OBJECT_IDENTIFIER);

crypto/x509v3/v3_cpols.c:188:13: 
186.                   goto err;
187.               }
188. >             pol = POLICYINFO_new();
189.               pol->policyid = pobj;
190.           }

crypto/x509v3/v3_cpols.c:105:1: start of procedure POLICYINFO_new()
  103.   } ASN1_SEQUENCE_END(POLICYINFO)
  104.   
  105. > IMPLEMENT_ASN1_FUNCTIONS(POLICYINFO)
  106.   
  107.   ASN1_ADB_TEMPLATE(policydefault) = ASN1_SIMPLE(POLICYQUALINFO, d.other, ASN1_ANY);

crypto/asn1/tasn_new.c:74:1: start of procedure ASN1_item_new()
    72.   static void asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it);
    73.   
    74. > ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it)
    75.   {
    76.       ASN1_VALUE *ret = NULL;

crypto/asn1/tasn_new.c:76:5: 
    74.   ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it)
    75.   {
    76. >     ASN1_VALUE *ret = NULL;
    77.       if (ASN1_item_ex_new(&ret, it) > 0)
    78.           return ret;

crypto/asn1/tasn_new.c:77:9: Taking false branch
    75.   {
    76.       ASN1_VALUE *ret = NULL;
    77.       if (ASN1_item_ex_new(&ret, it) > 0)
                  ^
    78.           return ret;
    79.       return NULL;

crypto/asn1/tasn_new.c:79:5: 
    77.       if (ASN1_item_ex_new(&ret, it) > 0)
    78.           return ret;
    79. >     return NULL;
    80.   }
    81.   

crypto/asn1/tasn_new.c:80:1: return from a call to ASN1_item_new
    78.           return ret;
    79.       return NULL;
    80. > }
    81.   
    82.   /* Allocate an ASN1 structure */

crypto/x509v3/v3_cpols.c:105:1: return from a call to POLICYINFO_new
  103.   } ASN1_SEQUENCE_END(POLICYINFO)
  104.   
  105. > IMPLEMENT_ASN1_FUNCTIONS(POLICYINFO)
  106.   
  107.   ASN1_ADB_TEMPLATE(policydefault) = ASN1_SIMPLE(POLICYQUALINFO, d.other, ASN1_ANY);

crypto/x509v3/v3_cpols.c:189:13: 
187.               }
188.               pol = POLICYINFO_new();
189. >             pol->policyid = pobj;
190.           }
191.           if (!sk_POLICYINFO_push(pols, pol)) {
