From 231592101e445ab43d057230e88c097c02c26ff6 Mon Sep 17 00:00:00 2001 From: jsteube Date: Tue, 14 Feb 2017 17:54:36 +0100 Subject: [PATCH] Test commit to workaround coverity false-positive --- src/folder.c | 22 ++++++++++++++++++++++ src/rp_cpu.c | 3 ++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/folder.c b/src/folder.c index 85ddb1b0c..3985c8822 100644 --- a/src/folder.c +++ b/src/folder.c @@ -278,6 +278,8 @@ int folder_config_init (hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const char *ins { event_log_error (hashcat_ctx, "getcwd(): %s", strerror (errno)); + hcfree (cwd); + return -1; } @@ -295,6 +297,10 @@ int folder_config_init (hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const char *ins { event_log_error (hashcat_ctx, "get_exec_path() failed"); + hcfree (cwd); + + hcfree (exec_path); + return -1; } @@ -315,6 +321,12 @@ int folder_config_init (hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const char *ins { event_log_error (hashcat_ctx, "%s: %s", resolved_install_folder, strerror (errno)); + hcfree (cwd); + + hcfree (exec_path); + + hcfree (resolved_install_folder); + return -1; } */ @@ -323,6 +335,12 @@ int folder_config_init (hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const char *ins { event_log_error (hashcat_ctx, "%s: %s", resolved_exec_path, strerror (errno)); + hcfree (cwd); + + hcfree (exec_path); + + hcfree (resolved_install_folder); + return -1; } @@ -399,6 +417,8 @@ int folder_config_init (hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const char *ins { event_log_error (hashcat_ctx, "%s: %s", cpath, "GetFullPathName()"); + hcfree (cwd); + return -1; } @@ -412,6 +432,8 @@ int folder_config_init (hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const char *ins { event_log_error (hashcat_ctx, "%s: %s", cpath, strerror (errno)); + hcfree (cwd); + hcfree (shared_dir); hcfree (profile_dir); hcfree (cpath_real); diff --git a/src/rp_cpu.c b/src/rp_cpu.c index bd2eb3d07..ea7e69b91 100644 --- a/src/rp_cpu.c +++ b/src/rp_cpu.c @@ -78,7 +78,8 @@ static int mangle_reverse (char arr[BLOCK_SIZE], int arr_len) static int mangle_double (char arr[BLOCK_SIZE], int arr_len) { - if ((arr_len * 2) >= BLOCK_SIZE) return (arr_len); + //if ((arr_len * 2) >= BLOCK_SIZE) return (arr_len); + if (arr_len >= (BLOCK_SIZE / 2)) return (arr_len); memcpy (&arr[arr_len], arr, (size_t) arr_len);