From 9c4c56adb9490398886a5e5a483d5d3b612b81d6 Mon Sep 17 00:00:00 2001 From: Michael Sprecher Date: Fri, 17 May 2019 11:34:59 +0200 Subject: [PATCH] PKZIP: return PARSER_SIGNATURE_UNMATCHED on signature mismatch --- 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 fff5e9c82..7c1b9c7e9 100644 --- a/src/modules/module_17200.c +++ b/src/modules/module_17200.c @@ -191,7 +191,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE char *p = strtok(input, "*"); if (p == NULL) return PARSER_HASH_LENGTH; - if (strncmp(p, SIGNATURE_PKZIP_V1, 7) != 0 && strncmp(p, SIGNATURE_PKZIP_V2, 8) != 0) return PARSER_HASH_LENGTH; + if (strncmp(p, SIGNATURE_PKZIP_V1, 7) != 0 && strncmp(p, SIGNATURE_PKZIP_V2, 8) != 0) return PARSER_SIGNATURE_UNMATCHED; pkzip->version = 1; if(strlen(p) == 9) pkzip->version = 2; diff --git a/src/modules/module_17210.c b/src/modules/module_17210.c index 3ef59834e..1547018c8 100644 --- a/src/modules/module_17210.c +++ b/src/modules/module_17210.c @@ -191,7 +191,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE char *p = strtok(input, "*"); if (p == NULL) return PARSER_HASH_LENGTH; - if (strncmp(p, SIGNATURE_PKZIP_V1, 7) != 0 && strncmp(p, SIGNATURE_PKZIP_V2, 8) != 0) return PARSER_HASH_LENGTH; + if (strncmp(p, SIGNATURE_PKZIP_V1, 7) != 0 && strncmp(p, SIGNATURE_PKZIP_V2, 8) != 0) return PARSER_SIGNATURE_UNMATCHED; pkzip->version = 1; if(strlen(p) == 9) pkzip->version = 2; diff --git a/src/modules/module_17220.c b/src/modules/module_17220.c index 989c509ee..c636c24fe 100644 --- a/src/modules/module_17220.c +++ b/src/modules/module_17220.c @@ -191,7 +191,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE char *p = strtok(input, "*"); if (p == NULL) return PARSER_HASH_LENGTH; - if (strncmp(p, SIGNATURE_PKZIP_V1, 7) != 0 && strncmp(p, SIGNATURE_PKZIP_V2, 8) != 0) return PARSER_HASH_LENGTH; + if (strncmp(p, SIGNATURE_PKZIP_V1, 7) != 0 && strncmp(p, SIGNATURE_PKZIP_V2, 8) != 0) return PARSER_SIGNATURE_UNMATCHED; pkzip->version = 1; if(strlen(p) == 9) pkzip->version = 2; diff --git a/src/modules/module_17230.c b/src/modules/module_17230.c index ed01166e5..efe780038 100644 --- a/src/modules/module_17230.c +++ b/src/modules/module_17230.c @@ -191,7 +191,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE char *p = strtok(input, "*"); if (p == NULL) return PARSER_HASH_LENGTH; - if (strncmp(p, SIGNATURE_PKZIP_V1, 7) != 0 && strncmp(p, SIGNATURE_PKZIP_V2, 8) != 0) return PARSER_HASH_LENGTH; + if (strncmp(p, SIGNATURE_PKZIP_V1, 7) != 0 && strncmp(p, SIGNATURE_PKZIP_V2, 8) != 0) return PARSER_SIGNATURE_UNMATCHED; pkzip->version = 1; if(strlen(p) == 9) pkzip->version = 2;