tags 643464 + upstream
quit

Hi,

Didier Raboud wrote:

>> radeontool.c: In function 'fatal':
>> radeontool.c:42:5: error: format not a string literal and no format 
>> arguments [-Werror=format-security]

Yep, known.  The patch below (excluding the hunk patching radeonreg
since radeonreg is not in sid yet) should fix it.  I'd like to send a
batch of patches upstream soon addressing warnings including this one,
but maybe it's worth an upload to fix the build before then.

-- >8 --
Subject: avoid -Wformat-security warnings

fatal() is never called with a user-specified argument so it is safe
to pass its argument as an fprintf format string, but gcc doesn't know
that.  Using fprintf(stderr, "%s", arg) makes the intent clearer.

Signed-off-by: Jonathan Nieder <jrnie...@gmail.com>
---
Thanks,
Jonathan

 avivotool.c  |    2 +-
 radeonreg.c  |    2 +-
 radeontool.c |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/avivotool.c b/avivotool.c
index 240f523f..02b03bab 100644
--- a/avivotool.c
+++ b/avivotool.c
@@ -64,7 +64,7 @@ unsigned char * volatile fb_mem;
 
 static void fatal(char *why)
 {
-    fprintf(stderr, why);
+    fprintf(stderr, "%s", why);
     pci_system_cleanup();
 
 }
diff --git a/radeonreg.c b/radeonreg.c
index 9948665c..5f1ab61d 100644
--- a/radeonreg.c
+++ b/radeonreg.c
@@ -47,7 +47,7 @@ unsigned char * volatile fb_mem;
 
 static void fatal(char *why)
 {
-    fprintf(stderr, why);
+    fprintf(stderr, "%s", why);
     pci_system_cleanup();
 
 }
diff --git a/radeontool.c b/radeontool.c
index 6e269f1a..97b2c406 100644
--- a/radeontool.c
+++ b/radeontool.c
@@ -39,7 +39,7 @@ unsigned char * volatile ctrl_mem;
 static void radeon_rom_legacy_mmio_table(unsigned char *bios, int offset);
 static void fatal(char *why)
 {
-    fprintf(stderr,why);
+    fprintf(stderr, "%s", why);
     pci_system_cleanup();
     exit(-1);
 }
-- 
1.7.7.rc1




-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to