crypto/x509v3/v3_utl.c:191: error: INTEGER_OVERFLOW_L2
  ([0, +oo] - 1):unsigned64 by call to `BN_to_ASN1_INTEGER`.
Showing all 8 steps of the trace


crypto/x509v3/v3_utl.c:180:19: Call
178.   	} else ishex = 0;
179.   
180.   	if (ishex) ret = BN_hex2bn(&bn, value);
                         ^
181.   	else ret = BN_dec2bn(&bn, value);
182.   

crypto/bn/bn_print.c:172:1: Parameter `(*bn)->top`
  170.   	}
  171.   
  172. > int BN_hex2bn(BIGNUM **bn, const char *a)
  173.   	{
  174.   	BIGNUM *ret=NULL;

crypto/x509v3/v3_utl.c:191:9: Call
189.   	if (isneg && BN_is_zero(bn)) isneg = 0;
190.   
191.   	aint = BN_to_ASN1_INTEGER(bn, NULL);
               ^
192.   	BN_free(bn);
193.   	if (!aint) {

crypto/asn1/a_int.c:405:1: Parameter `bn->top`
  403.   	}
  404.   
  405. > ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai)
  406.   	{
  407.   	ASN1_INTEGER *ret;

crypto/asn1/a_int.c:422:4: Call
  420.   		ret->type = V_ASN1_NEG_INTEGER;
  421.   	else ret->type=V_ASN1_INTEGER;
  422.   	j=BN_num_bits(bn);
            ^
  423.   	len=((j == 0)?0:((j/8)+1));
  424.   	if (ret->length < len+4)

crypto/bn/bn_lib.c:248:1: <LHS trace>
246.   	}
247.   
248. > int BN_num_bits(const BIGNUM *a)
249.   	{
250.   	int i = a->top - 1;

crypto/bn/bn_lib.c:248:1: Parameter `a->top`
    246.   	}
    247.   
    248. > int BN_num_bits(const BIGNUM *a)
    249.   	{
    250.   	int i = a->top - 1;

crypto/bn/bn_lib.c:250:2: Binary operation: ([0, +oo] - 1):unsigned64 by call to `BN_to_ASN1_INTEGER` 
    248.   int BN_num_bits(const BIGNUM *a)
    249.   	{
    250.   	int i = a->top - 1;
            ^
    251.   	bn_check_top(a);
    252.   

int BN_num_bits(const BIGNUM *a)
	{
	int i = a->top - 1;
	bn_check_top(a);
	if (BN_is_zero(a)) return 0;
	return ((i*BN_BITS2) + BN_num_bits_word(a->d[i]));
	}
["ASN1_INTEGER *s2i_ASN1_INTEGER(X509V3_EXT_METHOD *method, char *value)\n{\n\tBIGNUM *bn = NULL;\n\tASN1_INTEGER *aint;\n\tint isneg, ishex;\n\tint ret;\n\tif (!value) {\n\t\tX509V3err(X509V3_F_S2I_ASN1_INTEGER,X509V3_R_INVALID_NULL_VALUE);\n\t\treturn 0;\n\t}\n\tbn = BN_new();\n\tif (value[0] == '-') {\n\t\tvalue++;\n\t\tisneg = 1;\n\t} else isneg = 0;\n\tif (value[0] == '0' && ((value[1] == 'x') || (value[1] == 'X'))) {\n\t\tvalue += 2;\n\t\tishex = 1;\n\t} else ishex = 0;\n\tif (ishex) ret = BN_hex2bn(&bn, value);\n\telse ret = BN_dec2bn(&bn, value);\n\tif (!ret || value[ret]) {\n\t\tBN_free(bn);\n\t\tX509V3err(X509V3_F_S2I_ASN1_INTEGER,X509V3_R_BN_DEC2BN_ERROR);\n\t\treturn 0;\n\t}\n\tif (isneg && BN_is_zero(bn)) isneg = 0;\n\taint = BN_to_ASN1_INTEGER(bn, NULL);\n\tBN_free(bn);\n\tif (!aint) {\n\t\tX509V3err(X509V3_F_S2I_ASN1_INTEGER,X509V3_R_BN_TO_ASN1_INTEGER_ERROR);\n\t\treturn 0;\n\t}\n\tif (isneg) aint->type |= V_ASN1_NEG;\n\treturn aint;\n}", "int BN_hex2bn(BIGNUM **bn, const char *a)\n\t{\n\tBIGNUM *ret=NULL;\n\tBN_ULONG l=0;\n\tint neg=0,h,m,i,j,k,c;\n\tint num;\n\tif ((a == NULL) || (*a == '\\0')) return(0);\n\tif (*a == '-') { neg=1; a++; }\n\tfor (i=0; isxdigit((unsigned char) a[i]); i++)\n\t\t;\n\tnum=i+neg;\n\tif (bn == NULL) return(num);\n\tif (*bn == NULL)\n\t\t{\n\t\tif ((ret=BN_new()) == NULL) return(0);\n\t\t}\n\telse\n\t\t{\n\t\tret= *bn;\n\t\tBN_zero(ret);\n\t\t}\n\tif (bn_expand(ret,i*4) == NULL) goto err;\n\tj=i;\n\tm=0;\n\th=0;\n\twhile (j > 0)\n\t\t{\n\t\tm=((BN_BYTES*2) <= j)?(BN_BYTES*2):j;\n\t\tl=0;\n\t\tfor (;;)\n\t\t\t{\n\t\t\tc=a[j-m];\n\t\t\tif ((c >= '0') && (c <= '9')) k=c-'0';\n\t\t\telse if ((c >= 'a') && (c <= 'f')) k=c-'a'+10;\n\t\t\telse if ((c >= 'A') && (c <= 'F')) k=c-'A'+10;\n\t\t\telse k=0;\n\t\t\tl=(l<<4)|k;\n\t\t\tif (--m <= 0)\n\t\t\t\t{\n\t\t\t\tret->d[h++]=l;\n\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\tj-=(BN_BYTES*2);\n\t\t}\n\tret->top=h;\n\tbn_correct_top(ret);\n\tret->neg=neg;\n\t*bn=ret;\n\tbn_check_top(ret);\n\treturn(num);\nerr:\n\tif (*bn == NULL) BN_free(ret);\n\treturn(0);\n\t}", 'ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai)\n\t{\n\tASN1_INTEGER *ret;\n\tsize_t len,j;\n\tif (ai == NULL)\n\t\tret=M_ASN1_INTEGER_new();\n\telse\n\t\tret=ai;\n\tif (ret == NULL)\n\t\t{\n\t\tASN1err(ASN1_F_BN_TO_ASN1_INTEGER,ERR_R_NESTED_ASN1_ERROR);\n\t\tgoto err;\n\t\t}\n\tif (BN_is_negative(bn))\n\t\tret->type = V_ASN1_NEG_INTEGER;\n\telse ret->type=V_ASN1_INTEGER;\n\tj=BN_num_bits(bn);\n\tlen=((j == 0)?0:((j/8)+1));\n\tif (ret->length < len+4)\n\t\t{\n\t\tunsigned char *new_data=OPENSSL_realloc(ret->data, len+4U);\n\t\tif (!new_data)\n\t\t\t{\n\t\t\tASN1err(ASN1_F_BN_TO_ASN1_INTEGER,ERR_R_MALLOC_FAILURE);\n\t\t\tgoto err;\n\t\t\t}\n\t\tret->data=new_data;\n\t\t}\n\tret->length=BN_bn2bin(bn,ret->data);\n\tif(!ret->length)\n\t\t{\n\t\tret->data[0] = 0;\n\t\tret->length = 1;\n\t\t}\n\treturn(ret);\nerr:\n\tif (ret != ai) M_ASN1_INTEGER_free(ret);\n\treturn(NULL);\n\t}', 'int BN_num_bits(const BIGNUM *a)\n\t{\n\tint i = a->top - 1;\n\tbn_check_top(a);\n\tif (BN_is_zero(a)) return 0;\n\treturn ((i*BN_BITS2) + BN_num_bits_word(a->d[i]));\n\t}']