File: initialize-entityString.patch

package info (click to toggle)
ufoai 2.5-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 82,120 kB
  • sloc: cpp: 225,232; python: 5,111; ansic: 4,133; php: 2,209; perl: 1,931; sh: 1,505; xml: 1,115; makefile: 406; sed: 11
file content (26 lines) | stat: -rw-r--r-- 961 bytes parent folder | download | duplicates (6)
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
From: Markus Koschany <apo@debian.org>
Date: Tue, 25 Apr 2017 14:31:16 +0200
Subject: initialize entityString

Initialize entityString to avoid that ufo2map will randomly segfault when
compiling the maps.

Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=860680
Forwarded: https://sourceforge.net/p/ufoai/code/ci/bae827ba025ff1d3a56b402c27aa84401914acc4/
---
 src/tools/ufo2map/map.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/tools/ufo2map/map.cpp b/src/tools/ufo2map/map.cpp
index 47c49f3..f56c55e 100644
--- a/src/tools/ufo2map/map.cpp
+++ b/src/tools/ufo2map/map.cpp
@@ -1227,7 +1227,7 @@ void LoadMapFile (const char* filename)
 	/* Set the number of tiles to 1. This is fix for ufo2map right now. */
 	mapTiles.numTiles = 1;
 
-	char entityString[MAX_TOKEN_CHARS];
+	char entityString[MAX_TOKEN_CHARS] = "";
 	const char* ump = GetUMPName(filename);
 	if (ump != nullptr)
 		ParseUMP(ump, entityString, false);