File: secure-format-log-string.diff

package info (click to toggle)
oolite 1.84-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 124,644 kB
  • ctags: 3,975
  • sloc: objc: 132,132; ansic: 3,138; sh: 559; perl: 359; makefile: 276; php: 5
file content (142 lines) | stat: -rw-r--r-- 5,205 bytes parent folder | 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
Description: compile with -Werror=format-security, default with gcc-5
 Chris Morris <cim@oolite.org>:
 I think this is probably a GCC5 bug, since these are static objc strings,
 and GCC4.9 with the warning option enabled doesn't warn about any of them.
Origin: https://github.com/OoliteProject/oolite/commit/80835961e0d0fad8c9dd1bfbd26706808360c66f
Origin: https://github.com/OoliteProject/oolite/commit/a439f3de41c0ee967c11a5728db54b79fdd3ec55
Author: Chris Morris <cim@oolite.org>
Author: Nicolas Boulenguez <nicolas@debian.org>
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=778039

--- a/src/Core/Entities/PlayerEntityLoadSave.m
+++ b/src/Core/Entities/PlayerEntityLoadSave.m
@@ -333,7 +333,7 @@
 	NSString *file = [scenario oo_stringForKey:@"file" defaultValue:nil];
 	if (file == nil) 
 	{
-		OOLog(@"scenario.init.error",@"No file entry found for scenario");
+		OOLog(@"scenario.init.error", @"%@", @"No file entry found for scenario");
 		return NO;
 	}
 	NSString *path = [ResourceManager pathForFileNamed:file inFolder:@"Scenarios"];
@@ -616,7 +616,7 @@
 	
 	if (loadedOK)
 	{
-		OOLog(@"load.progress",@"Reading file");
+		OOLog(@"load.progress", @"%@", @"Reading file");
 		fileDic = OODictionaryFromFile(fileToOpen);
 		if (fileDic == nil)
 		{
@@ -627,7 +627,7 @@
 
 	if (loadedOK)
 	{
-		OOLog(@"load.progress",@"Restricting scenario");
+		OOLog(@"load.progress", @"%@", @"Restricting scenario");
 		NSString *scenarioRestrict = [fileDic oo_stringForKey:@"scenario_restriction" defaultValue:nil];
 		if (scenarioRestrict == nil)
 		{
@@ -653,7 +653,7 @@
 
 	if (loadedOK)
 	{
-		OOLog(@"load.progress",@"Creating player ship");
+		OOLog(@"load.progress", @"%@", @"Creating player ship");
 		// Check that player ship exists
 		NSString		*shipKey = nil;
 		NSDictionary	*shipDict = nil;
@@ -671,7 +671,7 @@
 	
 	if (loadedOK)
 	{
-		OOLog(@"load.progress",@"Initialising player entity");
+		OOLog(@"load.progress", @"%@", @"Initialising player entity");
 		if (![self setUpAndConfirmOK:YES saveGame:YES])
 		{
 			fail_reason = DESC(@"loadfailed-could-not-reset-javascript");
@@ -681,7 +681,7 @@
 	
 	if (loadedOK)
 	{
-		OOLog(@"load.progress",@"Loading commander data");
+		OOLog(@"load.progress", @"%@", @"Loading commander data");
 		if (![self setCommanderDataFromDictionary:fileDic])
 		{
 			// this could still be a reset js issue, if switching from strict / unrestricted
@@ -693,7 +693,7 @@
 	
 	if (loadedOK)
 	{
-		OOLog(@"load.progress",@"Recording save path");
+		OOLog(@"load.progress", @"%@", @"Recording save path");
 		if (!asNew)
 		{
 			[save_path autorelease];
@@ -714,7 +714,7 @@
 		return NO;
 	}
 	
-	OOLog(@"load.progress",@"Creating system");
+	OOLog(@"load.progress", @"%@", @"Creating system");
 	[UNIVERSE setTimeAccelerationFactor:TIME_ACCELERATION_FACTOR_DEFAULT];
 	[UNIVERSE setSystemTo:system_id];
 	[UNIVERSE removeAllEntitiesExceptPlayer];
@@ -722,7 +722,7 @@
 	[UNIVERSE setUpSpace];
 	[UNIVERSE setAutoSaveNow:NO];
 	
-	OOLog(@"load.progress",@"Resetting player flight variables");
+	OOLog(@"load.progress", @"%@", @"Resetting player flight variables");
 	[self setDockedAtMainStation];
 	StationEntity *dockedStation = [self dockedStation];
 	
@@ -744,7 +744,7 @@
 	
 	[self setEntityPersonalityInt:PersonalityForCommanderDict(fileDic)];
 	
-	OOLog(@"load.progress",@"Loading system market");
+	OOLog(@"load.progress", @"%@", @"Loading system market");
 	// dockedStation is always the main station at this point;
 	// "localMarket" save key always refers to the main station (system) market
 	NSArray *market = [fileDic oo_arrayForKey:@"localMarket"];
@@ -759,7 +759,7 @@
 
 	[self calculateCurrentCargo];
 	
-	OOLog(@"load.progress",@"Setting scenario key");
+	OOLog(@"load.progress", @"%@", @"Setting scenario key");
 	// set scenario key if the scenario allows saving and has one
 	NSString *scenario = [fileDic oo_stringForKey:@"scenario_key" defaultValue:nil];
 	DESTROY(scenarioKey);
@@ -768,11 +768,11 @@
 		scenarioKey = [scenario retain];
 	}
 
-	OOLog(@"load.progress",@"Starting JS engine");
+	OOLog(@"load.progress", @"%@", @"Starting JS engine");
 	// Remember the savegame target, run js startUp.
 	[self completeSetUpAndSetTarget:NO];
 	// run initial system population
-	OOLog(@"load.progress",@"Populating initial system");
+	OOLog(@"load.progress", @"%@", @"Populating initial system");
 	[UNIVERSE populateNormalSpace];
 
 	// might as well start off with a collected JS environment
@@ -792,14 +792,14 @@
 	// and initialise markets for the secondary stations
 	[UNIVERSE loadStationMarkets:[fileDic oo_arrayForKey:@"station_markets"]];
 
-	OOLog(@"load.progress",@"Completing JS startup");
+	OOLog(@"load.progress", @"%@", @"Completing JS startup");
 	[self startUpComplete];
 
 	[[UNIVERSE gameView] supressKeysUntilKeyUp];
 	gui_screen = GUI_SCREEN_LOAD; // force evaluation of new gui screen on startup
 	[self setGuiToStatusScreen];
 	if (loadedOK) [self doWorldEventUntilMissionScreen:OOJSID("missionScreenOpportunity")];  // trigger missionScreenOpportunity immediately after loading
-	OOLog(@"load.progress",@"Loading complete");
+	OOLog(@"load.progress", @"%@", @"Loading complete");
 	return loadedOK;
 }