ssl/ssltest.c:2363: error: INTEGER_OVERFLOW_L2
  ([0, +oo] - 1):unsigned64 by call to `BN_num_bits`.
Showing all 8 steps of the trace


ssl/ssltest.c:2352:8: Call
2350.   	BIGNUM *bn = NULL;
2351.   
2352.   	ret = BN_hex2bn(&bn, pskkey);
               ^
2353.   	if (!ret)
2354.   		{

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;

ssl/ssltest.c:2360:6: Call
2358.   		return 0;
2359.   		}
2360.   	if (BN_num_bytes(bn) > (int)max_psk_len)
             ^
2361.   		{
2362.   		BIO_printf(bio_err,"psk buffer of callback is too small (%d) for key (%d)\n",

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;

ssl/ssltest.c:2363:17: Call
2361.   		{
2362.   		BIO_printf(bio_err,"psk buffer of callback is too small (%d) for key (%d)\n",
2363.   			max_psk_len, BN_num_bytes(bn));
                        ^
2364.   		BN_free(bn);
2365.   		return 0;

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_num_bits` 
  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 int psk_key2bn(const char *pskkey, unsigned char *psk,\n\tunsigned int max_psk_len)\n\t{\n\tint ret;\n\tBIGNUM *bn = NULL;\n\tret = BN_hex2bn(&bn, pskkey);\n\tif (!ret)\n\t\t{\n\t\tBIO_printf(bio_err,"Could not convert PSK key \'%s\' to BIGNUM\\n", pskkey);\n\t\tif (bn)\n\t\t\tBN_free(bn);\n\t\treturn 0;\n\t\t}\n\tif (BN_num_bytes(bn) > (int)max_psk_len)\n\t\t{\n\t\tBIO_printf(bio_err,"psk buffer of callback is too small (%d) for key (%d)\\n",\n\t\t\tmax_psk_len, BN_num_bytes(bn));\n\t\tBN_free(bn);\n\t\treturn 0;\n\t\t}\n\tret = BN_bn2bin(bn, psk);\n\tBN_free(bn);\n\treturn ret;\n\t}', "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}", '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}']