summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/rpcclient/rpcclient.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c
index 37ce597d4e..7a9c464cf6 100644
--- a/source3/rpcclient/rpcclient.c
+++ b/source3/rpcclient/rpcclient.c
@@ -170,7 +170,10 @@ static char* next_command (char** cmdstr)
if (p)
*p = '\0';
pstrcpy(command, *cmdstr);
- *cmdstr = p + 1;
+ if (p)
+ *cmdstr = p + 1;
+ else
+ *cmdstr = NULL;
return command;
}