From eb15a19532455e20921ffcfab101de7449aa2bf5 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 15 Dec 2014 09:11:40 +0100 Subject: [PATCH] Patch for an Issue #1032 --- lib/parse/cmdline.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/parse/cmdline.py b/lib/parse/cmdline.py index c916b3278..9e4996b86 100644 --- a/lib/parse/cmdline.py +++ b/lib/parse/cmdline.py @@ -24,6 +24,7 @@ from lib.core.data import logger from lib.core.defaults import defaults from lib.core.enums import AUTOCOMPLETE_TYPE from lib.core.exception import SqlmapShellQuitException +from lib.core.exception import SqlmapSyntaxException from lib.core.settings import BASIC_HELP_ITEMS from lib.core.settings import DUMMY_URL from lib.core.settings import IS_WIN @@ -839,8 +840,11 @@ def cmdLineParser(): loadHistory(AUTOCOMPLETE_TYPE.SQLMAP) break - for arg in shlex.split(command): - argv.append(getUnicode(arg, encoding=sys.stdin.encoding)) + try: + for arg in shlex.split(command): + argv.append(getUnicode(arg, encoding=sys.stdin.encoding)) + except ValueError, ex: + raise SqlmapSyntaxException, "something went wrong during command line parsing ('%s')" % ex # Hide non-basic options in basic help case for i in xrange(len(argv)):