The branch, master has been updated via cd1a113 nwrap: Zero the allocated libc memory. from 6d9789c nwrap: Fix function loading on Solaris.
http://gitweb.samba.org/?p=nss_wrapper.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit cd1a1130ae609fe3c9f449d56a2ce7f5fb94d39b Author: Andreas Schneider <a...@samba.org> Date: Thu Dec 19 11:18:40 2013 +0100 nwrap: Zero the allocated libc memory. If not then this leads to setfaults cause the libc handle is pointing to random memory. ----------------------------------------------------------------------- Summary of changes: src/nss_wrapper.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) Changeset truncated at 500 lines: diff --git a/src/nss_wrapper.c b/src/nss_wrapper.c index cd04a79..7ceff25 100644 --- a/src/nss_wrapper.c +++ b/src/nss_wrapper.c @@ -128,6 +128,8 @@ typedef nss_status_t NSS_STATUS; #define PRINTF_ATTRIBUTE(a,b) #endif /* __GNUC__ */ +#define ZERO_STRUCTP(x) do { if ((x) != NULL) memset((char *)(x), 0, sizeof(*(x))); } while(0) + enum nwrap_dbglvl_e { NWRAP_LOG_ERROR = 0, NWRAP_LOG_WARN, @@ -1141,12 +1143,14 @@ static void nwrap_libc_init(struct nwrap_main *r) printf("Failed to allocate memory for libc"); exit(-1); } + ZERO_STRUCTP(r->libc); r->libc->fns = malloc(sizeof(struct nwrap_libc_fns)); if (r->libc->fns == NULL) { printf("Failed to allocate memory for libc functions"); exit(-1); } + ZERO_STRUCTP(r->libc->fns); } static void nwrap_backend_init(struct nwrap_main *r) -- NSS Wrapper Repository