blob: bc2476bfc1a5585f4cc3329c5387946f35a40439 [file] [log] [blame]
Brad Bishop316dfdd2018-06-25 12:45:53 -04001From cea83003de3ffebde92becd1e599fe3b28f0a7c4 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 6 Mar 2017 23:13:36 -0800
4Subject: [PATCH] t1lib: Fix printf format string errors
5
Brad Bishop6e60e8b2018-02-01 10:27:11 -05006Fix printf formats to use format qualifiers
7fixes
8
9error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security]
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12Upstream-Status: Pending
13
Brad Bishop316dfdd2018-06-25 12:45:53 -040014---
15 lib/t1lib/t1subset.c | 2 +-
16 lib/type1/objects.c | 2 +-
17 lib/type1/objects.h | 2 +-
18 3 files changed, 3 insertions(+), 3 deletions(-)
19
20diff --git a/lib/t1lib/t1subset.c b/lib/t1lib/t1subset.c
21index da427b2..e76974f 100644
Brad Bishop6e60e8b2018-02-01 10:27:11 -050022--- a/lib/t1lib/t1subset.c
23+++ b/lib/t1lib/t1subset.c
Brad Bishop316dfdd2018-06-25 12:45:53 -040024@@ -759,7 +759,7 @@ char *T1_SubsetFont( int FontID,
Brad Bishop6e60e8b2018-02-01 10:27:11 -050025 tr_len);
26 T1_PrintLog( "T1_SubsetFont()", err_warn_msg_buf,
27 T1LOG_DEBUG);
28- l+=sprintf( &(trailerbuf[l]), linebuf); /* contains the PostScript trailer */
29+ l+=sprintf( &(trailerbuf[l]), "%s", linebuf); /* contains the PostScript trailer */
30 }
31
32 /* compute size of output file */
Brad Bishop316dfdd2018-06-25 12:45:53 -040033diff --git a/lib/type1/objects.c b/lib/type1/objects.c
34index c413a0f..f828e6a 100644
35--- a/lib/type1/objects.c
36+++ b/lib/type1/objects.c
37@@ -957,7 +957,7 @@ struct xobject *TypeErr(name, obj, expect, ret) /* non-ANSI avoids overly strict
38
39 sprintf(typemsg, "Wrong object type in %s; expected %s, found %s.\n",
40 name, TypeFmt(expect), TypeFmt(obj->type));
41- IfTrace0(TRUE,typemsg);
42+ IfTrace1(TRUE, "%s", typemsg);
43
44 ObjectPostMortem(obj);
45
46diff --git a/lib/type1/objects.h b/lib/type1/objects.h
47index 13cbae7..3a1d337 100644
Brad Bishop6e60e8b2018-02-01 10:27:11 -050048--- a/lib/type1/objects.h
49+++ b/lib/type1/objects.h
Brad Bishop316dfdd2018-06-25 12:45:53 -040050@@ -214,7 +214,7 @@ struct xobject {
Brad Bishop6e60e8b2018-02-01 10:27:11 -050051 /*SHARED*/
52 /* NDW: personally, I want to see status and error messages! */
53 #define IfTrace0(condition,model) \
54- {if (condition) printf(model);}
55+ {if (condition) fputs(model,stdout);}
56 #define IfTrace1(condition,model,arg0) \
57 {if (condition) printf(model,arg0);}
58 #define IfTrace2(condition,model,arg0,arg1) \