Package: dumpasn1 / 20120521-1

fixprintf.patch Patch series | download
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
30
31
32
33
34
35
36
37
Description: dumpasn1: error: format not a string literal and no format arguments
 >I believe we are not looking at the same file. So here is my log again:
 >
 >$ wget http://www.cs.auckland.ac.nz/~pgut001/dumpasn1.c
 >$ gcc  -Wformat  -Werror=3Dformat-security -DDEBIAN dumpasn1.c -o dummy
 >dumpasn1.c: In function =91complain=92:
 >dumpasn1.c:1181: error: format not a string literal and no format arguments
 >$ head -1181 dumpasn1.c | tail -1
 >                        fprintf( output, INDENT_STRING );
 
 It is the same file, INDENT_STRING is a macro that expands into a reference
 into the const, static string of spaces I quoted.
 
 >I believe fprintf needs explicit format specifier to please the gcc security
 >option.
 
 In that case you could change it to something like:
 
   fprintf( output, "%s", INDENT_STRING );
 
 Peter.
Author: Mathieu Malaterre <malat@debian.org>
Forwarded: not-needed

Index: dumpasn1-20120521/dumpasn1.c
===================================================================
--- dumpasn1-20120521.orig/dumpasn1.c	2012-06-13 08:39:26.867691582 +0000
+++ dumpasn1-20120521/dumpasn1.c	2012-06-13 08:40:08.803691002 +0000
@@ -1179,7 +1179,7 @@
 	if( level < maxNestLevel )
 		{
 		if( !doPure )
-			fprintf( output, INDENT_STRING );
+			fprintf( output, "%s", INDENT_STRING );
 		doIndent( level + 1 );
 		}
 	fprintf( output, "Error: %s.\n", message );