From c686c5648b245437859423fde741609f2851f59c Mon Sep 17 00:00:00 2001 From: Ron Koenderink Date: Sun, 29 Jan 2006 13:56:35 +0000 Subject: [PATCH] (ac_dog): Do not use 'ap' as a pointer to get the owner for the call to ac_planedamage() use att_own instead. 'ap' may have been already freed in the previous call to ac_planedamage(). This can create an invalid news item and crash the server. --- src/lib/subs/aircombat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/subs/aircombat.c b/src/lib/subs/aircombat.c index 3714705c..952c6ff3 100644 --- a/src/lib/subs/aircombat.c +++ b/src/lib/subs/aircombat.c @@ -668,9 +668,9 @@ ac_dog(struct plist *ap, struct plist *dp) PR(att_own, "%3d/%-3d", adam, ddam); PR(def_own, "%3d/%-3d", ddam, adam); - ac_planedamage(ap, dp->plane.pln_own, adam, def_own, 1, 0, mesg); + ac_planedamage(ap, def_own, adam, def_own, 1, 0, mesg); strncpy(temp, mesg, 14); - ac_planedamage(dp, ap->plane.pln_own, ddam, att_own, 1, 0, mesg); + ac_planedamage(dp, att_own, ddam, att_own, 1, 0, mesg); PR(att_own, "%-13.13s %-13.13s\n", temp, mesg); PR(def_own, "%-13.13s %-13.13s\n", mesg, temp);