summaryrefslogtreecommitdiff
path: root/lib-src
diff options
context:
space:
mode:
authorPhilipp Stephani <phst@google.com>2021-04-22 16:11:10 +0200
committerPhilipp Stephani <phst@google.com>2021-04-22 16:11:10 +0200
commitaaf6b6bf80805d18180e1c16350e9473716f5915 (patch)
treee1f1c868c32f08366021d2317f84a6d062e8aa7e /lib-src
parent47576b429d799b6f1d02c15b3c221c69e59a2ac6 (diff)
downloademacs-aaf6b6bf80805d18180e1c16350e9473716f5915.tar.gz
Ensure that argument to 'verify' is a constant expression.
Casting NULL is not a constant expression (Bug#47951). * lib-src/seccomp-filter.c (main): Turn check for null pointer representation into a runtime assertion.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/seccomp-filter.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib-src/seccomp-filter.c b/lib-src/seccomp-filter.c
index 31d0809f8f0..dc568e035b5 100644
--- a/lib-src/seccomp-filter.c
+++ b/lib-src/seccomp-filter.c
@@ -35,6 +35,7 @@ variants of those files that can be used to sandbox Emacs before
#include "config.h"
+#include <assert.h>
#include <errno.h>
#include <limits.h>
#include <stdarg.h>
@@ -169,7 +170,7 @@ main (int argc, char **argv)
verify (sizeof (long) == 8 && LONG_MIN == INT64_MIN
&& LONG_MAX == INT64_MAX);
verify (sizeof (void *) == 8);
- verify ((uintptr_t) NULL == 0);
+ assert ((uintptr_t) NULL == 0);
/* Allow a clean exit. */
RULE (SCMP_ACT_ALLOW, SCMP_SYS (exit));