fpga_compress: fix heap corruption
This commit is contained in:
1 file changed
+2
-2
@@ -59,9 +59,9 @@ static int zlib_compress(FILE *infile[], uint8_t num_infiles, FILE *outfile) {
|
|||||||
uint32_t total_size = 0;
|
uint32_t total_size = 0;
|
||||||
do {
|
do {
|
||||||
|
|
||||||
if (total_size > num_infiles * FPGA_CONFIG_SIZE) {
|
if (total_size >= num_infiles * FPGA_CONFIG_SIZE) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Input files too big (total > %li bytes). These are probably not PM3 FPGA config files.\n"
|
"Input files too big (total >= %li bytes). These are probably not PM3 FPGA config files.\n"
|
||||||
, num_infiles * FPGA_CONFIG_SIZE
|
, num_infiles * FPGA_CONFIG_SIZE
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user