From 2da33ab0ba82ea5e2930179a9c17b350ccb2d092 Mon Sep 17 00:00:00 2001 From: Sein Coray Date: Thu, 21 Mar 2019 21:12:18 +0100 Subject: [PATCH] fixed issue with converting more than needed and using too much memory --- src/modules/module_17200.c | 2 +- src/modules/module_17210.c | 2 +- src/modules/module_17220.c | 2 +- src/modules/module_17230.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/module_17200.c b/src/modules/module_17200.c index 605f47f00..1be17645f 100644 --- a/src/modules/module_17200.c +++ b/src/modules/module_17200.c @@ -260,7 +260,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE p = strtok(NULL, "*"); if (p == NULL) return PARSER_HASH_LENGTH; - hex_to_binary(p, strlen(p) * 2, (char *) &(pkzip->hash.data)); + hex_to_binary(p, strlen(p), (char *) &(pkzip->hash.data)); // fake salt salt->salt_buf[0] = pkzip->hash.data[ 3] << 24 | pkzip->hash.data[ 2] << 16 | pkzip->hash.data[ 1] << 8 | pkzip->hash.data[ 0]; diff --git a/src/modules/module_17210.c b/src/modules/module_17210.c index ac7947e5d..d4ac412fb 100644 --- a/src/modules/module_17210.c +++ b/src/modules/module_17210.c @@ -259,7 +259,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE p = strtok(NULL, "*"); if (p == NULL) return PARSER_HASH_LENGTH; - hex_to_binary(p, strlen(p) * 2, (char *) &(pkzip->hash.data)); + hex_to_binary(p, strlen(p), (char *) &(pkzip->hash.data)); // fake salt salt->salt_buf[0] = pkzip->hash.data[ 3] << 24 | pkzip->hash.data[ 2] << 16 | pkzip->hash.data[ 1] << 8 | pkzip->hash.data[ 0]; diff --git a/src/modules/module_17220.c b/src/modules/module_17220.c index c896e783f..faec23a38 100644 --- a/src/modules/module_17220.c +++ b/src/modules/module_17220.c @@ -262,7 +262,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE p = strtok(NULL, "*"); if (p == NULL) return PARSER_HASH_LENGTH; - hex_to_binary(p, strlen(p) * 2, (char *) &(pkzip->hashes[i].data)); + hex_to_binary(p, strlen(p), (char *) &(pkzip->hashes[i].data)); // fake salt salt->salt_buf[0] ^= pkzip->hashes[i].data[ 3] << 24 | pkzip->hashes[i].data[ 2] << 16 | pkzip->hashes[i].data[ 1] << 8 | pkzip->hashes[i].data[ 0]; diff --git a/src/modules/module_17230.c b/src/modules/module_17230.c index afd855693..1e744863c 100644 --- a/src/modules/module_17230.c +++ b/src/modules/module_17230.c @@ -262,7 +262,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE p = strtok(NULL, "*"); if (p == NULL) return PARSER_HASH_LENGTH; - hex_to_binary(p, strlen(p) * 2, (char *) &(pkzip->hashes[i].data)); + hex_to_binary(p, strlen(p), (char *) &(pkzip->hashes[i].data)); // fake salt salt->salt_buf[0] ^= pkzip->hashes[i].data[ 3] << 24 | pkzip->hashes[i].data[ 2] << 16 | pkzip->hashes[i].data[ 1] << 8 | pkzip->hashes[i].data[ 0];