aquavm icon indicating copy to clipboard operation
aquavm copied to clipboard

Checked arithmetics for TracePos

Open monoid opened this issue 3 years ago • 1 comments

TracePos values can be controlled by an attacker, and it worth checking that values do not overflow, returning a error instead.

monoid avatar Jun 09 '22 16:06 monoid

Some care should be taking in implementing it.

panicing on overflow is bad idea as will make Marine to create a new instance that is slower than re-using an existing one (but, perhaps, is not slow enough for (D)DoS attack).

Replacing + with .checked_add(...) and returning Err can be cumbersome...

monoid avatar Apr 24 '23 10:04 monoid