summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2026-05-20 08:39:44 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2026-05-23 19:18:52 -0700
commit5fd1e0bbef85119527129da8bc645c102434ab28 (patch)
tree5cb817180b1a2076dedfb846393bcf48bdcfc08c
parent9851c5ea3410589dadfc43e809fd65ee66b58d28 (diff)
Coalesce load_seccomp comparisons
* src/emacs.c (load_seccomp): One comparison, not two.
-rw-r--r--src/emacs.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/emacs.c b/src/emacs.c
index 465a7a0b108..a9b970effb4 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -1228,8 +1228,7 @@ load_seccomp (const char *file)
goto out;
}
struct sock_fprog program;
- if (stat.st_size <= 0 || SIZE_MAX <= stat.st_size
- || PTRDIFF_MAX <= stat.st_size
+ if (stat.st_size <= 0 || min (PTRDIFF_MAX, SIZE_MAX) <= stat.st_size
|| stat.st_size % sizeof *program.filter != 0)
{
fprintf (stderr, "seccomp filter %s has invalid size %ld\n",