From: Jeremy Allison Date: Thu, 7 Jun 2007 01:13:43 +0000 (+0000) Subject: r23372: Remove restriction on string length for rpcclient commands. X-Git-Tag: samba-misc-tags/initial-v3-0-unstable~253 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a2cf87f58a0a1dbc468a78347880a2f07443b1d8;p=thirdparty%2Fsamba.git r23372: Remove restriction on string length for rpcclient commands. Jeremy. --- diff --git a/source/rpcclient/rpcclient.c b/source/rpcclient/rpcclient.c index ede61203453..87dac8f0370 100644 --- a/source/rpcclient/rpcclient.c +++ b/source/rpcclient/rpcclient.c @@ -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); }