File 0010-initialize-context-in-_nss_ldap_getbyname.patch of Package nss_ldap.13245

From e71be5f00337ae890fa219e0cb4459aa435a6437 Mon Sep 17 00:00:00 2001
From: Luke Howard <lukeh@padl.com>
Date: Fri, 19 Mar 2010 16:42:20 +0000
Subject: [PATCH] initialize context in _nss_ldap_getbyname()

The patch was slightly adjusted by Howard Guo <hguo@suse.com> to fit into this older release of nss_ldap.

diff -rupN nss_ldap-265/ldap-nss.c nss_ldap-265-patched/ldap-nss.c
--- nss_ldap-265/ldap-nss.c	2016-03-23 15:12:53.348695960 +0100
+++ nss_ldap-265-patched/ldap-nss.c	2016-03-23 16:24:31.440525358 +0100
@@ -3563,9 +3563,8 @@ _nss_ldap_getbyname (ldap_args_t * args,
 
   debug ("==> _nss_ldap_getbyname");
 
+  memset (&ctx, 0, sizeof(ctx));
   ctx.ec_msgid = -1;
-  ctx.ec_cookie = NULL;
-  ctx.ec_eof = 0;
 
   stat = _nss_ldap_search_s (args, filterprot, sel, NULL, 1, &ctx.ec_res);
   if (stat != NSS_SUCCESS)
openSUSE Build Service is sponsored by