crypto/asn1/t_req.c:119: error: INTEGER_OVERFLOW_L2
  ([-9223372036854775808, 9223372036854775807] + 1):signed64.
Showing all 5 steps of the trace


crypto/asn1/t_req.c:118:13: <LHS trace>
116.       }
117.       if (!(cflag & X509_FLAG_NO_VERSION)) {
118.           l = X509_REQ_get_version(x);
                   ^
119.           if (BIO_printf(bp, "%8sVersion: %ld (0x%lx)\n", "", l + 1, l) <= 0)
120.               goto err;

crypto/asn1/t_req.c:118:13: Call
116.       }
117.       if (!(cflag & X509_FLAG_NO_VERSION)) {
118.           l = X509_REQ_get_version(x);
                   ^
119.           if (BIO_printf(bp, "%8sVersion: %ld (0x%lx)\n", "", l + 1, l) <= 0)
120.               goto err;

crypto/asn1/a_int.c:613:9: Assignment
  611.       int64_t r;
  612.       if (a == NULL)
  613.           return 0;
                 ^
  614.       i = ASN1_INTEGER_get_int64(&r, a);
  615.       if (i == 0)

crypto/asn1/t_req.c:118:9: Assignment
116.       }
117.       if (!(cflag & X509_FLAG_NO_VERSION)) {
118.           l = X509_REQ_get_version(x);
               ^
119.           if (BIO_printf(bp, "%8sVersion: %ld (0x%lx)\n", "", l + 1, l) <= 0)
120.               goto err;

crypto/asn1/t_req.c:119:13: Binary operation: ([-9223372036854775808, 9223372036854775807] + 1):signed64
117.       if (!(cflag & X509_FLAG_NO_VERSION)) {
118.           l = X509_REQ_get_version(x);
119.           if (BIO_printf(bp, "%8sVersion: %ld (0x%lx)\n", "", l + 1, l) <= 0)
                   ^
120.               goto err;
121.       }

int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflags,
                      unsigned long cflag)
{
    long l;
    int i;
    X509_REQ_INFO *ri;
    EVP_PKEY *pkey;
    STACK_OF(X509_ATTRIBUTE) *sk;
    STACK_OF(X509_EXTENSION) *exts;
    char mlch = ' ';
    int nmindent = 0;
    if ((nmflags & XN_FLAG_SEP_MASK) == XN_FLAG_SEP_MULTILINE) {
        mlch = '\n';
        nmindent = 12;
    }
    if (nmflags == X509_FLAG_COMPAT)
        nmindent = 16;
    ri = x->req_info;
    if (!(cflag & X509_FLAG_NO_HEADER)) {
        if (BIO_write(bp, "Certificate Request:\n", 21) <= 0)
            goto err;
        if (BIO_write(bp, "    Data:\n", 10) <= 0)
            goto err;
    }
    if (!(cflag & X509_FLAG_NO_VERSION)) {
        l = X509_REQ_get_version(x);
        if (BIO_printf(bp, "%8sVersion: %ld (0x%lx)\n", "", l + 1, l) <= 0)
            goto err;
    }
    if (!(cflag & X509_FLAG_NO_SUBJECT)) {
        if (BIO_printf(bp, "        Subject:%c", mlch) <= 0)
            goto err;
        if (X509_NAME_print_ex(bp, ri->subject, nmindent, nmflags) < 0)
            goto err;
        if (BIO_write(bp, "\n", 1) <= 0)
            goto err;
    }
    if (!(cflag & X509_FLAG_NO_PUBKEY)) {
        if (BIO_write(bp, "        Subject Public Key Info:\n", 33) <= 0)
            goto err;
        if (BIO_printf(bp, "%12sPublic Key Algorithm: ", "") <= 0)
            goto err;
        if (i2a_ASN1_OBJECT(bp, ri->pubkey->algor->algorithm) <= 0)
            goto err;
        if (BIO_puts(bp, "\n") <= 0)
            goto err;
        pkey = X509_REQ_get_pubkey(x);
        if (pkey == NULL) {
            BIO_printf(bp, "%12sUnable to load Public Key\n", "");
            ERR_print_errors(bp);
        } else {
            EVP_PKEY_print_public(bp, pkey, 16, NULL);
            EVP_PKEY_free(pkey);
        }
    }
    if (!(cflag & X509_FLAG_NO_ATTRIBUTES)) {
        if (BIO_printf(bp, "%8sAttributes:\n", "") <= 0)
            goto err;
        sk = x->req_info->attributes;
        if (sk_X509_ATTRIBUTE_num(sk) == 0) {
            if (BIO_printf(bp, "%12sa0:00\n", "") <= 0)
                goto err;
        } else {
            for (i = 0; i < sk_X509_ATTRIBUTE_num(sk); i++) {
                ASN1_TYPE *at;
                X509_ATTRIBUTE *a;
                ASN1_BIT_STRING *bs = NULL;
                ASN1_OBJECT *aobj;
                int j, type = 0, count = 1, ii = 0;
                a = sk_X509_ATTRIBUTE_value(sk, i);
                aobj = X509_ATTRIBUTE_get0_object(a);
                if (X509_REQ_extension_nid(OBJ_obj2nid(aobj)))
                    continue;
                if (BIO_printf(bp, "%12s", "") <= 0)
                    goto err;
                if ((j = i2a_ASN1_OBJECT(bp, aobj)) > 0) {
                    ii = 0;
                    count = X509_ATTRIBUTE_count(a);
 get_next:
                    at = X509_ATTRIBUTE_get0_type(a, ii);
                    type = at->type;
                    bs = at->value.asn1_string;
                }
                for (j = 25 - j; j > 0; j--)
                    if (BIO_write(bp, " ", 1) != 1)
                        goto err;
                if (BIO_puts(bp, ":") <= 0)
                    goto err;
                if ((type == V_ASN1_PRINTABLESTRING) ||
                    (type == V_ASN1_T61STRING) ||
                    (type == V_ASN1_IA5STRING)) {
                    if (BIO_write(bp, (char *)bs->data, bs->length)
                        != bs->length)
                        goto err;
                    BIO_puts(bp, "\n");
                } else {
                    BIO_puts(bp, "unable to print attribute\n");
                }
                if (++ii < count)
                    goto get_next;
            }
        }
    }
    if (!(cflag & X509_FLAG_NO_EXTENSIONS)) {
        exts = X509_REQ_get_extensions(x);
        if (exts) {
            BIO_printf(bp, "%8sRequested Extensions:\n", "");
            for (i = 0; i < sk_X509_EXTENSION_num(exts); i++) {
                ASN1_OBJECT *obj;
                X509_EXTENSION *ex;
                int j;
                ex = sk_X509_EXTENSION_value(exts, i);
                if (BIO_printf(bp, "%12s", "") <= 0)
                    goto err;
                obj = X509_EXTENSION_get_object(ex);
                i2a_ASN1_OBJECT(bp, obj);
                j = X509_EXTENSION_get_critical(ex);
                if (BIO_printf(bp, ": %s\n", j ? "critical" : "") <= 0)
                    goto err;
                if (!X509V3_EXT_print(bp, ex, cflag, 16)) {
                    BIO_printf(bp, "%16s", "");
                    ASN1_STRING_print(bp, X509_EXTENSION_get_data(ex));
                }
                if (BIO_write(bp, "\n", 1) <= 0)
                    goto err;
            }
            sk_X509_EXTENSION_pop_free(exts, X509_EXTENSION_free);
        }
    }
    if (!(cflag & X509_FLAG_NO_SIGDUMP)) {
        if (!X509_signature_print(bp, x->sig_alg, x->signature))
            goto err;
    }
    return (1);
 err:
    X509err(X509_F_X509_REQ_PRINT_EX, ERR_R_BUF_LIB);
    return (0);
}
['int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflags,\n                      unsigned long cflag)\n{\n    long l;\n    int i;\n    X509_REQ_INFO *ri;\n    EVP_PKEY *pkey;\n    STACK_OF(X509_ATTRIBUTE) *sk;\n    STACK_OF(X509_EXTENSION) *exts;\n    char mlch = \' \';\n    int nmindent = 0;\n    if ((nmflags & XN_FLAG_SEP_MASK) == XN_FLAG_SEP_MULTILINE) {\n        mlch = \'\\n\';\n        nmindent = 12;\n    }\n    if (nmflags == X509_FLAG_COMPAT)\n        nmindent = 16;\n    ri = x->req_info;\n    if (!(cflag & X509_FLAG_NO_HEADER)) {\n        if (BIO_write(bp, "Certificate Request:\\n", 21) <= 0)\n            goto err;\n        if (BIO_write(bp, "    Data:\\n", 10) <= 0)\n            goto err;\n    }\n    if (!(cflag & X509_FLAG_NO_VERSION)) {\n        l = X509_REQ_get_version(x);\n        if (BIO_printf(bp, "%8sVersion: %ld (0x%lx)\\n", "", l + 1, l) <= 0)\n            goto err;\n    }\n    if (!(cflag & X509_FLAG_NO_SUBJECT)) {\n        if (BIO_printf(bp, "        Subject:%c", mlch) <= 0)\n            goto err;\n        if (X509_NAME_print_ex(bp, ri->subject, nmindent, nmflags) < 0)\n            goto err;\n        if (BIO_write(bp, "\\n", 1) <= 0)\n            goto err;\n    }\n    if (!(cflag & X509_FLAG_NO_PUBKEY)) {\n        if (BIO_write(bp, "        Subject Public Key Info:\\n", 33) <= 0)\n            goto err;\n        if (BIO_printf(bp, "%12sPublic Key Algorithm: ", "") <= 0)\n            goto err;\n        if (i2a_ASN1_OBJECT(bp, ri->pubkey->algor->algorithm) <= 0)\n            goto err;\n        if (BIO_puts(bp, "\\n") <= 0)\n            goto err;\n        pkey = X509_REQ_get_pubkey(x);\n        if (pkey == NULL) {\n            BIO_printf(bp, "%12sUnable to load Public Key\\n", "");\n            ERR_print_errors(bp);\n        } else {\n            EVP_PKEY_print_public(bp, pkey, 16, NULL);\n            EVP_PKEY_free(pkey);\n        }\n    }\n    if (!(cflag & X509_FLAG_NO_ATTRIBUTES)) {\n        if (BIO_printf(bp, "%8sAttributes:\\n", "") <= 0)\n            goto err;\n        sk = x->req_info->attributes;\n        if (sk_X509_ATTRIBUTE_num(sk) == 0) {\n            if (BIO_printf(bp, "%12sa0:00\\n", "") <= 0)\n                goto err;\n        } else {\n            for (i = 0; i < sk_X509_ATTRIBUTE_num(sk); i++) {\n                ASN1_TYPE *at;\n                X509_ATTRIBUTE *a;\n                ASN1_BIT_STRING *bs = NULL;\n                ASN1_OBJECT *aobj;\n                int j, type = 0, count = 1, ii = 0;\n                a = sk_X509_ATTRIBUTE_value(sk, i);\n                aobj = X509_ATTRIBUTE_get0_object(a);\n                if (X509_REQ_extension_nid(OBJ_obj2nid(aobj)))\n                    continue;\n                if (BIO_printf(bp, "%12s", "") <= 0)\n                    goto err;\n                if ((j = i2a_ASN1_OBJECT(bp, aobj)) > 0) {\n                    ii = 0;\n                    count = X509_ATTRIBUTE_count(a);\n get_next:\n                    at = X509_ATTRIBUTE_get0_type(a, ii);\n                    type = at->type;\n                    bs = at->value.asn1_string;\n                }\n                for (j = 25 - j; j > 0; j--)\n                    if (BIO_write(bp, " ", 1) != 1)\n                        goto err;\n                if (BIO_puts(bp, ":") <= 0)\n                    goto err;\n                if ((type == V_ASN1_PRINTABLESTRING) ||\n                    (type == V_ASN1_T61STRING) ||\n                    (type == V_ASN1_IA5STRING)) {\n                    if (BIO_write(bp, (char *)bs->data, bs->length)\n                        != bs->length)\n                        goto err;\n                    BIO_puts(bp, "\\n");\n                } else {\n                    BIO_puts(bp, "unable to print attribute\\n");\n                }\n                if (++ii < count)\n                    goto get_next;\n            }\n        }\n    }\n    if (!(cflag & X509_FLAG_NO_EXTENSIONS)) {\n        exts = X509_REQ_get_extensions(x);\n        if (exts) {\n            BIO_printf(bp, "%8sRequested Extensions:\\n", "");\n            for (i = 0; i < sk_X509_EXTENSION_num(exts); i++) {\n                ASN1_OBJECT *obj;\n                X509_EXTENSION *ex;\n                int j;\n                ex = sk_X509_EXTENSION_value(exts, i);\n                if (BIO_printf(bp, "%12s", "") <= 0)\n                    goto err;\n                obj = X509_EXTENSION_get_object(ex);\n                i2a_ASN1_OBJECT(bp, obj);\n                j = X509_EXTENSION_get_critical(ex);\n                if (BIO_printf(bp, ": %s\\n", j ? "critical" : "") <= 0)\n                    goto err;\n                if (!X509V3_EXT_print(bp, ex, cflag, 16)) {\n                    BIO_printf(bp, "%16s", "");\n                    ASN1_STRING_print(bp, X509_EXTENSION_get_data(ex));\n                }\n                if (BIO_write(bp, "\\n", 1) <= 0)\n                    goto err;\n            }\n            sk_X509_EXTENSION_pop_free(exts, X509_EXTENSION_free);\n        }\n    }\n    if (!(cflag & X509_FLAG_NO_SIGDUMP)) {\n        if (!X509_signature_print(bp, x->sig_alg, x->signature))\n            goto err;\n    }\n    return (1);\n err:\n    X509err(X509_F_X509_REQ_PRINT_EX, ERR_R_BUF_LIB);\n    return (0);\n}', 'long ASN1_INTEGER_get(const ASN1_INTEGER *a)\n{\n    int i;\n    int64_t r;\n    if (a == NULL)\n        return 0;\n    i = ASN1_INTEGER_get_int64(&r, a);\n    if (i == 0)\n        return -1;\n    if (r > LONG_MAX || r < LONG_MIN)\n        return -1;\n    return (long)r;\n}']