From c4fbdd8c8df108af743b0e4c6b49e5ac64fe9092 Mon Sep 17 00:00:00 2001 From: Packit Service Date: Dec 09 2020 17:27:00 +0000 Subject: Apply patch 0008-extensions-among-Check-call-to-fstat.patch patch_name: 0008-extensions-among-Check-call-to-fstat.patch present_in_specfile: true location_in_specfile: 8 --- diff --git a/extensions/libebt_among.c b/extensions/libebt_among.c index 2e87db3..715d559 100644 --- a/extensions/libebt_among.c +++ b/extensions/libebt_among.c @@ -6,6 +6,7 @@ * August, 2003 */ +#include #include #include #include @@ -137,7 +138,10 @@ static int bramong_parse(int c, char **argv, int invert, if ((fd = open(optarg, O_RDONLY)) == -1) xtables_error(PARAMETER_PROBLEM, "Couldn't open file '%s'", optarg); - fstat(fd, &stats); + if (fstat(fd, &stats) < 0) + xtables_error(PARAMETER_PROBLEM, + "fstat(%s) failed: '%s'", + optarg, strerror(errno)); flen = stats.st_size; /* use mmap because the file will probably be big */ optarg = mmap(0, flen, PROT_READ | PROT_WRITE,