From 25048ccf2ffcd5faee018e2157c91f11f8fe74b9 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Wed, 24 Apr 2019 00:53:25 +0200 Subject: [PATCH] Fix segfault when loading a file --- client/loclass/fileutils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/loclass/fileutils.c b/client/loclass/fileutils.c index 72d3e26af..e01d04e33 100644 --- a/client/loclass/fileutils.c +++ b/client/loclass/fileutils.c @@ -313,8 +313,8 @@ int loadFile(const char *preferredName, const char *suffix, void *data, size_t m goto out; } - if (bytes_read != maxdatalen) { - PrintAndLogDevice(WARNING, "Warning, bytes read exeed calling array limit. Max bytes is %d bytes", maxdatalen); + if (bytes_read > maxdatalen) { + PrintAndLogDevice(WARNING, "Warning, bytes read exceed calling array limit. Max bytes is %d bytes", maxdatalen); bytes_read = maxdatalen; }