[Date Prev][Date Next] [Chronological] [Thread] [Top]

Bug Fix HAVE_SLP NULL pointer check (ITS#2442)

Full_Name: Johnny Casey
Version: 2.1.17
OS: Linux (Debian unstable)
URL: ftp://ftp.openldap.org/incoming/johnnycase-030411.patch
Submission from: (NULL) (

The code enabled by HAVE_SLP doesn't test for a NULL pointer in the
"slapd_srvurls" global variable.  This causes a SEGFAULT on daemon close,
especially when "slapd -t" is run.  The "slapd_slp_deinit()" function checks
that the "slapd_srvurls" variable is NULL, however neither "slapd_slp_dereg()"
nor "slapd_slp_reg()" do.  Instead they immediately dereference the variable in
a loop test.

This may or not have shown up if a SLP service is actually running in which case
the variable is likely to be non-NULL.

The attached patch is fairly trivial, just adding NULL checks to the two above
mentioned functions.