From fef02cf4c646f4b2d2bd9283b42fb773fb213cb3 Mon Sep 17 00:00:00 2001 From: Sebastien GODARD Date: Fri, 1 Jul 2016 12:38:38 +0200 Subject: [PATCH] Fix unsigned compared against 0 file_magic->header_size is an unsigned int value and so cannot be strictly less than 0 [CID#127473]. Signed-off-by: Sebastien GODARD --- sa_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sa_common.c b/sa_common.c index f4e8a1e..2666050 100644 --- a/sa_common.c +++ b/sa_common.c @@ -1274,7 +1274,7 @@ int sa_open_read_magic(int *fd, char *dfile, struct file_magic *file_magic, if ((n != FILE_MAGIC_SIZE) || (file_magic->sysstat_magic != SYSSTAT_MAGIC) || ((file_magic->format_magic != FORMAT_MAGIC) && !ignore) || - (file_magic->header_size < MIN_FILE_HEADER_SIZE) || + (file_magic->header_size <= MIN_FILE_HEADER_SIZE) || (file_magic->header_size > MAX_FILE_HEADER_SIZE) || ((file_magic->header_size < FILE_HEADER_SIZE) && !ignore)) { /* Display error message and exit */ -- 2.40.0