Patchwork [committed] Avoid -Wformat-security warning in libssp

login
register
mail settings
Submitter Jakub Jelinek
Date Dec. 7, 2013, 8:13 a.m.
Message ID <20131207081358.GZ892@tucnak.redhat.com>
Download mbox | patch
Permalink /patch/298637/
State New
Headers show

Comments

Jakub Jelinek - Dec. 7, 2013, 8:13 a.m.
Hi!

libssp apparently doesn't build with -Werror=format-security
which is planned to be default for Fedora.  While this is a false
positive, msg3 is always one of two string literals, I think it
doesn't hurt to use "%s" there.

Committed to trunk as obvious.


	Jakub

Patch

--- libssp/ChangeLog	(revision 205753)
+++ libssp/ChangeLog	(working copy)
@@ -1,3 +1,7 @@ 
+2013-12-07  Jakub Jelinek  <jakub@redhat.com>
+
+	* ssp.c (fail): Avoid -Wformat-security warning.
+
 2013-09-20  Alan Modra  <amodra@gmail.com>
 
 	* configure: Regenerate.
--- libssp/ssp.c	(revision 205753)
+++ libssp/ssp.c	(working copy)
@@ -1,5 +1,5 @@ 
 /* Stack protector support.
-   Copyright (C) 2005, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2005-2013 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -136,7 +136,7 @@  fail (const char *msg1, size_t msg1len,
 #ifdef HAVE_SYSLOG_H
   /* Only send the error to syslog if there was no tty available.  */
   else
-    syslog (LOG_CRIT, msg3);
+    syslog (LOG_CRIT, "%s", msg3);
 #endif /* HAVE_SYSLOG_H */
 
   /* Try very hard to exit.  Note that signals may be blocked preventing