summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2024-02-01 16:58:33 -0500
committerJakob Kaivo <jkk@ung.org>2024-02-01 16:58:33 -0500
commita73164a78c3144cc983dd332705df1a906911017 (patch)
tree49852739ad223014eab0e5261fc0ef7ceeb94532
parent473a9dae23d46a4ec1827e4d68363eea805c08dc (diff)
add symbols for va_* to trigger UB if dlsym()ed
-rw-r--r--src/stdarg/va_arg.c11
-rw-r--r--src/stdarg/va_copy.c11
-rw-r--r--src/stdarg/va_end.c11
-rw-r--r--src/stdarg/va_start.c11
4 files changed, 44 insertions, 0 deletions
diff --git a/src/stdarg/va_arg.c b/src/stdarg/va_arg.c
new file mode 100644
index 00000000..fd354ee8
--- /dev/null
+++ b/src/stdarg/va_arg.c
@@ -0,0 +1,11 @@
+#include "_safety.h"
+
+void va_arg()
+{
+ __undefined("The va_arg() macro has been suppressed to access an actual function");
+}
+
+/*
+SIGNAL_SAFE(0)
+STDC(0)
+*/
diff --git a/src/stdarg/va_copy.c b/src/stdarg/va_copy.c
new file mode 100644
index 00000000..a2de7c7d
--- /dev/null
+++ b/src/stdarg/va_copy.c
@@ -0,0 +1,11 @@
+#include "_safety.h"
+
+void va_copy()
+{
+ __undefined("The va_copy() macro has been suppressed to access an actual function");
+}
+
+/*
+SIGNAL_SAFE(0)
+STDC(0)
+*/
diff --git a/src/stdarg/va_end.c b/src/stdarg/va_end.c
new file mode 100644
index 00000000..850c858b
--- /dev/null
+++ b/src/stdarg/va_end.c
@@ -0,0 +1,11 @@
+#include "_safety.h"
+
+void va_end()
+{
+ __undefined("The va_end() macro has been suppressed to access an actual function");
+}
+
+/*
+SIGNAL_SAFE(0)
+STDC(0)
+*/
diff --git a/src/stdarg/va_start.c b/src/stdarg/va_start.c
new file mode 100644
index 00000000..94a5fdb5
--- /dev/null
+++ b/src/stdarg/va_start.c
@@ -0,0 +1,11 @@
+#include "_safety.h"
+
+void va_start()
+{
+ __undefined("The va_start() macro has been suppressed to access an actual function");
+}
+
+/*
+SIGNAL_SAFE(0)
+STDC(0)
+*/