(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.
This commit is contained in:
Ron Koenderink 2006-01-29 13:56:35 +00:00
parent b659a16f03
commit c686c5648b

View file

@ -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);