From 381ddb464fd0da671d567177f1ded10f67952692 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 23 Apr 2000 08:13:12 +0000 Subject: [PATCH] check for a valid snum when running a printing command --- source/printing/printing.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/printing/printing.c b/source/printing/printing.c index 6e9482ad4ec..2f36cf2f3f2 100644 --- a/source/printing/printing.c +++ b/source/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);