crypto/pem/pvkfmt.c:454: error: INTEGER_OVERFLOW_L2
  ([0, `bn->top`] - 1):unsigned64 by call to `BN_bn2bin`.
Showing all 9 steps of the trace


crypto/pem/pvkfmt.c:449:1: Parameter `bn->top`
447.   	}
448.   
449. > static void write_lebn(unsigned char **out, const BIGNUM *bn, int len)
450.   	{
451.   	int nb, i;

crypto/pem/pvkfmt.c:453:7: Call
451.   	int nb, i;
452.   	unsigned char *p = *out, *q, c;
453.   	nb = BN_num_bytes(bn);
             ^
454.   	BN_bn2bin(bn, p);
455.   	q = p + nb - 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/pem/pvkfmt.c:454:2: Call
452.   	unsigned char *p = *out, *q, c;
453.   	nb = BN_num_bytes(bn);
454.   	BN_bn2bin(bn, p);
        ^
455.   	q = p + nb - 1;
456.   	/* In place byte order reversal */

crypto/bn/bn_lib.c:641:1: Parameter `a->top`
  639.   
  640.   /* ignore negative */
  641. > int BN_bn2bin(const BIGNUM *a, unsigned char *to)
  642.   	{
  643.   	int n,i;

crypto/bn/bn_lib.c:647:6: Call
  645.   
  646.   	bn_check_top(a);
  647.   	n=i=BN_num_bytes(a);
              ^
  648.   	while (i--)
  649.   		{

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, bn->top] - 1):unsigned64 by call to `BN_bn2bin` 
    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]));
	}
['static void write_lebn(unsigned char **out, const BIGNUM *bn, int len)\n\t{\n\tint nb, i;\n\tunsigned char *p = *out, *q, c;\n\tnb = BN_num_bytes(bn);\n\tBN_bn2bin(bn, p);\n\tq = p + nb - 1;\n\tfor (i = 0; i < nb/2; i++)\n\t\t{\n\t\tc = *p;\n\t\t*p++ = *q;\n\t\t*q-- = c;\n\t\t}\n\t*out += nb;\n\tif (len > 0)\n\t\t{\n\t\tlen -= nb;\n\t\tif (len > 0)\n\t\t\t{\n\t\t\tmemset(*out, 0, len);\n\t\t\t*out += len;\n\t\t\t}\n\t\t}\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}', 'int BN_bn2bin(const BIGNUM *a, unsigned char *to)\n\t{\n\tint n,i;\n\tBN_ULONG l;\n\tbn_check_top(a);\n\tn=i=BN_num_bytes(a);\n\twhile (i--)\n\t\t{\n\t\tl=a->d[i/BN_BYTES];\n\t\t*(to++)=(unsigned char)(l>>(8*(i%BN_BYTES)))&0xff;\n\t\t}\n\treturn(n);\n\t}']