summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/vfprintf.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2014-05-03 12:36:45 +0000
committerderaadt <deraadt@openbsd.org>2014-05-03 12:36:45 +0000
commit6b86ff879b2a2d4b68b2dcc80eb96bbf1f99247f (patch)
treed1a6c88fadfee063108e976899d1839d796e2c62 /lib/libc/stdio/vfprintf.c
parentEnable assembler bits for BN (Montgomery), SHA1 and SHA256. (diff)
downloadwireguard-openbsd-6b86ff879b2a2d4b68b2dcc80eb96bbf1f99247f.tar.xz
wireguard-openbsd-6b86ff879b2a2d4b68b2dcc80eb96bbf1f99247f.zip
Add #ifndef NO_PRINTF_PERCENT_N. Since we are fully standardized, we
don't use disable %n ourselves. But Google's Android libc is based on our libc.... Giving them an easy knob to disable this dangerous feature easily make their job easier without making our job any harder. Request from Elliott @ google
Diffstat (limited to 'lib/libc/stdio/vfprintf.c')
-rw-r--r--lib/libc/stdio/vfprintf.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libc/stdio/vfprintf.c b/lib/libc/stdio/vfprintf.c
index 86b540e92c0..7f8ff317794 100644
--- a/lib/libc/stdio/vfprintf.c
+++ b/lib/libc/stdio/vfprintf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfprintf.c,v 1.65 2014/03/19 05:17:01 guenther Exp $ */
+/* $OpenBSD: vfprintf.c,v 1.66 2014/05/03 12:36:45 deraadt Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@@ -801,6 +801,7 @@ fp_common:
}
break;
#endif /* FLOATING_POINT */
+#ifndef NO_PRINTF_PERCENT_N
case 'n':
if (flags & LLONGINT)
*GETARG(long long *) = ret;
@@ -819,6 +820,7 @@ fp_common:
else
*GETARG(int *) = ret;
continue; /* no output */
+#endif /* NO_PRINTF_PERCENT_N */
case 'O':
flags |= LONGINT;
/*FALLTHROUGH*/
@@ -1317,6 +1319,7 @@ reswitch: switch (ch) {
ADDTYPE(T_DOUBLE);
break;
#endif /* FLOATING_POINT */
+#ifndef NO_PRINTF_PERCENT_N
case 'n':
if (flags & LLONGINT)
ADDTYPE(TP_LLONG);
@@ -1333,6 +1336,7 @@ reswitch: switch (ch) {
else
ADDTYPE(TP_INT);
continue; /* no output */
+#endif /* NO_PRINTF_PERCENT_N */
case 'O':
flags |= LONGINT;
/*FALLTHROUGH*/