summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/printing/printing.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index 6e9482ad4e..2f36cf2f3f 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -140,6 +140,11 @@ static int print_run_command(int snum,char *command,
if (!command || !*command) return -1;
+ if (!VALID_SNUM(snum)) {
+ DEBUG(0,("Invalid snum %d for command %s\n", snum, command));
+ return -1;
+ }
+
pstrcpy(syscmd, command);
if (a1) pstring_sub(syscmd, a1, v1);
if (a2) pstring_sub(syscmd, a2, v2);