crypto/asn1/asn1_gen.c:459: error: NULL_DEREFERENCE
  pointer `sk` last assigned on line 446 could be null and is dereferenced by call to `sk_push()` at line 459, column 4.
Showing all 50 steps of the trace


crypto/asn1/asn1_gen.c:438:1: start of procedure asn1_multi()
436.   /* Handle multiple types: SET and SEQUENCE */
437.   
438. > static ASN1_TYPE *asn1_multi(int utype, const char *section, X509V3_CTX *cnf)
439.   	{
440.   	ASN1_TYPE *ret = NULL, *typ = NULL;

crypto/asn1/asn1_gen.c:440:2: 
438.   static ASN1_TYPE *asn1_multi(int utype, const char *section, X509V3_CTX *cnf)
439.   	{
440. > 	ASN1_TYPE *ret = NULL, *typ = NULL;
441.   	STACK_OF(ASN1_TYPE) *sk = NULL;
442.   	STACK_OF(CONF_VALUE) *sect = NULL;

crypto/asn1/asn1_gen.c:441:2: 
439.   	{
440.   	ASN1_TYPE *ret = NULL, *typ = NULL;
441. > 	STACK_OF(ASN1_TYPE) *sk = NULL;
442.   	STACK_OF(CONF_VALUE) *sect = NULL;
443.   	unsigned char *der = NULL, *p;

crypto/asn1/asn1_gen.c:442:2: 
440.   	ASN1_TYPE *ret = NULL, *typ = NULL;
441.   	STACK_OF(ASN1_TYPE) *sk = NULL;
442. > 	STACK_OF(CONF_VALUE) *sect = NULL;
443.   	unsigned char *der = NULL, *p;
444.   	int derlen;

crypto/asn1/asn1_gen.c:443:2: 
441.   	STACK_OF(ASN1_TYPE) *sk = NULL;
442.   	STACK_OF(CONF_VALUE) *sect = NULL;
443. > 	unsigned char *der = NULL, *p;
444.   	int derlen;
445.   	int i, is_set;

crypto/asn1/asn1_gen.c:446:2: 
444.   	int derlen;
445.   	int i, is_set;
446. > 	sk = sk_ASN1_TYPE_new_null();
447.   	if (section)
448.   		{

crypto/stack/stack.c:114:1: start of procedure sk_new_null()
  112.   	}
  113.   
  114. > STACK *sk_new_null(void)
  115.   	{
  116.   	return sk_new((int (*)(const char * const *, const char * const *))0);

crypto/stack/stack.c:116:2: 
  114.   STACK *sk_new_null(void)
  115.   	{
  116. > 	return sk_new((int (*)(const char * const *, const char * const *))0);
  117.   	}
  118.   

crypto/stack/stack.c:119:1: start of procedure sk_new()
    117.   	}
    118.   
    119. > STACK *sk_new(int (*c)(const char * const *, const char * const *))
    120.   	{
    121.   	STACK *ret;

crypto/stack/stack.c:124:6: 
    122.   	int i;
    123.   
    124. > 	if ((ret=(STACK *)OPENSSL_malloc(sizeof(STACK))) == NULL)
    125.   		goto err;
    126.   	if ((ret->data=(char **)OPENSSL_malloc(sizeof(char *)*MIN_NODES)) == NULL)

crypto/mem.c:289:1: start of procedure CRYPTO_malloc()
      287.   	}
      288.   
      289. > void *CRYPTO_malloc(int num, const char *file, int line)
      290.   	{
      291.   	void *ret = NULL;

crypto/mem.c:291:2: 
      289.   void *CRYPTO_malloc(int num, const char *file, int line)
      290.   	{
      291. > 	void *ret = NULL;
      292.   	extern unsigned char cleanse_ctr;
      293.   

crypto/mem.c:294:2: 
      292.   	extern unsigned char cleanse_ctr;
      293.   
      294. > 	allow_customize = 0;
      295.   	if (malloc_debug_func != NULL)
      296.   		{

crypto/mem.c:295:6: Taking false branch
      293.   
      294.   	allow_customize = 0;
      295.   	if (malloc_debug_func != NULL)
                  ^
      296.   		{
      297.   		allow_customize_debug = 0;

crypto/mem.c:300:2: Skipping __function_pointer__(): unresolved function pointer
      298.   		malloc_debug_func(NULL, num, file, line, 0);
      299.   		}
      300.   	ret = malloc_ex_func(num,file,line);
              ^
      301.   #ifdef LEVITTE_DEBUG_MEM
      302.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         > 0x%p (%d)\n", ret, num);

crypto/mem.c:304:6: Taking false branch
      302.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         > 0x%p (%d)\n", ret, num);
      303.   #endif
      304.   	if (malloc_debug_func != NULL)
                  ^
      305.   		malloc_debug_func(ret, num, file, line, 1);
      306.   

crypto/mem.c:310:12: Taking false branch
      308.            * sanitisation function can't be optimised out. NB: We only do
      309.            * this for >2Kb so the overhead doesn't bother us. */
      310.           if(ret && (num > 2048))
                        ^
      311.                   ((unsigned char *)ret)[0] = cleanse_ctr;
      312.   

crypto/mem.c:313:2: 
      311.                   ((unsigned char *)ret)[0] = cleanse_ctr;
      312.   
      313. > 	return ret;
      314.   	}
      315.   

crypto/mem.c:314:2: return from a call to CRYPTO_malloc
      312.   
      313.   	return ret;
      314.   	}
              ^
      315.   
      316.   void *CRYPTO_realloc(void *str, int num, const char *file, int line)

crypto/stack/stack.c:124:6: Taking true branch
    122.   	int i;
    123.   
    124.   	if ((ret=(STACK *)OPENSSL_malloc(sizeof(STACK))) == NULL)
                ^
    125.   		goto err;
    126.   	if ((ret->data=(char **)OPENSSL_malloc(sizeof(char *)*MIN_NODES)) == NULL)

crypto/stack/stack.c:135:1: 
    133.   	ret->sorted=0;
    134.   	return(ret);
    135. > err:
    136.   	if(ret)
    137.   		OPENSSL_free(ret);

crypto/stack/stack.c:136:5: Taking false branch
    134.   	return(ret);
    135.   err:
    136.   	if(ret)
               ^
    137.   		OPENSSL_free(ret);
    138.   	return(NULL);

crypto/stack/stack.c:138:2: 
    136.   	if(ret)
    137.   		OPENSSL_free(ret);
    138. > 	return(NULL);
    139.   	}
    140.   

crypto/stack/stack.c:139:2: return from a call to sk_new
    137.   		OPENSSL_free(ret);
    138.   	return(NULL);
    139.   	}
            ^
    140.   
    141.   int sk_insert(STACK *st, char *data, int loc)

crypto/stack/stack.c:117:2: return from a call to sk_new_null
  115.   	{
  116.   	return sk_new((int (*)(const char * const *, const char * const *))0);
  117.   	}
          ^
  118.   
  119.   STACK *sk_new(int (*c)(const char * const *, const char * const *))

crypto/asn1/asn1_gen.c:447:6: Taking true branch
445.   	int i, is_set;
446.   	sk = sk_ASN1_TYPE_new_null();
447.   	if (section)
            ^
448.   		{
449.   		if (!cnf)

crypto/asn1/asn1_gen.c:449:8: Taking false branch
447.   	if (section)
448.   		{
449.   		if (!cnf)
              ^
450.   			goto bad;
451.   		sect = X509V3_get_section(cnf, (char *)section);

crypto/asn1/asn1_gen.c:451:3: 
449.   		if (!cnf)
450.   			goto bad;
451. > 		sect = X509V3_get_section(cnf, (char *)section);
452.   		if (!sect)
453.   			goto bad;

crypto/x509v3/v3_conf.c:391:1: start of procedure X509V3_get_section()
  389.   	}
  390.   
  391. > STACK_OF(CONF_VALUE) * X509V3_get_section(X509V3_CTX *ctx, char *section)
  392.   	{
  393.   	if (ctx->db_meth->get_section)

crypto/x509v3/v3_conf.c:393:6: Taking true branch
  391.   STACK_OF(CONF_VALUE) * X509V3_get_section(X509V3_CTX *ctx, char *section)
  392.   	{
  393.   	if (ctx->db_meth->get_section)
              ^
  394.   			return ctx->db_meth->get_section(ctx->db, section);
  395.   	return NULL;

crypto/x509v3/v3_conf.c:394:4: Skipping __function_pointer__(): unresolved function pointer
  392.   	{
  393.   	if (ctx->db_meth->get_section)
  394.   			return ctx->db_meth->get_section(ctx->db, section);
            ^
  395.   	return NULL;
  396.   	}

crypto/x509v3/v3_conf.c:396:2: return from a call to X509V3_get_section
  394.   			return ctx->db_meth->get_section(ctx->db, section);
  395.   	return NULL;
  396.   	}
          ^
  397.   
  398.   void X509V3_string_free(X509V3_CTX *ctx, char *str)

crypto/asn1/asn1_gen.c:452:8: Taking false branch
450.   			goto bad;
451.   		sect = X509V3_get_section(cnf, (char *)section);
452.   		if (!sect)
              ^
453.   			goto bad;
454.   		for (i = 0; i < sk_CONF_VALUE_num(sect); i++)

crypto/asn1/asn1_gen.c:454:8: 
452.   		if (!sect)
453.   			goto bad;
454. > 		for (i = 0; i < sk_CONF_VALUE_num(sect); i++)
455.   			{
456.   			typ = ASN1_generate_v3(sk_CONF_VALUE_value(sect, i)->value, cnf);

crypto/asn1/asn1_gen.c:454:15: 
452.   		if (!sect)
453.   			goto bad;
454. > 		for (i = 0; i < sk_CONF_VALUE_num(sect); i++)
455.   			{
456.   			typ = ASN1_generate_v3(sk_CONF_VALUE_value(sect, i)->value, cnf);

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

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

crypto/stack/stack.c:304:2: 
  302.   {
  303.   	if(st == NULL) return -1;
  304. > 	return st->num;
  305.   }
  306.   

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

crypto/asn1/asn1_gen.c:454:15: Loop condition is true. Entering loop body
452.   		if (!sect)
453.   			goto bad;
454.   		for (i = 0; i < sk_CONF_VALUE_num(sect); i++)
                     ^
455.   			{
456.   			typ = ASN1_generate_v3(sk_CONF_VALUE_value(sect, i)->value, cnf);

crypto/asn1/asn1_gen.c:456:4: 
454.   		for (i = 0; i < sk_CONF_VALUE_num(sect); i++)
455.   			{
456. > 			typ = ASN1_generate_v3(sk_CONF_VALUE_value(sect, i)->value, cnf);
457.   			if (!typ)
458.   				goto bad;

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

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

crypto/stack/stack.c:310:2: 
  308.   {
  309.   	if(st == NULL) return NULL;
  310. > 	return st->data[i];
  311.   }
  312.   

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

crypto/asn1/asn1_gen.c:456:4: Skipping ASN1_generate_v3(): function or method not found
454.   		for (i = 0; i < sk_CONF_VALUE_num(sect); i++)
455.   			{
456.   			typ = ASN1_generate_v3(sk_CONF_VALUE_value(sect, i)->value, cnf);
          ^
457.   			if (!typ)
458.   				goto bad;

crypto/asn1/asn1_gen.c:457:9: Taking false branch
455.   			{
456.   			typ = ASN1_generate_v3(sk_CONF_VALUE_value(sect, i)->value, cnf);
457.   			if (!typ)
               ^
458.   				goto bad;
459.   			sk_ASN1_TYPE_push(sk, typ);

crypto/asn1/asn1_gen.c:459:4: 
457.   			if (!typ)
458.   				goto bad;
459. > 			sk_ASN1_TYPE_push(sk, typ);
460.   			typ = NULL;
461.   			}

crypto/stack/stack.c:251:1: start of procedure sk_push()
  249.   	}
  250.   
  251. > int sk_push(STACK *st, char *data)
  252.   	{
  253.   	return(sk_insert(st,data,st->num));

crypto/stack/stack.c:253:2: Skipping sk_insert(): empty list of specs
  251.   int sk_push(STACK *st, char *data)
  252.   	{
  253.   	return(sk_insert(st,data,st->num));
          ^
  254.   	}
  255.   
