Fix bug #7617 - smbd coredump due to uninitialized variables in the performance count...
authorJeremy Allison <jra@samba.org>
Thu, 12 Aug 2010 21:24:01 +0000 (14:24 -0700)
committerJeremy Allison <jra@samba.org>
Thu, 12 Aug 2010 22:16:42 +0000 (15:16 -0700)
In the file rpc_server.c, function _winreg_QueryValue()

uint8_t *outbuf

Should be :

uint8_t *outbuf = NULL;

As it is later freed by

      if (free_buf) SAFE_FREE(outbuf);

in some cases, this frees the unintialized outbuf, which causes a coredump.

source3/rpc_server/srv_winreg_nt.c

index b4105a026b545aaa7c65b12d0619127dfe4cfeb0..568545fc0dba14b0eeb7adc536bc19205516eb40 100644 (file)
@@ -237,8 +237,8 @@ WERROR _winreg_QueryValue(struct pipes_struct *p,
        struct registry_key *regkey = find_regkey_by_hnd( p, r->in.handle );
        prs_struct    prs_hkpd;
 
-       uint8_t *outbuf;
-       uint32_t outbuf_size;
+       uint8_t *outbuf = NULL;
+       uint32_t outbuf_size = 0;
 
        bool free_buf = False;
        bool free_prs = False;