freebsd-ports/games/cube/files/patch-rendermd2.cpp
Jan Beich 6047e60d75 - Fix invalid dereferencing of null reference which causes startup
crash for cube_client when built with clang 3.6 + -O1 or higher [1]
- Properly track libenet dependency [2]

PR:		197604 [1]
PR:		197605 [2]
Submitted by:	dim [1]
2015-02-20 06:53:37 +00:00

11 lines
451 B
C++

--- rendermd2.cpp.orig 2015-02-14 01:31:41.354388000 +0100
+++ rendermd2.cpp 2015-02-14 01:39:38.592584000 +0100
@@ -234,7 +234,7 @@
void mapmodelreset() { mapmodels.setsize(0); };
-mapmodelinfo &getmminfo(int i) { return i<mapmodels.length() ? mapmodels[i]->mmi : *(mapmodelinfo *)0; };
+mapmodelinfo *getmminfo(int i) { return i<mapmodels.length() ? &mapmodels[i]->mmi : 0; };
COMMAND(mapmodel, ARG_5STR);
COMMAND(mapmodelreset, ARG_NONE);