crypto/ec/ec_asn1.c:873: error: NULL_DEREFERENCE
  pointer `ret` last assigned on line 741 could be null and is dereferenced at line 873, column 7.
Showing all 40 steps of the trace


crypto/ec/ec_asn1.c:738:1: start of procedure ec_asn1_parameters2group()
736.   	}
737.   
738. > static EC_GROUP *ec_asn1_parameters2group(const ECPARAMETERS *params)
739.   	{
740.   	int			ok = 0, tmp;

crypto/ec/ec_asn1.c:740:2: 
738.   static EC_GROUP *ec_asn1_parameters2group(const ECPARAMETERS *params)
739.   	{
740. > 	int			ok = 0, tmp;
741.   	EC_GROUP		*ret = NULL;
742.   	BIGNUM			*p = NULL, *a = NULL, *b = NULL;

crypto/ec/ec_asn1.c:741:2: 
739.   	{
740.   	int			ok = 0, tmp;
741. > 	EC_GROUP		*ret = NULL;
742.   	BIGNUM			*p = NULL, *a = NULL, *b = NULL;
743.   	EC_POINT		*point=NULL;

crypto/ec/ec_asn1.c:742:2: 
740.   	int			ok = 0, tmp;
741.   	EC_GROUP		*ret = NULL;
742. > 	BIGNUM			*p = NULL, *a = NULL, *b = NULL;
743.   	EC_POINT		*point=NULL;
744.   

crypto/ec/ec_asn1.c:743:2: 
741.   	EC_GROUP		*ret = NULL;
742.   	BIGNUM			*p = NULL, *a = NULL, *b = NULL;
743. > 	EC_POINT		*point=NULL;
744.   
745.   	if (!params->fieldID || !params->fieldID->fieldType || 

crypto/ec/ec_asn1.c:745:7: Taking false branch
743.   	EC_POINT		*point=NULL;
744.   
745.   	if (!params->fieldID || !params->fieldID->fieldType || 
             ^
746.   	    !params->fieldID->p.ptr)
747.   		{

crypto/ec/ec_asn1.c:745:27: Taking false branch
743.   	EC_POINT		*point=NULL;
744.   
745.   	if (!params->fieldID || !params->fieldID->fieldType || 
                                 ^
746.   	    !params->fieldID->p.ptr)
747.   		{

crypto/ec/ec_asn1.c:746:7: Taking false branch
744.   
745.   	if (!params->fieldID || !params->fieldID->fieldType || 
746.   	    !params->fieldID->p.ptr)
             ^
747.   		{
748.   		ECerr(EC_F_EC_ASN1_PARAMETERS2GROUP, EC_R_ASN1_ERROR);

crypto/ec/ec_asn1.c:753:7: Taking false branch
751.   
752.   	/* now extract the curve parameters a and b */
753.   	if (!params->curve || !params->curve->a || 
             ^
754.   	    !params->curve->a->data || !params->curve->b ||
755.   	    !params->curve->b->data)

crypto/ec/ec_asn1.c:753:25: Taking false branch
751.   
752.   	/* now extract the curve parameters a and b */
753.   	if (!params->curve || !params->curve->a || 
                               ^
754.   	    !params->curve->a->data || !params->curve->b ||
755.   	    !params->curve->b->data)

crypto/ec/ec_asn1.c:754:7: Taking false branch
752.   	/* now extract the curve parameters a and b */
753.   	if (!params->curve || !params->curve->a || 
754.   	    !params->curve->a->data || !params->curve->b ||
             ^
755.   	    !params->curve->b->data)
756.   		{

crypto/ec/ec_asn1.c:754:34: Taking false branch
752.   	/* now extract the curve parameters a and b */
753.   	if (!params->curve || !params->curve->a || 
754.   	    !params->curve->a->data || !params->curve->b ||
                                        ^
755.   	    !params->curve->b->data)
756.   		{

crypto/ec/ec_asn1.c:755:7: Taking false branch
753.   	if (!params->curve || !params->curve->a || 
754.   	    !params->curve->a->data || !params->curve->b ||
755.   	    !params->curve->b->data)
             ^
756.   		{
757.   		ECerr(EC_F_EC_ASN1_PARAMETERS2GROUP, EC_R_ASN1_ERROR);

crypto/ec/ec_asn1.c:760:2: Skipping BN_bin2bn(): empty list of specs
758.   		goto err;
759.   		}
760.   	a = BN_bin2bn(params->curve->a->data, params->curve->a->length, NULL);
        ^
761.   	if (a == NULL)
762.   		{

crypto/ec/ec_asn1.c:761:6: Taking false branch
759.   		}
760.   	a = BN_bin2bn(params->curve->a->data, params->curve->a->length, NULL);
761.   	if (a == NULL)
            ^
762.   		{
763.   		ECerr(EC_F_EC_ASN1_PARAMETERS2GROUP, ERR_R_BN_LIB);

crypto/ec/ec_asn1.c:766:2: Skipping BN_bin2bn(): empty list of specs
764.   		goto err;
765.   		}
766.   	b = BN_bin2bn(params->curve->b->data, params->curve->b->length, NULL);
        ^
767.   	if (b == NULL)
768.   		{

crypto/ec/ec_asn1.c:767:6: Taking false branch
765.   		}
766.   	b = BN_bin2bn(params->curve->b->data, params->curve->b->length, NULL);
767.   	if (b == NULL)
            ^
768.   		{
769.   		ECerr(EC_F_EC_ASN1_PARAMETERS2GROUP, ERR_R_BN_LIB);

crypto/ec/ec_asn1.c:774:2: 
772.   
773.   	/* get the field parameters */
774. > 	tmp = OBJ_obj2nid(params->fieldID->fieldType);
775.   
776.   	if (tmp == NID_X9_62_characteristic_two_field)

crypto/objects/obj_dat.c:366:1: start of procedure OBJ_obj2nid()
  364.   	}
  365.   
  366. > int OBJ_obj2nid(const ASN1_OBJECT *a)
  367.   	{
  368.   	ASN1_OBJECT **op;

crypto/objects/obj_dat.c:371:6: Taking false branch
  369.   	ADDED_OBJ ad,*adp;
  370.   
  371.   	if (a == NULL)
              ^
  372.   		return(NID_undef);
  373.   	if (a->nid != 0)

crypto/objects/obj_dat.c:373:6: Taking false branch
  371.   	if (a == NULL)
  372.   		return(NID_undef);
  373.   	if (a->nid != 0)
              ^
  374.   		return(a->nid);
  375.   

crypto/objects/obj_dat.c:376:6: Taking true branch
  374.   		return(a->nid);
  375.   
  376.   	if (added != NULL)
              ^
  377.   		{
  378.   		ad.type=ADDED_DATA;

crypto/objects/obj_dat.c:378:3: 
  376.   	if (added != NULL)
  377.   		{
  378. > 		ad.type=ADDED_DATA;
  379.   		ad.obj=(ASN1_OBJECT *)a; /* XXX: ugly but harmless */
  380.   		adp=(ADDED_OBJ *)lh_retrieve(added,&ad);

crypto/objects/obj_dat.c:379:3: 
  377.   		{
  378.   		ad.type=ADDED_DATA;
  379. > 		ad.obj=(ASN1_OBJECT *)a; /* XXX: ugly but harmless */
  380.   		adp=(ADDED_OBJ *)lh_retrieve(added,&ad);
  381.   		if (adp != NULL) return (adp->obj->nid);

crypto/objects/obj_dat.c:380:3: 
  378.   		ad.type=ADDED_DATA;
  379.   		ad.obj=(ASN1_OBJECT *)a; /* XXX: ugly but harmless */
  380. > 		adp=(ADDED_OBJ *)lh_retrieve(added,&ad);
  381.   		if (adp != NULL) return (adp->obj->nid);
  382.   		}

crypto/lhash/lhash.c:248:1: start of procedure lh_retrieve()
    246.   	}
    247.   
    248. > void *lh_retrieve(LHASH *lh, const void *data)
    249.   	{
    250.   	unsigned long hash;

crypto/lhash/lhash.c:254:2: 
    252.   	const void *ret;
    253.   
    254. > 	lh->error=0;
    255.   	rn=getrn(lh,data,&hash);
    256.   

crypto/lhash/lhash.c:255:2: Skipping getrn(): empty list of specs
    253.   
    254.   	lh->error=0;
    255.   	rn=getrn(lh,data,&hash);
            ^
    256.   
    257.   	if (*rn == NULL)

crypto/lhash/lhash.c:257:6: Taking false branch
    255.   	rn=getrn(lh,data,&hash);
    256.   
    257.   	if (*rn == NULL)
                ^
    258.   		{
    259.   		lh->num_retrieve_miss++;

crypto/lhash/lhash.c:264:3: 
    262.   	else
    263.   		{
    264. > 		ret= (*rn)->data;
    265.   		lh->num_retrieve++;
    266.   		}

crypto/lhash/lhash.c:265:3: 
    263.   		{
    264.   		ret= (*rn)->data;
    265. > 		lh->num_retrieve++;
    266.   		}
    267.   	return((void *)ret);

crypto/lhash/lhash.c:267:2: 
    265.   		lh->num_retrieve++;
    266.   		}
    267. > 	return((void *)ret);
    268.   	}
    269.   

crypto/lhash/lhash.c:268:2: return from a call to lh_retrieve
    266.   		}
    267.   	return((void *)ret);
    268.   	}
            ^
    269.   
    270.   static void doall_util_fn(LHASH *lh, int use_arg, LHASH_DOALL_FN_TYPE func,

crypto/objects/obj_dat.c:381:7: Taking true branch
  379.   		ad.obj=(ASN1_OBJECT *)a; /* XXX: ugly but harmless */
  380.   		adp=(ADDED_OBJ *)lh_retrieve(added,&ad);
  381.   		if (adp != NULL) return (adp->obj->nid);
               ^
  382.   		}
  383.   	op=(ASN1_OBJECT **)OBJ_bsearch((char *)&a,(char *)obj_objs,NUM_OBJ,

crypto/objects/obj_dat.c:381:20: 
  379.   		ad.obj=(ASN1_OBJECT *)a; /* XXX: ugly but harmless */
  380.   		adp=(ADDED_OBJ *)lh_retrieve(added,&ad);
  381. > 		if (adp != NULL) return (adp->obj->nid);
  382.   		}
  383.   	op=(ASN1_OBJECT **)OBJ_bsearch((char *)&a,(char *)obj_objs,NUM_OBJ,

crypto/objects/obj_dat.c:388:2: return from a call to OBJ_obj2nid
  386.   		return(NID_undef);
  387.   	return((*op)->nid);
  388.   	}
          ^
  389.   
  390.   /* Convert an object name into an ASN1_OBJECT

crypto/ec/ec_asn1.c:776:6: Taking false branch
774.   	tmp = OBJ_obj2nid(params->fieldID->fieldType);
775.   
776.   	if (tmp == NID_X9_62_characteristic_two_field)
            ^
777.   		{
778.   		X9_62_CHARACTERISTIC_TWO *char_two;

crypto/ec/ec_asn1.c:846:11: Taking false branch
844.   			}
845.   		}
846.   	else if (tmp == NID_X9_62_prime_field)
                 ^
847.   		{
848.   		/* we have a curve over a prime field */

crypto/ec/ec_asn1.c:871:6: Taking true branch
869.   
870.   	/* extract seed (optional) */
871.   	if (params->curve->seed != NULL)
            ^
872.   		{
873.   		if (ret->seed != NULL)

crypto/ec/ec_asn1.c:873:7: 
871.   	if (params->curve->seed != NULL)
872.   		{
873. > 		if (ret->seed != NULL)
874.   			OPENSSL_free(ret->seed);
875.   		if (!(ret->seed = OPENSSL_malloc(params->curve->seed->length)))
