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


crypto/x509/x509_vpm.c:80:1: <LHS trace>
78.   #define string_stack_free(sk) sk_OPENSSL_STRING_pop_free(sk, str_free)
79.   
80. > static int int_x509_param_set_hosts(X509_VERIFY_PARAM_ID *id, int mode,
81.   				    const char *name, size_t namelen)
82.   	{

crypto/x509/x509_vpm.c:80:1: Parameter `namelen`
78.   #define string_stack_free(sk) sk_OPENSSL_STRING_pop_free(sk, str_free)
79.   
80. > static int int_x509_param_set_hosts(X509_VERIFY_PARAM_ID *id, int mode,
81.   				    const char *name, size_t namelen)
82.   	{

crypto/x509/x509_vpm.c:93:14: Binary operation: ([0, +oo] - 1):unsigned64
91.   	else if (name && memchr(name, '\0', namelen > 1 ? namelen-1 : namelen))
92.   		 return 0;
93.   	if (name && name[namelen-1] == '\0')
                   ^
94.   		--namelen;
95.   

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\t\t\t\t    const char *name, size_t namelen)\n\t{\n\tchar *copy;\n\tif (namelen == 0)\n\t\tnamelen = name ? strlen(name) : 0;\n\telse if (name && memchr(name, '\\0', namelen > 1 ? namelen-1 : namelen))\n\t\t return 0;\n\tif (name && name[namelen-1] == '\\0')\n\t\t--namelen;\n\tif (mode == SET_HOST && id->hosts)\n\t\t{\n\t\tstring_stack_free(id->hosts);\n\t\tid->hosts = NULL;\n\t\t}\n\tif (name == NULL || namelen == 0)\n\t\treturn 1;\n\tcopy = BUF_strndup(name, namelen);\n\tif (copy == NULL)\n\t\treturn 0;\n\tif (id->hosts == NULL &&\n\t    (id->hosts = sk_OPENSSL_STRING_new_null()) == NULL)\n\t\t{\n\t\tOPENSSL_free(copy);\n\t\treturn 0;\n\t\t}\n\tif (!sk_OPENSSL_STRING_push(id->hosts, copy))\n\t\t{\n\t\tOPENSSL_free(copy);\n\t\tif (sk_OPENSSL_STRING_num(id->hosts) == 0)\n\t\t\t{\n\t\t\tsk_OPENSSL_STRING_free(id->hosts);\n\t\t\tid->hosts = NULL;\n\t\t\t}\n\t\treturn 0;\n\t\t}\n\treturn 1;\n\t}"]