[ufoai] 01/02: Add segfault-reactionfire-mode-bug-861979.patch and fix the segmentation fault

Markus Koschany apo-guest at moszumanska.debian.org
Sun May 7 17:34:32 UTC 2017


This is an automated email from the git hooks/post-receive script.

apo-guest pushed a commit to branch master
in repository ufoai.

commit c0b6bae41fd9cb9aeb2a8b749f3f191d2a578776
Author: Markus Koschany <apo at debian.org>
Date:   Sun May 7 18:48:45 2017 +0200

    Add segfault-reactionfire-mode-bug-861979.patch and fix the segmentation fault
    
    on determining reactionfire mode when soldier has no weapon.
    
    Closes: #861979
    Thanks: Robert Hackbauer for the report.
---
 .../segfault-reactionfire-mode-bug-861979.patch    | 36 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 2 files changed, 37 insertions(+)

diff --git a/debian/patches/segfault-reactionfire-mode-bug-861979.patch b/debian/patches/segfault-reactionfire-mode-bug-861979.patch
new file mode 100644
index 0000000..d8575fe
--- /dev/null
+++ b/debian/patches/segfault-reactionfire-mode-bug-861979.patch
@@ -0,0 +1,36 @@
+From: Markus Koschany <apo at debian.org>
+Date: Sun, 7 May 2017 18:46:50 +0200
+Subject: segfault reactionfire mode bug 861979
+
+Forwarded: http://ufoai.org/forum/index.php/topic,9111.0.html
+Origin: https://sourceforge.net/p/ufoai/code/ci/9cad041f0931b1f49e0c70f32e351a7227f0d2ff/
+---
+ src/game/inv_shared.cpp | 7 ++-----
+ 1 file changed, 2 insertions(+), 5 deletions(-)
+
+diff --git a/src/game/inv_shared.cpp b/src/game/inv_shared.cpp
+index 708e708..e5a73a5 100644
+--- a/src/game/inv_shared.cpp
++++ b/src/game/inv_shared.cpp
+@@ -633,9 +633,6 @@ const fireDef_t* Item::getSlowestFireDef () const
+  */
+ const objDef_t* Item::getReactionFireWeaponType () const
+ {
+-	if (!this)
+-		return nullptr;
+-
+ 	if (def()) {
+ 		const fireDef_t* fd = getFiredefs();
+ 		if (fd && fd->reaction)
+@@ -999,9 +996,9 @@ Item* Inventory::findInContainer (const containerIndex_t contId, const Item* con
+  */
+ bool Inventory::holdsReactionFireWeapon () const
+ {
+-	if (getRightHandContainer()->getReactionFireWeaponType())
++	if (getRightHandContainer() != nullptr && getRightHandContainer()->getReactionFireWeaponType())
+ 		return true;
+-	if (getLeftHandContainer()->getReactionFireWeaponType())
++	if (getLeftHandContainer() != nullptr && getLeftHandContainer()->getReactionFireWeaponType())
+ 		return true;
+ 	return false;
+ }
diff --git a/debian/patches/series b/debian/patches/series
index e8dafba..4e55024 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 initialize-entityString.patch
+segfault-reactionfire-mode-bug-861979.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/ufoai.git



More information about the Pkg-games-commits mailing list