From c0ecb1c626063be4b32e797f71a194268487b76e Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Tue, 14 Apr 2026 10:14:32 +0200 Subject: [PATCH] fpga_compress: fix heap corruption --- tools/fpga_compress/fpga_compress.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/fpga_compress/fpga_compress.c b/tools/fpga_compress/fpga_compress.c index 04712c91b..b9fb8d332 100644 --- a/tools/fpga_compress/fpga_compress.c +++ b/tools/fpga_compress/fpga_compress.c @@ -59,9 +59,9 @@ static int zlib_compress(FILE *infile[], uint8_t num_infiles, FILE *outfile) { uint32_t total_size = 0; do { - if (total_size > num_infiles * FPGA_CONFIG_SIZE) { + if (total_size >= num_infiles * FPGA_CONFIG_SIZE) { 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 );