diff options
author | 2003-10-01 18:19:08 +0000 | |
---|---|---|
committer | 2003-10-01 18:19:08 +0000 | |
commit | 1109a95fd3442ed1ee6a5bcb6552580fec0db891 (patch) | |
tree | babbffe5d3e5213e5acd72698664892e6157b2ee /lib/libc/sys/stack_protector.c | |
parent | Don't use the contents of ~/.signature for the Organization field. (diff) | |
download | wireguard-openbsd-1109a95fd3442ed1ee6a5bcb6552580fec0db891.tar.xz wireguard-openbsd-1109a95fd3442ed1ee6a5bcb6552580fec0db891.zip |
Directly invoke the sysctl system call, rather than going through the sysctl(3)
wrapper.
ok deraadt@ millert@
Diffstat (limited to 'lib/libc/sys/stack_protector.c')
-rw-r--r-- | lib/libc/sys/stack_protector.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/libc/sys/stack_protector.c b/lib/libc/sys/stack_protector.c index 9f45343311c..7e6746f7128 100644 --- a/lib/libc/sys/stack_protector.c +++ b/lib/libc/sys/stack_protector.c @@ -1,4 +1,4 @@ -/* $OpenBSD: stack_protector.c,v 1.5 2003/07/18 23:05:13 david Exp $ */ +/* $OpenBSD: stack_protector.c,v 1.6 2003/10/01 18:19:08 miod Exp $ */ /* * Copyright (c) 2002 Hiroaki Etoh, Federico G. Schwindt, and Miodrag Vallat. @@ -28,7 +28,7 @@ */ #if defined(LIBC_SCCS) && !defined(list) -static char rcsid[] = "$OpenBSD: stack_protector.c,v 1.5 2003/07/18 23:05:13 david Exp $"; +static char rcsid[] = "$OpenBSD: stack_protector.c,v 1.6 2003/10/01 18:19:08 miod Exp $"; #endif #include <sys/param.h> @@ -38,6 +38,8 @@ static char rcsid[] = "$OpenBSD: stack_protector.c,v 1.5 2003/07/18 23:05:13 dav #include <syslog.h> #include <unistd.h> +extern int __sysctl(int *, u_int, void *, size_t *, void *, size_t); + long __guard[8] = {0, 0, 0, 0, 0, 0, 0, 0}; static void __guard_setup(void) __attribute__ ((constructor)); void __stack_smash_handler(char func[], int damaged __attribute__((unused))); @@ -56,7 +58,7 @@ __guard_setup(void) len = 4; for (i = 0; i < sizeof(__guard) / 4; i++) { - if (sysctl(mib, 2, (char *)&((int *)__guard)[i], + if (__sysctl(mib, 2, (char *)&((int *)__guard)[i], &len, NULL, 0) == -1) break; } |