apps/s_client.c:254: error: INTEGER_OVERFLOW_L2
  ([0, +oo] - 1):unsigned64 by call to `BN_num_bits`.
Showing all 6 steps of the trace


apps/s_client.c:245:13: Call
243.   	if (c_debug)
244.   		BIO_printf(bio_c_out, "created identity '%s' len=%d\n", identity, ret);
245.           ret=BN_hex2bn(&bn, psk_key);
                   ^
246.           if (!ret)
247.                   {

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;

apps/s_client.c:254:27: Call
252.                   }
253.   
254.           if ((unsigned int)BN_num_bytes(bn) > max_psk_len)
                                 ^
255.                   {
256.                   BIO_printf(bio_err,"psk buffer of callback is too small (%d) for key (%d)\n",

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 unsigned int psk_client_cb(SSL *ssl, const char *hint, char *identity,\n\tunsigned int max_identity_len, unsigned char *psk,\n\tunsigned int max_psk_len)\n\t{\n\tunsigned int psk_len = 0;\n\tint ret;\n        BIGNUM *bn=NULL;\n\tif (c_debug)\n\t\tBIO_printf(bio_c_out, "psk_client_cb\\n");\n\tif (!hint)\n                {\n\t\tif (c_debug)\n\t\t\tBIO_printf(bio_c_out,"NULL received PSK identity hint, continuing anyway\\n");\n                }\n        else if (c_debug)\n\t\tBIO_printf(bio_c_out, "Received PSK identity hint \'%s\'\\n", hint);\n\tret = BIO_snprintf(identity, max_identity_len, psk_identity);\n\tif (ret < 0 || (unsigned int)ret > max_identity_len)\n\t\tgoto out_err;\n\tif (c_debug)\n\t\tBIO_printf(bio_c_out, "created identity \'%s\' len=%d\\n", identity, ret);\n        ret=BN_hex2bn(&bn, psk_key);\n        if (!ret)\n                {\n                BIO_printf(bio_err,"Could not convert PSK key \'%s\' to BIGNUM\\n", psk_key);\n                if (bn)\n                        BN_free(bn);\n                return 0;\n                }\n        if ((unsigned int)BN_num_bytes(bn) > max_psk_len)\n                {\n                BIO_printf(bio_err,"psk buffer of callback is too small (%d) for key (%d)\\n",\n                        max_psk_len, BN_num_bytes(bn));\n                BN_free(bn);\n                return 0;\n                }\n        psk_len=BN_bn2bin(bn, psk);\n        BN_free(bn);\n        if (psk_len == 0)\n                goto out_err;\n\tif (c_debug)\n\t\tBIO_printf(bio_c_out, "created PSK len=%d\\n", psk_len);\n        return psk_len;\n out_err:\n\tif (c_debug)\n\t\tBIO_printf(bio_err, "Error in PSK client callback\\n");\n        return 0;\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}']