From b58f7a4675fb81bdef00d14b44a3dc77f308165a Mon Sep 17 00:00:00 2001 From: jsteube Date: Fri, 1 Jul 2016 13:04:50 +0200 Subject: [PATCH] Fixed a bug where hashcat crashes for accessing deallocated buffer if user spams "s" shortly before hashcat shuts down --- docs/changes.txt | 1 + src/hashcat.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index b45e460..d44d6e7 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -13,6 +13,7 @@ - Fixed a bug where hashcat is suppressing --machine-readable output in the final status update - Fixed a bug where hashcat did not check the return of realpath() and crashes uncontrolled if the path does not exist +- Fixed a bug where hashcat crashes for accessing deallocated buffer if user spams "s" shortly before hashcat shuts down * changes v2.01 -> v3.00: diff --git a/src/hashcat.c b/src/hashcat.c index 13ee720..958ceb7 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -925,6 +925,9 @@ void status_display () if (data.devices_status == STATUS_INIT) return; if (data.devices_status == STATUS_STARTING) return; + // in this case some required buffers are free'd, ascii_digest() would run into segfault + if (data.shutdown_inner == 1) return; + if (data.machine_readable == 1) { status_display_machine_readable (); @@ -1715,6 +1718,8 @@ static void status_benchmark () if (data.devices_status == STATUS_INIT) return; if (data.devices_status == STATUS_STARTING) return; + if (data.shutdown_inner == 1) return; + if (data.machine_readable == 1) { status_benchmark_automate (); -- 2.25.1