Fix segfault when loading a file

This commit is contained in:
Philippe Teuwen 2019-04-24 00:53:25 +02:00
parent 127f5ed192
commit 25048ccf2f

View file

@ -313,8 +313,8 @@ int loadFile(const char *preferredName, const char *suffix, void *data, size_t m
goto out; goto out;
} }
if (bytes_read != maxdatalen) { if (bytes_read > maxdatalen) {
PrintAndLogDevice(WARNING, "Warning, bytes read exeed calling array limit. Max bytes is %d bytes", maxdatalen); PrintAndLogDevice(WARNING, "Warning, bytes read exceed calling array limit. Max bytes is %d bytes", maxdatalen);
bytes_read = maxdatalen; bytes_read = maxdatalen;
} }