crypto/x509/t_crl.c:104: error: BUFFER_OVERRUN_L3
  Offset: [-529, +oo] Size: 12 by call to `ASN1_TIME_print`.
Showing all 17 steps of the trace


crypto/x509/t_crl.c:96:9: Call
94.   
95.       BIO_printf(out, "Certificate Revocation List (CRL):\n");
96.       l = X509_CRL_get_version(x);
              ^
97.       BIO_printf(out, "%8sVersion %lu (0x%lx)\n", "", l + 1, l);
98.       X509_CRL_get0_signature(&sig, &sig_alg, x);

crypto/x509/x509cset.c:141:1: Parameter `*crl->crl.version->data`
  139.   }
  140.   
  141. > long X509_CRL_get_version(X509_CRL *crl)
  142.   {
  143.       return ASN1_INTEGER_get(crl->crl.version);

crypto/x509/x509cset.c:143:12: Call
  141.   long X509_CRL_get_version(X509_CRL *crl)
  142.   {
  143.       return ASN1_INTEGER_get(crl->crl.version);
                    ^
  144.   }
  145.   

crypto/asn1/a_int.c:608:1: Parameter `*a->data`
    606.   }
    607.   
    608. > long ASN1_INTEGER_get(const ASN1_INTEGER *a)
    609.   {
    610.       int i;

crypto/x509/t_crl.c:99:5: Call
97.       BIO_printf(out, "%8sVersion %lu (0x%lx)\n", "", l + 1, l);
98.       X509_CRL_get0_signature(&sig, &sig_alg, x);
99.       X509_signature_print(out, sig_alg, NULL);
           ^
100.       p = X509_NAME_oneline(X509_CRL_get_issuer(x), NULL, 0);
101.       BIO_printf(out, "%8sIssuer: %s\n", "", p);

crypto/x509/t_x509.c:326:1: Parameter `*sig->data`
  324.   }
  325.   
  326. > int X509_signature_print(BIO *bp, X509_ALGOR *sigalg, ASN1_STRING *sig)
  327.   {
  328.       int sig_nid;

crypto/x509/t_crl.c:100:9: Call
98.       X509_CRL_get0_signature(&sig, &sig_alg, x);
99.       X509_signature_print(out, sig_alg, NULL);
100.       p = X509_NAME_oneline(X509_CRL_get_issuer(x), NULL, 0);
               ^
101.       BIO_printf(out, "%8sIssuer: %s\n", "", p);
102.       OPENSSL_free(p);

crypto/x509/x509_obj.c:67:1: Parameter `*buf`
  65.   #include "internal/x509_int.h"
  66.   
  67. > char *X509_NAME_oneline(X509_NAME *a, char *buf, int len)
  68.   {
  69.       X509_NAME_ENTRY *ne;

crypto/x509/t_crl.c:104:5: Call
102.       OPENSSL_free(p);
103.       BIO_printf(out, "%8sLast Update: ", "");
104.       ASN1_TIME_print(out, X509_CRL_get_lastUpdate(x));
           ^
105.       BIO_printf(out, "\n%8sNext Update: ", "");
106.       if (X509_CRL_get_nextUpdate(x))

crypto/asn1/a_time.c:202:1: Parameter `*tm->data`
  200.   }
  201.   
  202. > int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm)
  203.   {
  204.       if (tm->type == V_ASN1_UTCTIME)

crypto/asn1/a_time.c:207:16: Call
  205.           return ASN1_UTCTIME_print(bp, tm);
  206.       if (tm->type == V_ASN1_GENERALIZEDTIME)
  207.           return ASN1_GENERALIZEDTIME_print(bp, tm);
                        ^
  208.       BIO_write(bp, "Bad time value", 14);
  209.       return (0);

crypto/asn1/a_gentm.c:266:1: <Offset trace>
264.   };
265.   
266. > int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm)
267.   {
268.       char *v;

crypto/asn1/a_gentm.c:266:1: Parameter `*tm->data`
    264.   };
    265.   
    266. > int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm)
    267.   {
    268.       char *v;

crypto/asn1/a_gentm.c:287:5: Assignment
    285.       y = (v[0] - '0') * 1000 + (v[1] - '0') * 100
    286.           + (v[2] - '0') * 10 + (v[3] - '0');
    287.       M = (v[4] - '0') * 10 + (v[5] - '0');
               ^
    288.       if ((M > 12) || (M < 1))
    289.           goto err;

crypto/asn1/a_gentm.c:261:1: <Length trace>
259.   }
260.   
261. > const char *_asn1_mon[12] = {
262.       "Jan", "Feb", "Mar", "Apr", "May", "Jun",
263.       "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"

crypto/asn1/a_gentm.c:261:1: Array declaration
    259.   }
    260.   
    261. > const char *_asn1_mon[12] = {
    262.       "Jan", "Feb", "Mar", "Apr", "May", "Jun",
    263.       "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"

crypto/asn1/a_gentm.c:308:20: Array access: Offset: [-529, +oo] Size: 12 by call to `ASN1_TIME_print` 
    306.   
    307.       if (BIO_printf(bp, "%s %2d %02d:%02d:%02d%.*s %d%s",
    308.                      _asn1_mon[M - 1], d, h, m, s, f_len, f, y,
                              ^
    309.                      (gmt) ? " GMT" : "") <= 0)
    310.           return (0);

int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm)
{
    char *v;
    int gmt = 0;
    int i;
    int y = 0, M = 0, d = 0, h = 0, m = 0, s = 0;
    char *f = NULL;
    int f_len = 0;
    i = tm->length;
    v = (char *)tm->data;
    if (i < 12)
        goto err;
    if (v[i - 1] == 'Z')
        gmt = 1;
    for (i = 0; i < 12; i++)
        if ((v[i] > '9') || (v[i] < '0'))
            goto err;
    y = (v[0] - '0') * 1000 + (v[1] - '0') * 100
        + (v[2] - '0') * 10 + (v[3] - '0');
    M = (v[4] - '0') * 10 + (v[5] - '0');
    if ((M > 12) || (M < 1))
        goto err;
    d = (v[6] - '0') * 10 + (v[7] - '0');
    h = (v[8] - '0') * 10 + (v[9] - '0');
    m = (v[10] - '0') * 10 + (v[11] - '0');
    if (tm->length >= 14 &&
        (v[12] >= '0') && (v[12] <= '9') &&
        (v[13] >= '0') && (v[13] <= '9')) {
        s = (v[12] - '0') * 10 + (v[13] - '0');
        if (tm->length >= 15 && v[14] == '.') {
            int l = tm->length;
            f = &v[14];
            f_len = 1;
            while (14 + f_len < l && f[f_len] >= '0' && f[f_len] <= '9')
                ++f_len;
        }
    }
    if (BIO_printf(bp, "%s %2d %02d:%02d:%02d%.*s %d%s",
                   _asn1_mon[M - 1], d, h, m, s, f_len, f, y,
                   (gmt) ? " GMT" : "") <= 0)
        return (0);
    else
        return (1);
 err:
    BIO_write(bp, "Bad time value", 14);
    return (0);
}
['int X509_CRL_print(BIO *out, X509_CRL *x)\n{\n    STACK_OF(X509_REVOKED) *rev;\n    X509_REVOKED *r;\n    X509_ALGOR *sig_alg;\n    ASN1_BIT_STRING *sig;\n    long l;\n    int i;\n    char *p;\n    BIO_printf(out, "Certificate Revocation List (CRL):\\n");\n    l = X509_CRL_get_version(x);\n    BIO_printf(out, "%8sVersion %lu (0x%lx)\\n", "", l + 1, l);\n    X509_CRL_get0_signature(&sig, &sig_alg, x);\n    X509_signature_print(out, sig_alg, NULL);\n    p = X509_NAME_oneline(X509_CRL_get_issuer(x), NULL, 0);\n    BIO_printf(out, "%8sIssuer: %s\\n", "", p);\n    OPENSSL_free(p);\n    BIO_printf(out, "%8sLast Update: ", "");\n    ASN1_TIME_print(out, X509_CRL_get_lastUpdate(x));\n    BIO_printf(out, "\\n%8sNext Update: ", "");\n    if (X509_CRL_get_nextUpdate(x))\n        ASN1_TIME_print(out, X509_CRL_get_nextUpdate(x));\n    else\n        BIO_printf(out, "NONE");\n    BIO_printf(out, "\\n");\n    X509V3_extensions_print(out, "CRL extensions",\n                            X509_CRL_get0_extensions(x), 0, 8);\n    rev = X509_CRL_get_REVOKED(x);\n    if (sk_X509_REVOKED_num(rev) > 0)\n        BIO_printf(out, "Revoked Certificates:\\n");\n    else\n        BIO_printf(out, "No Revoked Certificates.\\n");\n    for (i = 0; i < sk_X509_REVOKED_num(rev); i++) {\n        r = sk_X509_REVOKED_value(rev, i);\n        BIO_printf(out, "    Serial Number: ");\n        i2a_ASN1_INTEGER(out, X509_REVOKED_get0_serialNumber(r));\n        BIO_printf(out, "\\n        Revocation Date: ");\n        ASN1_TIME_print(out, X509_REVOKED_get0_revocationDate(r));\n        BIO_printf(out, "\\n");\n        X509V3_extensions_print(out, "CRL entry extensions",\n                                X509_REVOKED_get0_extensions(r), 0, 8);\n    }\n    X509_signature_print(out, sig_alg, sig);\n    return 1;\n}', 'long X509_CRL_get_version(X509_CRL *crl)\n{\n    return ASN1_INTEGER_get(crl->crl.version);\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}', 'int X509_signature_print(BIO *bp, X509_ALGOR *sigalg, ASN1_STRING *sig)\n{\n    int sig_nid;\n    if (BIO_puts(bp, "    Signature Algorithm: ") <= 0)\n        return 0;\n    if (i2a_ASN1_OBJECT(bp, sigalg->algorithm) <= 0)\n        return 0;\n    sig_nid = OBJ_obj2nid(sigalg->algorithm);\n    if (sig_nid != NID_undef) {\n        int pkey_nid, dig_nid;\n        const EVP_PKEY_ASN1_METHOD *ameth;\n        if (OBJ_find_sigid_algs(sig_nid, &dig_nid, &pkey_nid)) {\n            ameth = EVP_PKEY_asn1_find(NULL, pkey_nid);\n            if (ameth && ameth->sig_print)\n                return ameth->sig_print(bp, sigalg, sig, 9, 0);\n        }\n    }\n    if (sig)\n        return X509_signature_dump(bp, sig, 9);\n    else if (BIO_puts(bp, "\\n") <= 0)\n        return 0;\n    return 1;\n}', 'char *X509_NAME_oneline(X509_NAME *a, char *buf, int len)\n{\n    X509_NAME_ENTRY *ne;\n    int i;\n    int n, lold, l, l1, l2, num, j, type;\n    const char *s;\n    char *p;\n    unsigned char *q;\n    BUF_MEM *b = NULL;\n    static const char hex[17] = "0123456789ABCDEF";\n    int gs_doit[4];\n    char tmp_buf[80];\n#ifdef CHARSET_EBCDIC\n    char ebcdic_buf[1024];\n#endif\n    if (buf == NULL) {\n        if ((b = BUF_MEM_new()) == NULL)\n            goto err;\n        if (!BUF_MEM_grow(b, 200))\n            goto err;\n        b->data[0] = \'\\0\';\n        len = 200;\n    }\n    if (a == NULL) {\n        if (b) {\n            buf = b->data;\n            OPENSSL_free(b);\n        }\n        strncpy(buf, "NO X509_NAME", len);\n        buf[len - 1] = \'\\0\';\n        return buf;\n    }\n    len--;\n    l = 0;\n    for (i = 0; i < sk_X509_NAME_ENTRY_num(a->entries); i++) {\n        ne = sk_X509_NAME_ENTRY_value(a->entries, i);\n        n = OBJ_obj2nid(ne->object);\n        if ((n == NID_undef) || ((s = OBJ_nid2sn(n)) == NULL)) {\n            i2t_ASN1_OBJECT(tmp_buf, sizeof(tmp_buf), ne->object);\n            s = tmp_buf;\n        }\n        l1 = strlen(s);\n        type = ne->value->type;\n        num = ne->value->length;\n        q = ne->value->data;\n#ifdef CHARSET_EBCDIC\n        if (type == V_ASN1_GENERALSTRING ||\n            type == V_ASN1_VISIBLESTRING ||\n            type == V_ASN1_PRINTABLESTRING ||\n            type == V_ASN1_TELETEXSTRING ||\n            type == V_ASN1_VISIBLESTRING || type == V_ASN1_IA5STRING) {\n            ascii2ebcdic(ebcdic_buf, q, (num > sizeof ebcdic_buf)\n                         ? sizeof ebcdic_buf : num);\n            q = ebcdic_buf;\n        }\n#endif\n        if ((type == V_ASN1_GENERALSTRING) && ((num % 4) == 0)) {\n            gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 0;\n            for (j = 0; j < num; j++)\n                if (q[j] != 0)\n                    gs_doit[j & 3] = 1;\n            if (gs_doit[0] | gs_doit[1] | gs_doit[2])\n                gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 1;\n            else {\n                gs_doit[0] = gs_doit[1] = gs_doit[2] = 0;\n                gs_doit[3] = 1;\n            }\n        } else\n            gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 1;\n        for (l2 = j = 0; j < num; j++) {\n            if (!gs_doit[j & 3])\n                continue;\n            l2++;\n#ifndef CHARSET_EBCDIC\n            if ((q[j] < \' \') || (q[j] > \'~\'))\n                l2 += 3;\n#else\n            if ((os_toascii[q[j]] < os_toascii[\' \']) ||\n                (os_toascii[q[j]] > os_toascii[\'~\']))\n                l2 += 3;\n#endif\n        }\n        lold = l;\n        l += 1 + l1 + 1 + l2;\n        if (b != NULL) {\n            if (!BUF_MEM_grow(b, l + 1))\n                goto err;\n            p = &(b->data[lold]);\n        } else if (l > len) {\n            break;\n        } else\n            p = &(buf[lold]);\n        *(p++) = \'/\';\n        memcpy(p, s, (unsigned int)l1);\n        p += l1;\n        *(p++) = \'=\';\n#ifndef CHARSET_EBCDIC\n        q = ne->value->data;\n#endif\n        for (j = 0; j < num; j++) {\n            if (!gs_doit[j & 3])\n                continue;\n#ifndef CHARSET_EBCDIC\n            n = q[j];\n            if ((n < \' \') || (n > \'~\')) {\n                *(p++) = \'\\\\\';\n                *(p++) = \'x\';\n                *(p++) = hex[(n >> 4) & 0x0f];\n                *(p++) = hex[n & 0x0f];\n            } else\n                *(p++) = n;\n#else\n            n = os_toascii[q[j]];\n            if ((n < os_toascii[\' \']) || (n > os_toascii[\'~\'])) {\n                *(p++) = \'\\\\\';\n                *(p++) = \'x\';\n                *(p++) = hex[(n >> 4) & 0x0f];\n                *(p++) = hex[n & 0x0f];\n            } else\n                *(p++) = q[j];\n#endif\n        }\n        *p = \'\\0\';\n    }\n    if (b != NULL) {\n        p = b->data;\n        OPENSSL_free(b);\n    } else\n        p = buf;\n    if (i == 0)\n        *p = \'\\0\';\n    return (p);\n err:\n    X509err(X509_F_X509_NAME_ONELINE, ERR_R_MALLOC_FAILURE);\n    BUF_MEM_free(b);\n    return (NULL);\n}', 'int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm)\n{\n    if (tm->type == V_ASN1_UTCTIME)\n        return ASN1_UTCTIME_print(bp, tm);\n    if (tm->type == V_ASN1_GENERALIZEDTIME)\n        return ASN1_GENERALIZEDTIME_print(bp, tm);\n    BIO_write(bp, "Bad time value", 14);\n    return (0);\n}', 'int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm)\n{\n    char *v;\n    int gmt = 0;\n    int i;\n    int y = 0, M = 0, d = 0, h = 0, m = 0, s = 0;\n    char *f = NULL;\n    int f_len = 0;\n    i = tm->length;\n    v = (char *)tm->data;\n    if (i < 12)\n        goto err;\n    if (v[i - 1] == \'Z\')\n        gmt = 1;\n    for (i = 0; i < 12; i++)\n        if ((v[i] > \'9\') || (v[i] < \'0\'))\n            goto err;\n    y = (v[0] - \'0\') * 1000 + (v[1] - \'0\') * 100\n        + (v[2] - \'0\') * 10 + (v[3] - \'0\');\n    M = (v[4] - \'0\') * 10 + (v[5] - \'0\');\n    if ((M > 12) || (M < 1))\n        goto err;\n    d = (v[6] - \'0\') * 10 + (v[7] - \'0\');\n    h = (v[8] - \'0\') * 10 + (v[9] - \'0\');\n    m = (v[10] - \'0\') * 10 + (v[11] - \'0\');\n    if (tm->length >= 14 &&\n        (v[12] >= \'0\') && (v[12] <= \'9\') &&\n        (v[13] >= \'0\') && (v[13] <= \'9\')) {\n        s = (v[12] - \'0\') * 10 + (v[13] - \'0\');\n        if (tm->length >= 15 && v[14] == \'.\') {\n            int l = tm->length;\n            f = &v[14];\n            f_len = 1;\n            while (14 + f_len < l && f[f_len] >= \'0\' && f[f_len] <= \'9\')\n                ++f_len;\n        }\n    }\n    if (BIO_printf(bp, "%s %2d %02d:%02d:%02d%.*s %d%s",\n                   _asn1_mon[M - 1], d, h, m, s, f_len, f, y,\n                   (gmt) ? " GMT" : "") <= 0)\n        return (0);\n    else\n        return (1);\n err:\n    BIO_write(bp, "Bad time value", 14);\n    return (0);\n}']