1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-26 07:33:47 +00:00

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.
This commit is contained in:
Philipp Stephani 2021-04-22 16:11:10 +02:00
parent 47576b429d
commit aaf6b6bf80

View File

@ -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));