Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 1 | From 2fff607fd0b5550e5072a6fffcbb01c29d5207d2 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Sun, 9 Jul 2017 13:51:25 -0700 |
| 4 | Subject: [PATCH] dash: Specify format string in fmtstr() |
| 5 | |
| 6 | Fixes build with hardening flags |
| 7 | |
| 8 | usr/dash/jobs.c:429:3: error: format not a string literal and no format arguments [-Werror=format-security] |
| 9 | col = fmtstr(s, 32, strsignal(st)); |
| 10 | |
| 11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 12 | --- |
| 13 | usr/dash/jobs.c | 2 +- |
| 14 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 15 | |
| 16 | diff --git a/usr/dash/jobs.c b/usr/dash/jobs.c |
| 17 | index 009bbfee..299bcacc 100644 |
| 18 | --- a/usr/dash/jobs.c |
| 19 | +++ b/usr/dash/jobs.c |
| 20 | @@ -426,7 +426,7 @@ sprint_status(char *s, int status, int sigonly) |
| 21 | goto out; |
| 22 | #endif |
| 23 | } |
| 24 | - col = fmtstr(s, 32, strsignal(st)); |
| 25 | + col = fmtstr(s, 32, "%s", strsignal(st)); |
| 26 | #ifdef WCOREDUMP |
| 27 | if (WCOREDUMP(status)) { |
| 28 | col += fmtstr(s + col, 16, " (core dumped)"); |
| 29 | -- |
| 30 | 2.13.2 |
| 31 | |