(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:
parent
b659a16f03
commit
c686c5648b
1 changed files with 2 additions and 2 deletions
|
@ -668,9 +668,9 @@ ac_dog(struct plist *ap, struct plist *dp)
|
||||||
|
|
||||||
PR(att_own, "%3d/%-3d", adam, ddam);
|
PR(att_own, "%3d/%-3d", adam, ddam);
|
||||||
PR(def_own, "%3d/%-3d", ddam, adam);
|
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);
|
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(att_own, "%-13.13s %-13.13s\n", temp, mesg);
|
||||||
PR(def_own, "%-13.13s %-13.13s\n", mesg, temp);
|
PR(def_own, "%-13.13s %-13.13s\n", mesg, temp);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue