1From 7a3095d1e9b7c73f9dca56250f433bcfc7cb660e Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 27 Jun 2017 10:15:34 -0700
4Subject: [PATCH] telnet/telnetd: Fix print format strings
5
6Fixes build with hardening flags
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
10 telnet/utilities.cc | 6 +++---
11 telnetd/utility.c   | 6 +++---
12 2 files changed, 6 insertions(+), 6 deletions(-)
13
14diff --git a/telnet/utilities.cc b/telnet/utilities.cc
15index 66839ab..36f0731 100644
16--- a/telnet/utilities.cc
17+++ b/telnet/utilities.cc
18@@ -583,17 +583,17 @@ void printsub(int direction, unsigned char *pointer, int length) {
19 			case ENV_VAR:
20 			    if (pointer[1] == TELQUAL_SEND)
21 				goto def_case;
22-			    fprintf(NetTrace, "\" VAR " + noquote);
23+			    fprintf(NetTrace, "%s", "\" VAR " + noquote);
24 			    noquote = 2;
25 			    break;
26
27 			case ENV_VALUE:
28-			    fprintf(NetTrace, "\" VALUE " + noquote);
29+			    fprintf(NetTrace, "%s", "\" VALUE " + noquote);
30 			    noquote = 2;
31 			    break;
32
33 			case ENV_ESC:
34-			    fprintf(NetTrace, "\" ESC " + noquote);
35+			    fprintf(NetTrace, "%s", "\" ESC " + noquote);
36 			    noquote = 2;
37 			    break;
38
39diff --git a/telnetd/utility.c b/telnetd/utility.c
40index 29b7da1..75314cb 100644
41--- a/telnetd/utility.c
42+++ b/telnetd/utility.c
43@@ -909,17 +909,17 @@ printsub(char direction, unsigned char *pointer, int length)
44 			case ENV_VAR:
45 			    if (pointer[1] == TELQUAL_SEND)
46 				goto def_case;
47-			    netoprintf("\" VAR " + noquote);
48+			    netoprintf("%s", "\" VAR " + noquote);
49 			    noquote = 2;
50 			    break;
51
52 			case ENV_VALUE:
53-			    netoprintf("\" VALUE " + noquote);
54+			    netoprintf("%s", "\" VALUE " + noquote);
55 			    noquote = 2;
56 			    break;
57
58 			case ENV_ESC:
59-			    netoprintf("\" ESC " + noquote);
60+			    netoprintf("%s", "\" ESC " + noquote);
61 			    noquote = 2;
62 			    break;
63
64--
652.13.2
66
67