Fix winbindd coredump. Remember to set a ** pointer to null before
authorJeremy Allison <jra@samba.org>
Wed, 14 May 2003 20:48:45 +0000 (20:48 +0000)
committerJeremy Allison <jra@samba.org>
Wed, 14 May 2003 20:48:45 +0000 (20:48 +0000)
searching and not finding otherwise we return a valid looking pointer
that was whatever crap was on the stack.
Jeremy.

source/nsswitch/winbindd_cm.c
source/smbd/connection.c

index dbcfdcf88f9887c7261e714101c75be8f0bcb757..02fd15e06917afc5b7ca9d427d0a0dc5046c1536 100644 (file)
@@ -450,6 +450,8 @@ static NTSTATUS get_connection_from_cache(const char *domain, const char *pipe_n
        struct winbindd_cm_conn *conn, conn_temp;
        NTSTATUS result;
 
+       *conn_out = NULL;
+
        for (conn = cm_conns; conn; conn = conn->next) {
                if (strequal(conn->domain, domain) && 
                    strequal(conn->pipe_name, pipe_name)) {
index 5547309a818591d24401bd36889640b9ba8a199d..c2718d4d7035908234f5ecf446f4a3db601fe782 100644 (file)
@@ -38,6 +38,7 @@ TDB_CONTEXT *conn_tdb_ctx(void)
 static void make_conn_key(connection_struct *conn, const char *name, TDB_DATA *pkbuf, struct connections_key *pkey)
 {
        ZERO_STRUCTP(pkey);
+       ZERO_STRUCTP(pkbuf);
        pkey->pid = sys_getpid();
        pkey->cnum = conn?conn->cnum:-1;
        fstrcpy(pkey->name, name);