From e3905c989821f6c09576988ead69a2bd55c95149 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ond=C5=99ej=20Kuzn=C3=ADk?= Date: Tue, 16 Jul 2019 19:04:01 +0200 Subject: [PATCH] ITS#9596 Let libldap keep explicit port 0 as that --- libraries/libldap/url.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/libldap/url.c b/libraries/libldap/url.c index 72066a942f..d25e0a2854 100644 --- a/libraries/libldap/url.c +++ b/libraries/libldap/url.c @@ -940,6 +940,7 @@ ldap_url_parse_ext( LDAP_CONST char *url_in, LDAPURLDesc **ludpp, unsigned flags q = strchr( url, ':' ); } + i = !q; /* i is set iff we don't have a port specified */ if ( q != NULL ) { char *next; @@ -968,7 +969,7 @@ ldap_url_parse_ext( LDAP_CONST char *url_in, LDAPURLDesc **ludpp, unsigned flags } } - if ( ( flags & LDAP_PVT_URL_PARSE_DEF_PORT ) && ludp->lud_port == 0 ) { + if ( ( flags & LDAP_PVT_URL_PARSE_DEF_PORT ) && i ) { if ( strcmp( ludp->lud_scheme, "ldaps" ) == 0 ) { ludp->lud_port = LDAPS_PORT; } else { -- 2.47.3