emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] gnutls: Add SNI support


From: Florian Weimer
Subject: Re: [PATCH] gnutls: Add SNI support
Date: Mon, 24 Nov 2014 21:56:25 +0100

* Thien-Thi Nguyen:

>    +  /* Quick and dirty test of the hostname; shouldn't be an IP. If it
>    +     contains letters, we assume it's a hostname, unless it contains a
>    +     : in which case we assume it's a literal IPv6 address. */
>    +  for(c = c_hostname; c; c++) {
>    +    if(c >= 'a') send_hostname = 1;
>    +    if(c == ':') {send_hostname = 0; break;}
>    +  }
>
> Aside from the whitespace and brace placement, this code is buggy: ‘c’
> is of type ‘char *’ and cannot be meaningfully compared directly to 'a'.

And what about uppercase names?  Or domain names which do not contain
letters?

(I think to be absolutely correct, you need to track the kind of name
resolution you have performed on the name.)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]