aboutsummaryrefslogtreecommitdiffstats
path: root/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-dash-Specify-format-string-in-fmtstr.patch
blob: 46a23987f5380dea7d37e0782f1219add65e1e8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From 8beffe501c1ac5b35d62004735c4157c74183901 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sun, 9 Jul 2017 13:51:25 -0700
Subject: [PATCH] dash: Specify format string in fmtstr()

Fixes build with hardening flags

usr/dash/jobs.c:429:3: error: format not a string literal and no format arguments [-Werror=format-security]
   col = fmtstr(s, 32, strsignal(st));

Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 usr/dash/jobs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr/dash/jobs.c b/usr/dash/jobs.c
index 009bbfe..299bcac 100644
--- a/usr/dash/jobs.c
+++ b/usr/dash/jobs.c
@@ -426,7 +426,7 @@ sprint_status(char *s, int status, int sigonly)
 				goto out;
 #endif
 		}
-		col = fmtstr(s, 32, strsignal(st));
+		col = fmtstr(s, 32, "%s", strsignal(st));
 #ifdef WCOREDUMP
 		if (WCOREDUMP(status)) {
 			col += fmtstr(s + col, 16, " (core dumped)");