summaryrefslogtreecommitdiff
path: root/lib/printf/vfprintf.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2021-02-01 20:41:27 -0500
committerGitHub <noreply@github.com>2021-02-01 20:41:27 -0500
commitcf8ba91e32f01eb889471499f0f2bbb422a7fb8f (patch)
tree2d10688ac41b9e427e34f9917cfa2ecc64809f56 /lib/printf/vfprintf.c
parent578d772bc1660b1180c9f19ca59f8566740f58c0 (diff)
parent738cca0ab4b900e2ecdb1ab28bc431fca014e6b0 (diff)
Merge pull request #7994 from opensourcerouting/disable-printf-n
lib/printf: disable `%n` specifier
Diffstat (limited to 'lib/printf/vfprintf.c')
-rw-r--r--lib/printf/vfprintf.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/printf/vfprintf.c b/lib/printf/vfprintf.c
index 6ffccb3811..a0634cde4b 100644
--- a/lib/printf/vfprintf.c
+++ b/lib/printf/vfprintf.c
@@ -503,6 +503,11 @@ reswitch: switch (ch) {
size = (prec >= 0) ? strnlen(cp, prec) : strlen(cp);
sign = '\0';
break;
+#ifdef DANGEROUS_PERCENT_N
+ /* FRR does not use %n in printf formats. This is just left
+ * here in case someone tries to use %n and starts debugging
+ * why the f* it doesn't work
+ */
case 'n':
/*
* Assignment-like behavior is specified if the
@@ -526,6 +531,7 @@ reswitch: switch (ch) {
else
*GETARG(int *) = ret;
continue; /* no output */
+#endif
case 'O':
flags |= LONGINT;
/*FALLTHROUGH*/