From: Ondřej Kuzník Date: Tue, 16 Jul 2019 17:04:01 +0000 (+0200) Subject: ITS#9596 Let libldap keep explicit port 0 as that X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e3905c989821f6c09576988ead69a2bd55c95149;p=thirdparty%2Fopenldap.git ITS#9596 Let libldap keep explicit port 0 as that --- 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 {