]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
r23372: Remove restriction on string length for rpcclient commands.
authorJeremy Allison <jra@samba.org>
Thu, 7 Jun 2007 01:13:43 +0000 (01:13 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:23:11 +0000 (12:23 -0500)
Jeremy.

source/rpcclient/rpcclient.c

index ede61203453a2889acc3cf17ae21a13eb8c4e3fd..87dac8f037047967097e388194179b3ec050f82f 100644 (file)
@@ -108,9 +108,9 @@ static char **completion_fn(const char *text, int start, int end)
        return matches;
 }
 
-static char* next_command (char** cmdstr)
+static char *next_command (char **cmdstr)
 {
-       static pstring          command;
+       char *command;
        char                    *p;
        
        if (!cmdstr || !(*cmdstr))
@@ -119,7 +119,7 @@ static char* next_command (char** cmdstr)
        p = strchr_m(*cmdstr, ';');
        if (p)
                *p = '\0';
-       pstrcpy(command, *cmdstr);
+       command = SMB_STRDUP(*cmdstr);
        if (p)
                *cmdstr = p + 1;
        else
@@ -868,6 +868,7 @@ out_free:
  
                 while((cmd=next_command(&p)) != NULL) {
                         NTSTATUS cmd_result = process_cmd(cli, cmd);
+                       SAFE_FREE(cmd);
                        result = NT_STATUS_IS_ERR(cmd_result);
                 }