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


crypto/x509v3/v3_utl.c:140:15: Call
138.   	char *strtmp = NULL;
139.   	if(!a) return NULL;
140.   	if(!(bntmp = ASN1_ENUMERATED_to_BN(a, NULL)) ||
                     ^
141.   	    !(strtmp = BN_bn2dec(bntmp)) )
142.   		X509V3err(X509V3_F_I2S_ASN1_ENUMERATED,ERR_R_MALLOC_FAILURE);

crypto/asn1/a_enum.c:178:11: Call
  176.   	BIGNUM *ret;
  177.   
  178.   	if ((ret=BN_bin2bn(ai->data,ai->length,bn)) == NULL)
                   ^
  179.   		ASN1err(ASN1_F_ASN1_ENUMERATED_TO_BN,ASN1_R_BN_LIB);
  180.   	else if(ai->type == V_ASN1_NEG_ENUMERATED) BN_set_negative(ret,1);

crypto/bn/bn_lib.c:597:1: Parameter `ret->top`
    595.   	}
    596.   
    597. > BIGNUM *BN_bin2bn(const unsigned char *s, size_t len, BIGNUM *ret)
    598.   	{
    599.   	unsigned int i,m;

crypto/x509v3/v3_utl.c:141:17: Call
139.   	if(!a) return NULL;
140.   	if(!(bntmp = ASN1_ENUMERATED_to_BN(a, NULL)) ||
141.   	    !(strtmp = BN_bn2dec(bntmp)) )
                       ^
142.   		X509V3err(X509V3_F_I2S_ASN1_ENUMERATED,ERR_R_MALLOC_FAILURE);
143.   	BN_free(bntmp);

crypto/bn/bn_print.c:103:1: Parameter `a->top`
  101.   
  102.   /* Must 'OPENSSL_free' the returned data */
  103. > char *BN_bn2dec(const BIGNUM *a)
  104.   	{
  105.   	int i=0,num, ok = 0;

crypto/bn/bn_print.c:116:4: Call
  114.   	 *     <= BN_num_bits(a)/10 + BN_num_bits/1000 + 1 + 1 
  115.   	 */
  116.   	i=BN_num_bits(a)*3;
            ^
  117.   	num=(i/10+i/1000+1)+1;
  118.   	bn_data=(BN_ULONG *)OPENSSL_malloc((num/BN_DEC_NUM+1)*sizeof(BN_ULONG));

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_bn2dec` 
    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]));
	}
['char *i2s_ASN1_ENUMERATED(X509V3_EXT_METHOD *method, ASN1_ENUMERATED *a)\n{\n\tBIGNUM *bntmp = NULL;\n\tchar *strtmp = NULL;\n\tif(!a) return NULL;\n\tif(!(bntmp = ASN1_ENUMERATED_to_BN(a, NULL)) ||\n\t    !(strtmp = BN_bn2dec(bntmp)) )\n\t\tX509V3err(X509V3_F_I2S_ASN1_ENUMERATED,ERR_R_MALLOC_FAILURE);\n\tBN_free(bntmp);\n\treturn strtmp;\n}', 'BIGNUM *ASN1_ENUMERATED_to_BN(ASN1_ENUMERATED *ai, BIGNUM *bn)\n\t{\n\tBIGNUM *ret;\n\tif ((ret=BN_bin2bn(ai->data,ai->length,bn)) == NULL)\n\t\tASN1err(ASN1_F_ASN1_ENUMERATED_TO_BN,ASN1_R_BN_LIB);\n\telse if(ai->type == V_ASN1_NEG_ENUMERATED) BN_set_negative(ret,1);\n\treturn(ret);\n\t}', 'BIGNUM *BN_bin2bn(const unsigned char *s, size_t len, BIGNUM *ret)\n\t{\n\tunsigned int i,m;\n\tunsigned int n;\n\tBN_ULONG l;\n\tBIGNUM  *bn = NULL;\n\tif (ret == NULL)\n\t\tret = bn = BN_new();\n\tif (ret == NULL) return(NULL);\n\tbn_check_top(ret);\n\tl=0;\n\tn=len;\n\tif (n == 0)\n\t\t{\n\t\tret->top=0;\n\t\treturn(ret);\n\t\t}\n\ti=((n-1)/BN_BYTES)+1;\n\tm=((n-1)%(BN_BYTES));\n\tif (bn_wexpand(ret, i) == NULL)\n\t\t{\n\t\tif (bn) BN_free(bn);\n\t\treturn NULL;\n\t\t}\n\tret->top=i;\n\tret->neg=0;\n\twhile (n--)\n\t\t{\n\t\tl=(l<<8L)| *(s++);\n\t\tif (m-- == 0)\n\t\t\t{\n\t\t\tret->d[--i]=l;\n\t\t\tl=0;\n\t\t\tm=BN_BYTES-1;\n\t\t\t}\n\t\t}\n\tbn_correct_top(ret);\n\treturn(ret);\n\t}', "char *BN_bn2dec(const BIGNUM *a)\n\t{\n\tint i=0,num, ok = 0;\n\tchar *buf=NULL;\n\tchar *p;\n\tBIGNUM *t=NULL;\n\tBN_ULONG *bn_data=NULL,*lp;\n\ti=BN_num_bits(a)*3;\n\tnum=(i/10+i/1000+1)+1;\n\tbn_data=(BN_ULONG *)OPENSSL_malloc((num/BN_DEC_NUM+1)*sizeof(BN_ULONG));\n\tbuf=OPENSSL_malloc(num+3);\n\tif ((buf == NULL) || (bn_data == NULL))\n\t\t{\n\t\tBNerr(BN_F_BN_BN2DEC,ERR_R_MALLOC_FAILURE);\n\t\tgoto err;\n\t\t}\n\tif ((t=BN_dup(a)) == NULL) goto err;\n#define BUF_REMAIN (num+3 - (size_t)(p - buf))\n\tp=buf;\n\tlp=bn_data;\n\tif (BN_is_zero(t))\n\t\t{\n\t\t*(p++)='0';\n\t\t*(p++)='\\0';\n\t\t}\n\telse\n\t\t{\n\t\tif (BN_is_negative(t))\n\t\t\t*p++ = '-';\n\t\ti=0;\n\t\twhile (!BN_is_zero(t))\n\t\t\t{\n\t\t\t*lp=BN_div_word(t,BN_DEC_CONV);\n\t\t\tlp++;\n\t\t\t}\n\t\tlp--;\n\t\tBIO_snprintf(p,BUF_REMAIN,BN_DEC_FMT1,*lp);\n\t\twhile (*p) p++;\n\t\twhile (lp != bn_data)\n\t\t\t{\n\t\t\tlp--;\n\t\t\tBIO_snprintf(p,BUF_REMAIN,BN_DEC_FMT2,*lp);\n\t\t\twhile (*p) p++;\n\t\t\t}\n\t\t}\n\tok = 1;\nerr:\n\tif (bn_data != NULL) OPENSSL_free(bn_data);\n\tif (t != NULL) BN_free(t);\n\tif (!ok && buf)\n\t\t{\n\t\tOPENSSL_free(buf);\n\t\tbuf = NULL;\n\t\t}\n\treturn(buf);\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}']