From 5eda1ea4001937fa7d777a956e549055787df355 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Sat, 4 Sep 2021 02:14:48 +0200 Subject: [PATCH] Fix cppcheck dereferencing null pointer fix --- client/src/mifare/lrpcrypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/mifare/lrpcrypto.c b/client/src/mifare/lrpcrypto.c index 5ee390ed5..bd0368b9d 100644 --- a/client/src/mifare/lrpcrypto.c +++ b/client/src/mifare/lrpcrypto.c @@ -144,7 +144,7 @@ void LRPIncCounter(uint8_t *ctr, size_t ctrlen) { void LRPEncode(LRPContext_t *ctx, uint8_t *data, size_t datalen, uint8_t *resp, size_t *resplen) { *resplen = 0; - if (data == NULL) { + if ((datalen > 0) && (data == NULL)) { return; } uint8_t xdata[1024] = {0};