r14981: fixed a use of a wild ptr in regshell
authorAndrew Tridgell <tridge@samba.org>
Sat, 8 Apr 2006 02:58:36 +0000 (02:58 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:00:50 +0000 (14:00 -0500)
(This used to be commit 868deaf89f34124a2a7ba2798fad83ffdabe316d)

source4/lib/registry/tools/regshell.c

index 19f544bccf2388dab46ae464f4889a63b98c4b27..b71c15cb674f47c7b4d706f1e63b5c0d1968e541 100644 (file)
@@ -93,9 +93,9 @@ static struct registry_key *cmd_set(TALLOC_CTX *mem_ctx, struct registry_context
        if (argc < 4) {
                fprintf(stderr, "Usage: set value-name type value\n");
        } else {
-               struct registry_value *val;
-               if (reg_string_to_val(mem_ctx, argv[2], argv[3], &val->data_type, &val->data)) {
-                       WERROR error = reg_val_set(cur, argv[1], val->data_type, val->data);
+               struct registry_value val;
+               if (reg_string_to_val(mem_ctx, argv[2], argv[3], &val.data_type, &val.data)) {
+                       WERROR error = reg_val_set(cur, argv[1], val.data_type, val.data);
                        if (!W_ERROR_IS_OK(error)) {
                                fprintf(stderr, "Error setting value: %s\n", win_errstr(error));
                                return NULL;