From cb56ca37ff7b3cb5d6b4a156f1c289b4834e72e8 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 13 May 2020 17:31:50 +0200 Subject: [PATCH] make cppchecker happier --- common/generator.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/generator.c b/common/generator.c index b405fec1a..513806fba 100644 --- a/common/generator.c +++ b/common/generator.c @@ -214,6 +214,7 @@ int mfc_algo_ving_all(uint8_t *uid, uint8_t *keys) { int mfc_algo_yale_one(uint8_t *uid, uint8_t sector, uint8_t keytype, uint64_t *key) { if (sector > 15) return PM3_EINVARG; if (key == NULL) return PM3_EINVARG; + if (keytype > 2) return PM3_EINVARG; *key = 0; return PM3_SUCCESS; } @@ -233,6 +234,7 @@ int mfc_algo_yale_all(uint8_t *uid, uint8_t *keys) { int mfc_algo_saflok_one(uint8_t *uid, uint8_t sector, uint8_t keytype, uint64_t *key) { if (sector > 15) return PM3_EINVARG; if (key == NULL) return PM3_EINVARG; + if (keytype > 2) return PM3_EINVARG; *key = 0; return PM3_SUCCESS; } @@ -253,6 +255,7 @@ int mfc_algo_saflok_all(uint8_t *uid, uint8_t *keys) { int mfc_algo_mizip_one(uint8_t *uid, uint8_t sector, uint8_t keytype, uint64_t *key) { if (sector > 4) return PM3_EINVARG; if (key == NULL) return PM3_EINVARG; + if (keytype > 2) return PM3_EINVARG; if (sector == 0) { // A