[cups.bugs] [LOW] STR #3164: httpSetField needs to bracket IPv6 addresses for HTTP_FIELD_HOST

Martin von Gagern Martin.vGagern at gmx.net
Wed Apr 29 10:17:38 PDT 2009


Hi!

Thanks for the fix, BUT...

Michael Sweet wrote:
> [STR Closed w/Resolution]
> 
> Fixed in Subversion repository.
> 
> Link: http://www.cups.org/str.php?L3164
> Version: 1.3.10
> Fix Version: 1.4-current (r8574)

====

> +    if (strchr(value, ':'))
> +    {
> +     /*
> +      * Bracket IPv6 numeric addresses...

Shouldn't there be a check for at least two colons? After all, a single
colon would probably be a port number after all, and this whole
bracketing and rejection of unbracketed IPv6 addresses came to pass
because it isn't that simple to distinguish port numbers from IPv6
addresses. Or do you take the position that the server might get
confronted with host names containing colons, but the client library
never will?

I'd expect something along these lines instead:

char *ptr = strchr(value, ':');
if (ptr && strchr(ptr + 1, ':'))
{
...

Greetings,
 Martin von Gagern

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
URL: <https://lists.cups.org/pipermail/cups/attachments/20090429/453e560c/attachment.bin>


More information about the cups mailing list