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


crypto/ec/ec_asn1.c:802:1: start of procedure ec_asn1_parameters2group()
800.   	}
801.   
802. > static EC_GROUP *ec_asn1_parameters2group(const ECPARAMETERS *params)
803.   	{
804.   	int			ok = 0, tmp;

crypto/ec/ec_asn1.c:804:2: 
802.   static EC_GROUP *ec_asn1_parameters2group(const ECPARAMETERS *params)
803.   	{
804. > 	int			ok = 0, tmp;
805.   	EC_GROUP		*ret = NULL;
806.   	BIGNUM			*p = NULL, *a = NULL, *b = NULL;

crypto/ec/ec_asn1.c:805:2: 
803.   	{
804.   	int			ok = 0, tmp;
805. > 	EC_GROUP		*ret = NULL;
806.   	BIGNUM			*p = NULL, *a = NULL, *b = NULL;
807.   	EC_POINT		*point=NULL;

crypto/ec/ec_asn1.c:806:2: 
804.   	int			ok = 0, tmp;
805.   	EC_GROUP		*ret = NULL;
806. > 	BIGNUM			*p = NULL, *a = NULL, *b = NULL;
807.   	EC_POINT		*point=NULL;
808.   	X9_62_CHARACTERISTIC_TWO *char_two = NULL;

crypto/ec/ec_asn1.c:807:2: 
805.   	EC_GROUP		*ret = NULL;
806.   	BIGNUM			*p = NULL, *a = NULL, *b = NULL;
807. > 	EC_POINT		*point=NULL;
808.   	X9_62_CHARACTERISTIC_TWO *char_two = NULL;
809.   	X9_62_PENTANOMIAL	*penta = NULL;

crypto/ec/ec_asn1.c:808:2: 
806.   	BIGNUM			*p = NULL, *a = NULL, *b = NULL;
807.   	EC_POINT		*point=NULL;
808. > 	X9_62_CHARACTERISTIC_TWO *char_two = NULL;
809.   	X9_62_PENTANOMIAL	*penta = NULL;
810.   	unsigned char		*pp;

crypto/ec/ec_asn1.c:809:2: 
807.   	EC_POINT		*point=NULL;
808.   	X9_62_CHARACTERISTIC_TWO *char_two = NULL;
809. > 	X9_62_PENTANOMIAL	*penta = NULL;
810.   	unsigned char		*pp;
811.   

crypto/ec/ec_asn1.c:812:7: Taking false branch
810.   	unsigned char		*pp;
811.   
812.   	if (!params->fieldID || !params->fieldID->fieldType || 
             ^
813.   	    !params->fieldID->parameters)
814.   		{

crypto/ec/ec_asn1.c:812:27: Taking false branch
810.   	unsigned char		*pp;
811.   
812.   	if (!params->fieldID || !params->fieldID->fieldType || 
                                 ^
813.   	    !params->fieldID->parameters)
814.   		{

crypto/ec/ec_asn1.c:813:7: Taking false branch
811.   
812.   	if (!params->fieldID || !params->fieldID->fieldType || 
813.   	    !params->fieldID->parameters)
             ^
814.   		{
815.   		ECerr(EC_F_EC_ASN1_PARAMETERS2GROUP, EC_R_ASN1_ERROR);

crypto/ec/ec_asn1.c:820:7: Taking false branch
818.   
819.   	/* now extract the curve parameters a and b */
820.   	if (!params->curve || !params->curve->a || 
             ^
821.   	    !params->curve->a->data || !params->curve->b ||
822.   	    !params->curve->b->data)

crypto/ec/ec_asn1.c:820:25: Taking false branch
818.   
819.   	/* now extract the curve parameters a and b */
820.   	if (!params->curve || !params->curve->a || 
                               ^
821.   	    !params->curve->a->data || !params->curve->b ||
822.   	    !params->curve->b->data)

crypto/ec/ec_asn1.c:821:7: Taking false branch
819.   	/* now extract the curve parameters a and b */
820.   	if (!params->curve || !params->curve->a || 
821.   	    !params->curve->a->data || !params->curve->b ||
             ^
822.   	    !params->curve->b->data)
823.   		{

crypto/ec/ec_asn1.c:821:34: Taking false branch
819.   	/* now extract the curve parameters a and b */
820.   	if (!params->curve || !params->curve->a || 
821.   	    !params->curve->a->data || !params->curve->b ||
                                        ^
822.   	    !params->curve->b->data)
823.   		{

crypto/ec/ec_asn1.c:822:7: Taking false branch
820.   	if (!params->curve || !params->curve->a || 
821.   	    !params->curve->a->data || !params->curve->b ||
822.   	    !params->curve->b->data)
             ^
823.   		{
824.   		ECerr(EC_F_EC_ASN1_PARAMETERS2GROUP, EC_R_ASN1_ERROR);

crypto/ec/ec_asn1.c:827:2: Skipping BN_bin2bn(): empty list of specs
825.   		goto err;
826.   		}
827.   	a = BN_bin2bn(params->curve->a->data, params->curve->a->length, NULL);
        ^
828.   	if (a == NULL)
829.   		{

crypto/ec/ec_asn1.c:828:6: Taking false branch
826.   		}
827.   	a = BN_bin2bn(params->curve->a->data, params->curve->a->length, NULL);
828.   	if (a == NULL)
            ^
829.   		{
830.   		ECerr(EC_F_EC_ASN1_PARAMETERS2GROUP, ERR_R_BN_LIB);

crypto/ec/ec_asn1.c:833:2: Skipping BN_bin2bn(): empty list of specs
831.   		goto err;
832.   		}
833.   	b = BN_bin2bn(params->curve->b->data, params->curve->b->length, NULL);
        ^
834.   	if (b == NULL)
835.   		{

crypto/ec/ec_asn1.c:834:6: Taking false branch
832.   		}
833.   	b = BN_bin2bn(params->curve->b->data, params->curve->b->length, NULL);
834.   	if (b == NULL)
            ^
835.   		{
836.   		ECerr(EC_F_EC_ASN1_PARAMETERS2GROUP, ERR_R_BN_LIB);

crypto/ec/ec_asn1.c:841:2: 
839.   
840.   	/* get the field parameters */
841. > 	tmp = OBJ_obj2nid(params->fieldID->fieldType);
842.   
843.   	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:843:6: Taking false branch
841.   	tmp = OBJ_obj2nid(params->fieldID->fieldType);
842.   
843.   	if (tmp == NID_X9_62_characteristic_two_field)
            ^
844.   		{
845.   		ASN1_TYPE *parameters = params->fieldID->parameters;

crypto/ec/ec_asn1.c:940:11: Taking false branch
938.   			}
939.   		}
940.   	else if (tmp == NID_X9_62_prime_field)
                 ^
941.   		{
942.   		/* we have a curve over a prime field */

crypto/ec/ec_asn1.c:966:6: Taking true branch
964.   
965.   	/* extract seed (optional) */
966.   	if (params->curve->seed != NULL)
            ^
967.   		{
968.   		if (ret->seed != NULL)

crypto/ec/ec_asn1.c:968:7: 
966.   	if (params->curve->seed != NULL)
967.   		{
968. > 		if (ret->seed != NULL)
969.   			OPENSSL_free(ret->seed);
970.   		if (!(ret->seed = OPENSSL_malloc(params->curve->seed->length)))
