From e602a3cdd4245157a7c0af0a13b73ce5db803faa Mon Sep 17 00:00:00 2001 From: oetiker Date: Mon, 23 Aug 2010 05:28:23 +0000 Subject: [PATCH 1/1] in remote mode, make argument count for remote commmands strict as suggested by Dave Peticolas git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.3@2119 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/src/rrd_tool.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/program/src/rrd_tool.c b/program/src/rrd_tool.c index f6e302f9..45490738 100644 --- a/program/src/rrd_tool.c +++ b/program/src/rrd_tool.c @@ -520,7 +520,7 @@ int HandleInputLine( */ if (RemoteMode) { if (argc > 1 && strcmp("quit", argv[1]) == 0) { - if (argc > 2) { + if (argc != 2) { printf("ERROR: invalid parameter count for quit\n"); return (1); } @@ -528,7 +528,7 @@ int HandleInputLine( } #if defined(HAVE_OPENDIR) && defined(HAVE_READDIR) && defined(HAVE_CHDIR) if (argc > 1 && strcmp("cd", argv[1]) == 0) { - if (argc > 3) { + if (argc != 3) { printf("ERROR: invalid parameter count for cd\n"); return (1); } @@ -547,7 +547,7 @@ int HandleInputLine( return (0); } if (argc > 1 && strcmp("pwd", argv[1]) == 0) { - if (argc > 2) { + if (argc != 2) { printf("ERROR: invalid parameter count for pwd\n"); return (1); } @@ -561,7 +561,7 @@ int HandleInputLine( return (0); } if (argc > 1 && strcmp("mkdir", argv[1]) == 0) { - if (argc > 3) { + if (argc != 3) { printf("ERROR: invalid parameter count for mkdir\n"); return (1); } @@ -580,7 +580,7 @@ int HandleInputLine( return (0); } if (argc > 1 && strcmp("ls", argv[1]) == 0) { - if (argc > 2) { + if (argc != 2) { printf("ERROR: invalid parameter count for ls\n"); return (1); } -- 2.30.2