[gnutls-devel] GnuTLS | Remove trailing dot from hostname input (!709)

Nikos Mavrogiannopoulos gitlab at mg.gitlab.com
Sun Jul 22 08:14:47 CEST 2018


Nikos Mavrogiannopoulos started a new discussion on src/cli.c:

>  		ssh = strictssh;
>  	}
>  
> -	if (HAVE_OPT(VERIFY_HOSTNAME))
> +	if (HAVE_OPT(VERIFY_HOSTNAME)) {
>  		host = OPT_ARG(VERIFY_HOSTNAME);
> -	else
> +		canonicalize_host((char *) host, NULL, 0);

Look good, but the upgrade to const and then cast to non-const, looks quite ugly. We can give up completely with the const for host, or maybe do a canonicalize on the OPT_ARG, and then assign it? e.g.,
```
canonicalize_host(OPT_ARG(VERIFY_HOSTNAME), NULL, 0);
host = OPT_ARG(VERIFY_HOSTNAME);
```
It's equivalent, but avoids casts to and from const.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/merge_requests/709#note_89501123
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20180722/78aab1b3/attachment.html>


More information about the Gnutls-devel mailing list