FreeBSD Bugzilla – Attachment 152952 Details for
Bug 197604
games/cube: crashes when built with clang 3.6 + -O1 or higher
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix invalid dereferencing of null reference
games__cube-fix-invalid-null-dereference-1.diff (text/plain), 4.93 KB, created by
Dimitry Andric
on 2015-02-14 00:49:00 UTC
(
hide
)
Description:
Fix invalid dereferencing of null reference
Filename:
MIME Type:
Creator:
Dimitry Andric
Created:
2015-02-14 00:49:00 UTC
Size:
4.93 KB
patch
obsolete
>Index: games/cube/files/patch-entities.cpp >=================================================================== >--- games/cube/files/patch-entities.cpp (revision 0) >+++ games/cube/files/patch-entities.cpp (working copy) >@@ -0,0 +1,15 @@ >+--- entities.cpp.orig 2015-02-14 01:42:48.128349000 +0100 >++++ entities.cpp 2015-02-14 01:44:19.309526000 +0100 >+@@ -25,9 +25,9 @@ >+ entity &e = ents[i]; >+ if(e.type==MAPMODEL) >+ { >+- mapmodelinfo &mmi = getmminfo(e.attr2); >+- if(!&mmi) continue; >+- rendermodel(mmi.name, 0, 1, e.attr4, (float)mmi.rad, e.x, (float)S(e.x, e.y)->floor+mmi.zoff+e.attr3, e.y, (float)((e.attr1+7)-(e.attr1+7)%15), 0, false, 1.0f, 10.0f, mmi.snap); >++ mapmodelinfo *mmi = getmminfo(e.attr2); >++ if(!mmi) continue; >++ rendermodel(mmi->name, 0, 1, e.attr4, (float)mmi->rad, e.x, (float)S(e.x, e.y)->floor+mmi->zoff+e.attr3, e.y, (float)((e.attr1+7)-(e.attr1+7)%15), 0, false, 1.0f, 10.0f, mmi->snap); >+ } >+ else >+ { > >Property changes on: games/cube/files/patch-entities.cpp >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: games/cube/files/patch-physics.cpp >=================================================================== >--- games/cube/files/patch-physics.cpp (revision 0) >+++ games/cube/files/patch-physics.cpp (working copy) >@@ -0,0 +1,22 @@ >+--- physics.cpp.orig 2015-02-14 01:31:41.351723000 +0100 >++++ physics.cpp 2015-02-14 01:40:28.770647000 +0100 >+@@ -46,14 +46,14 @@ >+ { >+ entity &e = ents[i]; >+ if(e.type!=MAPMODEL) continue; >+- mapmodelinfo &mmi = getmminfo(e.attr2); >+- if(!&mmi || !mmi.h) continue; >+- const float r = mmi.rad+d->radius; >++ mapmodelinfo *mmi = getmminfo(e.attr2); >++ if(!mmi || !mmi->h) continue; >++ const float r = mmi->rad+d->radius; >+ if(fabs(e.x-d->o.x)<r && fabs(e.y-d->o.y)<r) >+ { >+- float mmz = (float)(S(e.x, e.y)->floor+mmi.zoff+e.attr3); >++ float mmz = (float)(S(e.x, e.y)->floor+mmi->zoff+e.attr3); >+ if(d->o.z-d->eyeheight<mmz) { if(mmz<hi) hi = mmz; } >+- else if(mmz+mmi.h>lo) lo = mmz+mmi.h; >++ else if(mmz+mmi->h>lo) lo = mmz+mmi->h; >+ }; >+ }; >+ }; > >Property changes on: games/cube/files/patch-physics.cpp >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: games/cube/files/patch-protos.h >=================================================================== >--- games/cube/files/patch-protos.h (revision 0) >+++ games/cube/files/patch-protos.h (working copy) >@@ -0,0 +1,11 @@ >+--- protos.h.orig 2015-02-14 01:31:41.352230000 +0100 >++++ protos.h 2015-02-14 01:39:01.934630000 +0100 >+@@ -192,7 +192,7 @@ >+ >+ // rendermd2 >+ extern void rendermodel(char *mdl, int frame, int range, int tex, float rad, float x, float y, float z, float yaw, float pitch, bool teammate, float scale, float speed, int snap = 0, int basetime = 0); >+-extern mapmodelinfo &getmminfo(int i); >++extern mapmodelinfo *getmminfo(int i); >+ >+ // server >+ extern void initserver(bool dedicated, int uprate, char *sdesc, char *ip, char *master, char *passwd, int maxcl); > >Property changes on: games/cube/files/patch-protos.h >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: games/cube/files/patch-rendermd2.cpp >=================================================================== >--- games/cube/files/patch-rendermd2.cpp (revision 0) >+++ games/cube/files/patch-rendermd2.cpp (working copy) >@@ -0,0 +1,11 @@ >+--- 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); > >Property changes on: games/cube/files/patch-rendermd2.cpp >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 197604
: 152952