summaryrefslogtreecommitdiffstats
path: root/dirmngr/misc.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2018-11-05 08:59:13 +0100
committerWerner Koch <wk@gnupg.org>2018-11-05 09:00:02 +0100
commita3a5a2451924640588e5ecc03a1d4ba6a6ba94a5 (patch)
tree8fa500f18ae541ec10b58d5decc248a2e2dbd8de /dirmngr/misc.c
parentbuild: Update *.m4 from libraries. (diff)
downloadgnupg2-a3a5a2451924640588e5ecc03a1d4ba6a6ba94a5.tar.xz
gnupg2-a3a5a2451924640588e5ecc03a1d4ba6a6ba94a5.zip
dirmngr: Fix LDAP port parsing.
* dirmngr/misc.c (host_and_port_from_url): Fix bad port parsing and a segv for a missing slash after the host name. -- Reportted-by: Tomas Mraz GnuPG-bug-id: 4230 Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'dirmngr/misc.c')
-rw-r--r--dirmngr/misc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/dirmngr/misc.c b/dirmngr/misc.c
index 9ad60d59f..9cedf911c 100644
--- a/dirmngr/misc.c
+++ b/dirmngr/misc.c
@@ -515,7 +515,7 @@ host_and_port_from_url (const char *url, int *port)
if ((p = strchr (buf, '/')))
*p++ = 0;
strlwr (buf);
- if ((p = strchr (p, ':')))
+ if ((p = strchr (buf, ':')))
{
*p++ = 0;
*port = atoi (p);