crypto/x509/x509_vpm.c:101: error: INTEGER_OVERFLOW_L2
  ([0, +oo] - 1):unsigned64.
Showing all 3 steps of the trace


crypto/x509/x509_vpm.c:88:1: <LHS trace>
86.   #define string_stack_free(sk) sk_OPENSSL_STRING_pop_free(sk, str_free)
87.   
88. > static int int_x509_param_set_hosts(X509_VERIFY_PARAM_ID *id, int mode,
89.                                       const char *name, size_t namelen)
90.   {

crypto/x509/x509_vpm.c:88:1: Parameter `namelen`
86.   #define string_stack_free(sk) sk_OPENSSL_STRING_pop_free(sk, str_free)
87.   
88. > static int int_x509_param_set_hosts(X509_VERIFY_PARAM_ID *id, int mode,
89.                                       const char *name, size_t namelen)
90.   {

crypto/x509/x509_vpm.c:101:17: Binary operation: ([0, +oo] - 1):unsigned64
99.       else if (name && memchr(name, '\0', namelen > 1 ? namelen - 1 : namelen))
100.           return 0;
101.       if (name && name[namelen - 1] == '\0')
                       ^
102.           --namelen;
103.   

static int int_x509_param_set_hosts(X509_VERIFY_PARAM_ID *id, int mode,
                                    const char *name, size_t namelen)
{
    char *copy;
    if (namelen == 0)
        namelen = name ? strlen(name) : 0;
    else if (name && memchr(name, '\0', namelen > 1 ? namelen - 1 : namelen))
        return 0;
    if (name && name[namelen - 1] == '\0')
        --namelen;
    if (mode == SET_HOST && id->hosts) {
        string_stack_free(id->hosts);
        id->hosts = NULL;
    }
    if (name == NULL || namelen == 0)
        return 1;
    copy = BUF_strndup(name, namelen);
    if (copy == NULL)
        return 0;
    if (id->hosts == NULL &&
        (id->hosts = sk_OPENSSL_STRING_new_null()) == NULL) {
        OPENSSL_free(copy);
        return 0;
    }
    if (!sk_OPENSSL_STRING_push(id->hosts, copy)) {
        OPENSSL_free(copy);
        if (sk_OPENSSL_STRING_num(id->hosts) == 0) {
            sk_OPENSSL_STRING_free(id->hosts);
            id->hosts = NULL;
        }
        return 0;
    }
    return 1;
}
["static int int_x509_param_set_hosts(X509_VERIFY_PARAM_ID *id, int mode,\n                                    const char *name, size_t namelen)\n{\n    char *copy;\n    if (namelen == 0)\n        namelen = name ? strlen(name) : 0;\n    else if (name && memchr(name, '\\0', namelen > 1 ? namelen - 1 : namelen))\n        return 0;\n    if (name && name[namelen - 1] == '\\0')\n        --namelen;\n    if (mode == SET_HOST && id->hosts) {\n        string_stack_free(id->hosts);\n        id->hosts = NULL;\n    }\n    if (name == NULL || namelen == 0)\n        return 1;\n    copy = BUF_strndup(name, namelen);\n    if (copy == NULL)\n        return 0;\n    if (id->hosts == NULL &&\n        (id->hosts = sk_OPENSSL_STRING_new_null()) == NULL) {\n        OPENSSL_free(copy);\n        return 0;\n    }\n    if (!sk_OPENSSL_STRING_push(id->hosts, copy)) {\n        OPENSSL_free(copy);\n        if (sk_OPENSSL_STRING_num(id->hosts) == 0) {\n            sk_OPENSSL_STRING_free(id->hosts);\n            id->hosts = NULL;\n        }\n        return 0;\n    }\n    return 1;\n}"]