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


apps/x509.c:1092:11: Call
1090.   		BUF_strlcpy(buf,serialfile,len);
1091.   
1092.   	serial = load_serial(buf, create, NULL);
                  ^
1093.   	if (serial == NULL) goto end;
1094.   

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/x509.c:1095:7: Call
1093.   	if (serial == NULL) goto end;
1094.   
1095.   	if (!BN_add_word(serial,1))
              ^
1096.   		{ BIO_printf(bio_err,"add_word failure\n"); goto end; }
1097.   

crypto/bn/bn_word.c:126:1: Parameter `a->top`
  124.   	}
  125.   
  126. > int BN_add_word(BIGNUM *a, BN_ULONG w)
  127.   	{
  128.   	BN_ULONG l;

apps/x509.c:1098:7: Call
1096.   		{ BIO_printf(bio_err,"add_word failure\n"); goto end; }
1097.   
1098.   	if (!save_serial(buf, NULL, serial, &bs)) goto end;
              ^
1099.   
1100.    end:

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.   
