Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 1 | From cea83003de3ffebde92becd1e599fe3b28f0a7c4 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Mon, 6 Mar 2017 23:13:36 -0800 |
| 4 | Subject: [PATCH] t1lib: Fix printf format string errors |
| 5 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 6 | Fix printf formats to use format qualifiers |
| 7 | fixes |
| 8 | |
| 9 | error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security] |
| 10 | |
| 11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 12 | Upstream-Status: Pending |
| 13 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 14 | --- |
| 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 | |
| 20 | diff --git a/lib/t1lib/t1subset.c b/lib/t1lib/t1subset.c |
| 21 | index da427b2..e76974f 100644 |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 22 | --- a/lib/t1lib/t1subset.c |
| 23 | +++ b/lib/t1lib/t1subset.c |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 24 | @@ -759,7 +759,7 @@ char *T1_SubsetFont( int FontID, |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 25 | 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 Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 33 | diff --git a/lib/type1/objects.c b/lib/type1/objects.c |
| 34 | index 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 | |
| 46 | diff --git a/lib/type1/objects.h b/lib/type1/objects.h |
| 47 | index 13cbae7..3a1d337 100644 |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 48 | --- a/lib/type1/objects.h |
| 49 | +++ b/lib/type1/objects.h |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 50 | @@ -214,7 +214,7 @@ struct xobject { |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 51 | /*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) \ |