Expand before multiply (CID-1355683 and CID-1355684)
Cast the value before multiplication to prevent overflow. Change-Id: I673e9e3e869e326ba3d23c3a2100e274e9dc7566 Reviewed-on: https://code.wireshark.org/review/14823 Reviewed-by: Anders Broman <a.broman58@gmail.com> Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
This commit is contained in:
parent
0c1e88aeea
commit
1f90eab9c5
|
@ -111,8 +111,8 @@ static guint32 aeron_pos_delta(const aeron_pos_t * pos1, const aeron_pos_t * pos
|
|||
p1 = pos2;
|
||||
p2 = pos1;
|
||||
}
|
||||
p1_val = (guint64) (p1->term_id * term_size) + ((guint64) p1->term_offset);
|
||||
p2_val = (guint64) (p2->term_id * term_size) + ((guint64) p2->term_offset);
|
||||
p1_val = ((guint64) p1->term_id * term_size) + ((guint64) p1->term_offset);
|
||||
p2_val = ((guint64) p2->term_id * term_size) + ((guint64) p2->term_offset);
|
||||
delta = p1_val - p2_val;
|
||||
return ((guint32) (delta & G_GUINT64_CONSTANT(0x00000000ffffffff)));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue