From: Frederik Möllers Date: Wed, 24 Jun 2015 12:57:08 +0000 (+0200) Subject: Fix comparison error in fpga_compress X-Git-Tag: v2.2.0~9^2 X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/commitdiff_plain/61611f5b85475a94a4d8e10620ed5736034111bf?hp=-c Fix comparison error in fpga_compress The comparison would check for greater-than-or-equal the maximum amount of bytes to read/write when it should check for greater-than only. --- 61611f5b85475a94a4d8e10620ed5736034111bf diff --git a/client/fpga_compress.c b/client/fpga_compress.c index f7333b36..5c168292 100644 --- a/client/fpga_compress.c +++ b/client/fpga_compress.c @@ -96,7 +96,7 @@ int zlib_compress(FILE *infile[], uint8_t num_infiles, FILE *outfile) } } - if (i >= num_infiles * FPGA_CONFIG_SIZE) { + if (i > num_infiles * FPGA_CONFIG_SIZE) { fprintf(stderr, "Input files too big (total > %lu bytes). These are probably not PM3 FPGA config files.", num_infiles*FPGA_CONFIG_SIZE); for(uint16_t j = 0; j < num_infiles; j++) { fclose(infile[j]);