From 5dbd073b045c8e98730c025a4acf2279be26c33e Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Fri, 14 Apr 2023 10:49:05 -0400 Subject: [PATCH] awk: errror on printf format strings lacking conversion specifier Reported by: phk Reviewed by: imp, markj MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39573 --- contrib/one-true-awk/run.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contrib/one-true-awk/run.c b/contrib/one-true-awk/run.c index 117fb0748bd8..b81dafba35e6 100644 --- a/contrib/one-true-awk/run.c +++ b/contrib/one-true-awk/run.c @@ -912,6 +912,9 @@ int format(char **pbuf, int *pbufsize, const char *s, Node *a) /* printf-like co case 'c': flag = 'c'; break; + case '\0': + FATAL("missing printf conversion specifier"); + break; default: WARNING("weird printf conversion %s", fmt); flag = '?';