mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-06 12:41:30 +00:00
Minor patch (proper exit code-ing)
This commit is contained in:
@@ -238,6 +238,8 @@ def main():
|
||||
errMsg = getSafeExString(ex)
|
||||
logger.critical(errMsg)
|
||||
|
||||
os._exitcode = 1
|
||||
|
||||
raise SystemExit
|
||||
|
||||
except KeyboardInterrupt:
|
||||
@@ -249,8 +251,8 @@ def main():
|
||||
errMsg = "exit"
|
||||
logger.error(errMsg)
|
||||
|
||||
except SystemExit:
|
||||
pass
|
||||
except SystemExit as ex:
|
||||
os._exitcode = ex.code or 0
|
||||
|
||||
except:
|
||||
print()
|
||||
@@ -258,6 +260,8 @@ def main():
|
||||
excMsg = traceback.format_exc()
|
||||
valid = checkIntegrity()
|
||||
|
||||
os._exitcode = 255
|
||||
|
||||
if any(_ in excMsg for _ in ("MemoryError", "Cannot allocate memory")):
|
||||
errMsg = "memory exhaustion detected"
|
||||
logger.critical(errMsg)
|
||||
|
||||
Reference in New Issue
Block a user