diff options
author | rubidium <rubidium@openttd.org> | 2013-11-22 21:41:49 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2013-11-22 21:41:49 +0000 |
commit | ed4e14dc205bead9b4b9c2666397eb8f9c599dd9 (patch) | |
tree | 5ed1699e1194086d705e1cc634b35fa6c5486152 /src/network | |
parent | fad4fa09ba173a6be76954acdbdb158a6232d0b0 (diff) | |
download | openttd-ed4e14dc205bead9b4b9c2666397eb8f9c599dd9.tar.xz |
(svn r26047) -Fix: possible, but very unlikely, null pointer dereference when gunziping just downloaded files
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/network_content.cpp | 2 |
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"); |