summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2013-11-22 21:41:49 +0000
committerrubidium <rubidium@openttd.org>2013-11-22 21:41:49 +0000
commited4e14dc205bead9b4b9c2666397eb8f9c599dd9 (patch)
tree5ed1699e1194086d705e1cc634b35fa6c5486152
parentfad4fa09ba173a6be76954acdbdb158a6232d0b0 (diff)
downloadopenttd-ed4e14dc205bead9b4b9c2666397eb8f9c599dd9.tar.xz
(svn r26047) -Fix: possible, but very unlikely, null pointer dereference when gunziping just downloaded files
-rw-r--r--src/network/network_content.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/network/network_content.cpp b/src/network/network_content.cpp
index e6e91897c..047269969 100644
--- a/src/network/network_content.cpp
+++ b/src/network/network_content.cpp
@@ -404,6 +404,8 @@ static bool GunzipFile(const ContentInfo *ci)
#if defined(WITH_ZLIB)
bool ret = true;
FILE *ftmp = fopen(GetFullFilename(ci, true), "rb");
+ if (ftmp == NULL) return false;
+
gzFile fin = gzdopen(fileno(ftmp), "rb");
FILE *fout = fopen(GetFullFilename(ci, false), "wb");