Skip to content

Commit fe54a7e

Browse files
author
Paul J. Reder
committed
Commit promoted backport of PR 45994.
*) mod_ldap: Avoid a segfault when result->rc is checked in uldap_connection_init when result is NULL. This could happen if LDAP initialization failed. PR 45994. [Dan Poirier <poirier pobox.com>] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@727773 13f79535-47bb-0310-9956-ffa450edef68
1 parent 4a6313a commit fe54a7e

3 files changed

Lines changed: 14 additions & 10 deletions

File tree

CHANGES

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
-*- coding: utf-8 -*-
22
Changes with Apache 2.2.12
33

4+
*) mod_ldap: Avoid a segfault when result->rc is checked in uldap_connection_init
5+
when result is NULL. This could happen if LDAP initialization failed.
6+
PR 45994. [Dan Poirier <poirier pobox.com>]
7+
48
*) Set Listen protocol to "https" if port is set to 443 and no proto is specified
59
(as documented but not implemented). PR 46066 [Dan Poirier <poirier pobox.com>]
610

STATUS

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,6 @@ RELEASE SHOWSTOPPERS:
8686
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
8787
[ start all new proposals below, under PATCHES PROPOSED. ]
8888

89-
* mod_ldap: Avoid a segfault when result->rc is checked in uldap_connection_init
90-
when result is NULL. This could happen if LDAP initialization failed.
91-
PR 45994. [Dan Poirier <poirier pobox.com>]
92-
Trunk version of patch:
93-
http://svn.apache.org/viewvc?view=rev&revision=727053
94-
Backport version for 2.2.x of patch:
95-
http://people.apache.org/~rederpj/backport_PR45994_util_ldap.c.diff
96-
+1: rederpj, rpluem, covener
97-
9889
PATCHES PROPOSED TO BACKPORT FROM TRUNK:
9990
[ New proposals should be added at the end of the list ]
10091

modules/ldap/util_ldap.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,16 @@ static int uldap_connection_init(request_rec *r,
232232
&(result));
233233

234234

235-
if (result != NULL && result->rc) {
235+
if (NULL == result) {
236+
/* something really bad happened */
237+
ldc->bound = 0;
238+
if (NULL == ldc->reason) {
239+
ldc->reason = "LDAP: ldap initialization failed";
240+
}
241+
return(APR_EGENERAL);
242+
}
243+
244+
if (result->rc) {
236245
ldc->reason = result->reason;
237246
}
238247

0 commit comments

Comments
 (0)