X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fcups.git;a=blobdiff_plain;f=cups%2Fhttp.c;h=ddb2f3a83b3baf9eddae46c1ca1de14852e6d38a;hp=a717f80c0ad6e10a0248ec852d17ddfb681540d9;hb=178cb7369d104b95acb92929f36956a38765c84c;hpb=f11a948a02771f78f50b530880a0269d4b4f58eb;ds=sidebyside diff --git a/cups/http.c b/cups/http.c index a717f80c0..ddb2f3a83 100644 --- a/cups/http.c +++ b/cups/http.c @@ -1893,7 +1893,9 @@ httpSetField(http_t *http, /* I - Connection to server */ * need to bracket IPv6 numeric addresses. */ - if (strchr(value, ':')) + char *ptr = strchr(value, ':'); + + if (value[0] != '[' && ptr && strchr(ptr + 1, ':')) { /* * Bracket IPv6 numeric addresses... @@ -1911,8 +1913,7 @@ httpSetField(http_t *http, /* I - Connection to server */ * Check for a trailing dot on the hostname... */ - char *ptr = http->fields[HTTP_FIELD_HOST]; - /* Pointer into Host: field */ + ptr = http->fields[HTTP_FIELD_HOST]; if (*ptr) {