r23633: Fix a couple of crash bugs pointed out by Volker caused by an old
authorGerald Carter <jerry@samba.org>
Wed, 27 Jun 2007 16:52:36 +0000 (16:52 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:23:39 +0000 (12:23 -0500)
change from a pstring to a char* and still trying use pstrcpy().

source/rpc_server/srv_winreg_nt.c

index f0bce7e931294136ee2bd3b1944303ce2b3ba5ab..1fa61c27ca19c01bc4a02c9588616c1defce8006 100644 (file)
@@ -661,7 +661,12 @@ static WERROR reg_load_tree( REGF_FILE *regfile, const char *topkeypath,
                        topkeypath ));
                return WERR_BADFILE;
        }
                        topkeypath ));
                return WERR_BADFILE;
        }
-       pstrcpy( registry_key.name, topkeypath );
+
+       registry_key.name = talloc_strdup( regfile->mem_ctx, topkeypath );
+       if ( !registry_key.name ) {
+               DEBUG(0,("reg_load_tree: Talloc failed for reg_key.name!\n"));
+               return WERR_NOMEM;
+       }
        
        /* now start parsing the values and subkeys */
 
        
        /* now start parsing the values and subkeys */