diff mbox series

Use explicit '%s' when formatting a signal name

Message ID CAD_xR9cWzMvUUbhCvEEOt+TQmwg7m6OjCfscv9ehConcaKAmBw@mail.gmail.com (mailing list archive)
State Not Applicable
Delegated to: Herbert Xu
Headers show
Series Use explicit '%s' when formatting a signal name | expand

Commit Message

Stephen Oberholtzer Dec. 6, 2019, 9:38 p.m. UTC
Dash fails to build from source on recent Debian setups, due to a non-constant
string being used as a format string, which trips over -Werror=format-security.
---
 src/jobs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.20.1

--
Stephen Oberholtzer

Comments

Harald van Dijk Dec. 6, 2019, 10:41 p.m. UTC | #1
On 06/12/2019 21:38, Stephen Oberholtzer wrote:
> Dash fails to build from source on recent Debian setups, due to a non-constant
> string being used as a format string, which trips over -Werror=format-security.

This has already been addressed differently: 
<https://www.mail-archive.com/dash@vger.kernel.org/msg01626.html>, 
commit 15a60c2357f772ccf953772859e8f9fc124442e2.

Cheers,
Harald van Dijk
diff mbox series

Patch

diff --git a/src/jobs.c b/src/jobs.c
index 606d603..9728579 100644
--- a/src/jobs.c
+++ b/src/jobs.c
@@ -428,7 +428,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)");