git: 46529cb99040 - stable/13 - awk: errror on printf format strings lacking conversion specifier

From: Ed Maste <emaste_at_FreeBSD.org>
Date: Mon, 17 Apr 2023 13:13:17 UTC
The branch stable/13 has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=46529cb990402ed46f5f3555aecc41091ef63f41

commit 46529cb990402ed46f5f3555aecc41091ef63f41
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2023-04-14 14:49:05 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2023-04-17 13:13:10 +0000

    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
    
    (cherry picked from commit 5dbd073b045c8e98730c025a4acf2279be26c33e)
---
 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 = '?';