crypto/bn/bn_lib.c:634: error: INTEGER_OVERFLOW_L2
  ([min(0, `len`), `len`] - 1):unsigned32.
Showing all 4 steps of the trace


crypto/bn/bn_lib.c:613:1: <LHS trace>
611.   }
612.   
613. > BIGNUM *BN_lebin2bn(const unsigned char *s, int len, BIGNUM *ret)
614.   {
615.       unsigned int i, m;

crypto/bn/bn_lib.c:613:1: Parameter `len`
611.   }
612.   
613. > BIGNUM *BN_lebin2bn(const unsigned char *s, int len, BIGNUM *ret)
614.   {
615.       unsigned int i, m;

crypto/bn/bn_lib.c:629:5: Assignment
627.       for ( ; len > 0 && *s == 0; s--, len--)
628.           continue;
629.       n = len;
           ^
630.       if (n == 0) {
631.           ret->top = 0;

crypto/bn/bn_lib.c:634:5: Binary operation: ([min(0, len), len] - 1):unsigned32
632.           return ret;
633.       }
634.       i = ((n - 1) / BN_BYTES) + 1;
           ^
635.       m = ((n - 1) % (BN_BYTES));
636.       if (bn_wexpand(ret, (int)i) == NULL) {

BIGNUM *BN_lebin2bn(const unsigned char *s, int len, BIGNUM *ret)
{
    unsigned int i, m;
    unsigned int n;
    BN_ULONG l;
    BIGNUM *bn = NULL;
    if (ret == NULL)
        ret = bn = BN_new();
    if (ret == NULL)
        return (NULL);
    bn_check_top(ret);
    s += len - 1;
    for ( ; len > 0 && *s == 0; s--, len--)
        continue;
    n = len;
    if (n == 0) {
        ret->top = 0;
        return ret;
    }
    i = ((n - 1) / BN_BYTES) + 1;
    m = ((n - 1) % (BN_BYTES));
    if (bn_wexpand(ret, (int)i) == NULL) {
        BN_free(bn);
        return NULL;
    }
    ret->top = i;
    ret->neg = 0;
    l = 0;
    while (n--) {
        l = (l << 8L) | *(s--);
        if (m-- == 0) {
            ret->d[--i] = l;
            l = 0;
            m = BN_BYTES - 1;
        }
    }
    bn_correct_top(ret);
    return ret;
}
['BIGNUM *BN_lebin2bn(const unsigned char *s, int len, BIGNUM *ret)\n{\n    unsigned int i, m;\n    unsigned int n;\n    BN_ULONG l;\n    BIGNUM *bn = NULL;\n    if (ret == NULL)\n        ret = bn = BN_new();\n    if (ret == NULL)\n        return (NULL);\n    bn_check_top(ret);\n    s += len - 1;\n    for ( ; len > 0 && *s == 0; s--, len--)\n        continue;\n    n = len;\n    if (n == 0) {\n        ret->top = 0;\n        return ret;\n    }\n    i = ((n - 1) / BN_BYTES) + 1;\n    m = ((n - 1) % (BN_BYTES));\n    if (bn_wexpand(ret, (int)i) == NULL) {\n        BN_free(bn);\n        return NULL;\n    }\n    ret->top = i;\n    ret->neg = 0;\n    l = 0;\n    while (n--) {\n        l = (l << 8L) | *(s--);\n        if (m-- == 0) {\n            ret->d[--i] = l;\n            l = 0;\n            m = BN_BYTES - 1;\n        }\n    }\n    bn_correct_top(ret);\n    return ret;\n}']