Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 1 | From 8beffe501c1ac5b35d62004735c4157c74183901 Mon Sep 17 00:00:00 2001 |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 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> |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 12 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 13 | --- |
| 14 | usr/dash/jobs.c | 2 +- |
| 15 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 16 | |
| 17 | diff --git a/usr/dash/jobs.c b/usr/dash/jobs.c |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 18 | index 009bbfe..299bcac 100644 |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 19 | --- a/usr/dash/jobs.c |
| 20 | +++ b/usr/dash/jobs.c |
| 21 | @@ -426,7 +426,7 @@ sprint_status(char *s, int status, int sigonly) |
| 22 | goto out; |
| 23 | #endif |
| 24 | } |
| 25 | - col = fmtstr(s, 32, strsignal(st)); |
| 26 | + col = fmtstr(s, 32, "%s", strsignal(st)); |
| 27 | #ifdef WCOREDUMP |
| 28 | if (WCOREDUMP(status)) { |
| 29 | col += fmtstr(s + col, 16, " (core dumped)"); |