crypto/bn/bn_print.c:159: error: INTEGER_OVERFLOW_L2
  ([4, 2147483584] + 64):signed32 by call to `bn_expand`.
Showing all 5 steps of the trace


crypto/bn/bn_print.c:139:10: Assignment
137.       }
138.   
139.       for (i = 0; i <= (INT_MAX/4) && isxdigit((unsigned char)a[i]); i++)
                ^
140.           continue;
141.   

crypto/bn/bn_print.c:159:9: Call
157.   
158.       /* i is the number of hex digits */
159.       if (bn_expand(ret, i * 4) == NULL)
               ^
160.           goto err;
161.   

crypto/bn/bn_lcl.h:676:1: <LHS trace>
674.   int bn_probable_prime_dh_coprime(BIGNUM *rnd, int bits, BN_CTX *ctx);
675.   
676. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits)
677.   {
678.       if (bits > (INT_MAX - BN_BITS2 + 1))

crypto/bn/bn_lcl.h:676:1: Parameter `bits`
  674.   int bn_probable_prime_dh_coprime(BIGNUM *rnd, int bits, BN_CTX *ctx);
  675.   
  676. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits)
  677.   {
  678.       if (bits > (INT_MAX - BN_BITS2 + 1))

crypto/bn/bn_lcl.h:681:9: Binary operation: ([4, 2147483584] + 64):signed32 by call to `bn_expand` 
  679.           return NULL;
  680.   
  681.       if (((bits+BN_BITS2-1)/BN_BITS2) <= (a)->dmax)
                 ^
  682.           return a;
  683.   

static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits)
{
    if (bits > (INT_MAX - BN_BITS2 + 1))
        return NULL;
    if (((bits+BN_BITS2-1)/BN_BITS2) <= (a)->dmax)
        return a;
    return bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2);
}
["int BN_hex2bn(BIGNUM **bn, const char *a)\n{\n    BIGNUM *ret = NULL;\n    BN_ULONG l = 0;\n    int neg = 0, h, m, i, j, k, c;\n    int num;\n    if ((a == NULL) || (*a == '\\0'))\n        return (0);\n    if (*a == '-') {\n        neg = 1;\n        a++;\n    }\n    for (i = 0; i <= (INT_MAX/4) && isxdigit((unsigned char)a[i]); i++)\n        continue;\n    if (i == 0 || i > INT_MAX/4)\n        goto err;\n    num = i + neg;\n    if (bn == NULL)\n        return (num);\n    if (*bn == NULL) {\n        if ((ret = BN_new()) == NULL)\n            return (0);\n    } else {\n        ret = *bn;\n        BN_zero(ret);\n    }\n    if (bn_expand(ret, i * 4) == NULL)\n        goto err;\n    j = i;\n    m = 0;\n    h = 0;\n    while (j > 0) {\n        m = ((BN_BYTES * 2) <= j) ? (BN_BYTES * 2) : j;\n        l = 0;\n        for (;;) {\n            c = a[j - m];\n            k = OPENSSL_hexchar2int(c);\n            if (k < 0)\n                k = 0;\n            l = (l << 4) | k;\n            if (--m <= 0) {\n                ret->d[h++] = l;\n                break;\n            }\n        }\n        j -= (BN_BYTES * 2);\n    }\n    ret->top = h;\n    bn_correct_top(ret);\n    ret->neg = neg;\n    *bn = ret;\n    bn_check_top(ret);\n    return (num);\n err:\n    if (*bn == NULL)\n        BN_free(ret);\n    return (0);\n}", 'static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits)\n{\n    if (bits > (INT_MAX - BN_BITS2 + 1))\n        return NULL;\n    if (((bits+BN_BITS2-1)/BN_BITS2) <= (a)->dmax)\n        return a;\n    return bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2);\n}']