This fixes a crash bug in OpenLDAP libraries which do not check the
return value of gethostbyname_r().
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@suse.de>
bool he_found = false;
bool ok;
+ /*
+ * We need to make sure we have zeroed return pointer for consumers
+ * which don't check return values, e.g. OpenLDAP.
+ */
+ ZERO_STRUCTP(result);
+
ok = nwrap_files_cache_reload(nwrap_he_global.cache);
if (!ok) {
NWRAP_LOG(NWRAP_LOG_ERROR, "error loading hosts file");