From c035a9531bc90368f35eba671c463956c7886075 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sat, 23 Nov 2013 18:08:15 +0000 Subject: (svn r26067) -Fix: possible NULL dereference when getting NewGRF version --- src/newgrf.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 36cdadf68..9725d9513 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -6578,7 +6578,7 @@ static void ParamSet(ByteReader *buf) /* Disable the read GRF if it is a static NewGRF. */ DisableStaticNewGRFInfluencingNonStaticNewGRFs(c); src1 = 0; - } else if (file == NULL || (c != NULL && c->status == GCS_DISABLED)) { + } else if (file == NULL || c == NULL || c->status == GCS_DISABLED) { src1 = 0; } else if (src1 == 0xFE) { src1 = c->version; -- cgit v1.2.3-54-g00ecf