Package: vitetris / 0.57.2-2

0002-fix-insecure-printf.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
38
39
40
41
42
43
44
45
From: Baptiste BEAUPLAT <lyknode@cilg.org>
Date: Mon, 15 Oct 2018 20:57:40 +0200
Subject: fix-insecure-printf

Fix insecure printf
---
 src/cfgfile.c | 4 ++--
 src/cmdline.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/cfgfile.c b/src/cfgfile.c
index 53210a6..b74083b 100644
--- a/src/cfgfile.c
+++ b/src/cfgfile.c
@@ -300,7 +300,7 @@ static void printbtnmapping(FILE *fp, int n, int keypress, int i)
 		return;
 	fprintf(fp, "%s=", input_keynames[i]);
 	if (b < 10)
-		fprintf(fp, input_chr9[b-1]);
+		fprintf(fp, "%s", input_chr9[b-1]);
 	else
 		fprintf(fp, "%d", b-'0');
 	putc('\n', fp);
@@ -337,7 +337,7 @@ static void printkeymapping(FILE *fp, int keypress, int i)
 	if (s[0] > ' ')
 		putc(s[0], fp);
 	else if (s[0] < 10)
-		fprintf(fp, input_chr9[s[0]-1]);
+		fprintf(fp, "%s", input_chr9[s[0]-1]);
 	else
 		fprintf(fp, "%d", s[0]);
 	putc('\n', fp);
diff --git a/src/cmdline.c b/src/cmdline.c
index ec9ba73..32929c6 100644
--- a/src/cmdline.c
+++ b/src/cmdline.c
@@ -357,7 +357,7 @@ static void print_hiscorelist()
 	else {
 		printf("    Name      Score  Lvl  Lines\n");
 		gethiscorelist(buf);
-		printf(buf);
+		printf("%s", buf);
 	}
 }