summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/setvbuf.c
diff options
context:
space:
mode:
authordhartmei <dhartmei@openbsd.org>2002-09-14 22:03:14 +0000
committerdhartmei <dhartmei@openbsd.org>2002-09-14 22:03:14 +0000
commit8d62ee40dc28d335867f292dd8aab66f53e20b5b (patch)
treead54f039e1d7d49a8f9d2f8fe09f8b447e2e743f /lib/libc/stdio/setvbuf.c
parentrecognize AppleKiwi (diff)
downloadwireguard-openbsd-8d62ee40dc28d335867f292dd8aab66f53e20b5b.tar.xz
wireguard-openbsd-8d62ee40dc28d335867f292dd8aab66f53e20b5b.zip
Move __cleanup into mprotect'ed page to prevent unintentional modifications
similar to the atexit handlers. Idea and help deraadt@, ok deraadt@
Diffstat (limited to 'lib/libc/stdio/setvbuf.c')
-rw-r--r--lib/libc/stdio/setvbuf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/stdio/setvbuf.c b/lib/libc/stdio/setvbuf.c
index 65501fce9d9..0c6fd8d1623 100644
--- a/lib/libc/stdio/setvbuf.c
+++ b/lib/libc/stdio/setvbuf.c
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: setvbuf.c,v 1.3 2001/07/09 06:57:44 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: setvbuf.c,v 1.4 2002/09/14 22:03:14 dhartmei Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
@@ -155,7 +155,7 @@ nbf:
/* begin/continue reading, or stay in intermediate state */
fp->_w = 0;
}
- __cleanup = _cleanup;
+ __atexit_register_cleanup(_cleanup);
return (ret);
}