The following commit has been merged in the master branch:
commit a4adf4de3ecb47539d9f826280fefc944f3f5e9f
Author: Simon McVittie <[email protected]>
Date:   Tue Oct 12 00:00:23 2010 +0100

    Fix an unlikely crash if a non-client object is damaged by a non-player 
source

diff --git a/debian/changelog b/debian/changelog
index f0e3bd8..b2fe1a9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,8 @@ openarena (0.8.5-5) UNRELEASED; urgency=low
   * Set up debian/rules so DEB_BUILD_OPTIONS="noopt" does a debug build
   * Install example scripts to debug OpenArena with gdb, as
     /usr/share/games/openarena/openarena{,-server}-gdb
+  * Fix an unlikely crash if a non-client object is damaged by a non-player
+    source
 
  -- Simon McVittie <[email protected]>  Mon, 11 Oct 2010 19:40:30 +0100
 
diff --git 
a/debian/patches/0042-G_Damage-check-before-dereferencing-targ-client-whic.patch
 
b/debian/patches/0042-G_Damage-check-before-dereferencing-targ-client-whic.patch
new file mode 100644
index 0000000..2fdaf83
--- /dev/null
+++ 
b/debian/patches/0042-G_Damage-check-before-dereferencing-targ-client-whic.patch
@@ -0,0 +1,25 @@
+From 80f2967f82314bf10e975d1b00678b9b4327eae9 Mon Sep 17 00:00:00 2001
+From: Simon McVittie <[email protected]>
+Date: Mon, 11 Oct 2010 23:28:51 +0100
+Subject: [PATCH] G_Damage: check before dereferencing targ->client, which may 
be NULL
+
+---
+ game/code/game/g_combat.c |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/game/code/game/g_combat.c b/game/code/game/g_combat.c
+index 22ce65a..7d1fba7 100644
+--- a/game/code/game/g_combat.c
++++ b/game/code/game/g_combat.c
+@@ -1043,7 +1043,7 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, 
gentity_t *attacker,
+         
+         //Sago: See if the client was sent flying
+         //Check if damage is by somebody who is not a player!
+-        if( (!attacker || attacker->s.eType != ET_PLAYER) && 
client->lastSentFlying>-1 && ( mod==MOD_FALLING || mod==MOD_LAVA || 
mod==MOD_SLIME || mod==MOD_TRIGGER_HURT || mod==MOD_SUICIDE) )  {
++        if( (!attacker || attacker->s.eType != ET_PLAYER) && client && 
client->lastSentFlying>-1 && ( mod==MOD_FALLING || mod==MOD_LAVA || 
mod==MOD_SLIME || mod==MOD_TRIGGER_HURT || mod==MOD_SUICIDE) )  {
+             if( client->lastSentFlyingTime+5000<level.time) {
+                 client->lastSentFlying = -1; //More than 5 seconds, not a 
kill!
+             } else {
+-- 
+1.7.1
+
diff --git a/debian/patches/series b/debian/patches/series
index 485ad3a..9a9f298 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -33,3 +33,4 @@
 0039-Used-self-enemy-before-it-was-initialized.-Might-hav.patch
 0040-Add-OPENARENA_081_COMPATIBLE-define-for-network-comp.patch
 0041-If-a-QVM-starts-with-NTVE-followed-by-a-nonempty-str.patch
+0042-G_Damage-check-before-dereferencing-targ-client-whic.patch

-- 
Packaging for the OpenArena engine

_______________________________________________
Pkg-games-commits mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/pkg-games-commits

Reply via email to