summaryrefslogtreecommitdiffstats
path: root/lib/libfetch/common.c
diff options
context:
space:
mode:
authorbdrewery <bdrewery@FreeBSD.org>2013-11-19 16:11:03 +0000
committerbdrewery <bdrewery@FreeBSD.org>2013-11-19 16:11:03 +0000
commit6f5000b05b4a5c0ba97b0b8b4e5a9eebcd15c4e0 (patch)
treedf5e88515e6feeb86e693db36d88994621d9c4aa /lib/libfetch/common.c
parent3520323f3025237a1d4fffc19188be4dff5c58f7 (diff)
downloadFreeBSD-src-6f5000b05b4a5c0ba97b0b8b4e5a9eebcd15c4e0.zip
FreeBSD-src-6f5000b05b4a5c0ba97b0b8b4e5a9eebcd15c4e0.tar.gz
Fix build with GCC
SSL_set_tlsext_host_name(3) internally does not modify the host buffer pased to it. So it is safe to DECONST the struct url* here. Reported by: gjb Approved by: bapt (implicit) MFC after: 1 week X-MFC-With: r258347
Diffstat (limited to 'lib/libfetch/common.c')
-rw-r--r--lib/libfetch/common.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libfetch/common.c b/lib/libfetch/common.c
index b15ab9a..49d268c 100644
--- a/lib/libfetch/common.c
+++ b/lib/libfetch/common.c
@@ -831,7 +831,8 @@ fetch_ssl(conn_t *conn, const struct url *URL, int verbose)
SSL_set_fd(conn->ssl, conn->sd);
#if OPENSSL_VERSION_NUMBER >= 0x0090806fL && !defined(OPENSSL_NO_TLSEXT)
- if (!SSL_set_tlsext_host_name(conn->ssl, URL->host)) {
+ if (!SSL_set_tlsext_host_name(conn->ssl,
+ __DECONST(struct url *, URL)->host)) {
fprintf(stderr,
"TLS server name indication extension failed for host %s\n",
URL->host);
OpenPOWER on IntegriCloud