apps/ca.c:1273: error: INTEGER_OVERFLOW_L2
  ([0, +oo] - 1):unsigned64 by call to `save_serial`.
Showing all 11 steps of the trace


apps/ca.c:1139:15: Call
1137.   			}
1138.   
1139.   		if ((serial=load_serial(serialfile, create_ser, NULL)) == NULL)
                      ^
1140.   			{
1141.   			BIO_printf(bio_err,"error while loading serial number\n");

apps/apps.c:1542:8: Call
  1540.   		else
  1541.   			{
  1542.   			ret=BN_new();
                 ^
  1543.   			if (ret == NULL || !rand_serial(ret, ai))
  1544.   				BIO_printf(bio_err, "Out of memory\n");

crypto/bn/bn_lib.c:308:2: Assignment
    306.   		}
    307.   	ret->flags=BN_FLG_MALLOCED;
    308.   	ret->top=0;
            ^
    309.   	ret->neg=0;
    310.   	ret->dmax=0;

apps/ca.c:1273:9: Call
1271.   			BIO_printf(bio_err,"Write out database with %d new entries\n",sk_X509_num(cert_sk));
1272.   
1273.   			if (!save_serial(serialfile,"new",serial,NULL)) goto err;
                ^
1274.   
1275.   			if (!save_index(dbfile, "new", db)) goto err;

apps/apps.c:1574:1: Parameter `serial->top`
  1572.   	}
  1573.   
  1574. > int save_serial(char *serialfile, char *suffix, BIGNUM *serial, ASN1_INTEGER **retai)
  1575.   	{
  1576.   	char buf[1][BSIZE];

apps/apps.c:1617:10: Call
  1615.   		}
  1616.   
  1617.   	if ((ai=BN_to_ASN1_INTEGER(serial,NULL)) == NULL)
                   ^
  1618.   		{
  1619.   		BIO_printf(bio_err,"error converting serial to ASN.1 format\n");

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 `save_serial` 
      248.   int BN_num_bits(const BIGNUM *a)
      249.   	{
      250.   	int i = a->top - 1;
              ^
      251.   	bn_check_top(a);
      252.   
