capnproto / capnproto-java

Cap'n Proto in pure Java
Other
391 stars 86 forks source link

Fix various cases of integer overflow during multiplication #126

Closed mdindoffer closed 2 years ago

mdindoffer commented 2 years ago

As the title says. Multiplying two ints before widening to long can lead to overflow. The widening needs to be explicitly done before the multiplication.

See individual commits and messages for details. Some unit tests present for illustration.

dwrensha commented 2 years ago

Thanks!