flag.h icon indicating copy to clipboard operation
flag.h copied to clipboard

Fix size multiplication overflow

Open ferivoz opened this issue 3 months ago • 0 comments

If calculation of size based on its suffix overflows, then treat it as integer overflow. Otherwise, a wrong value is returned.

Keep suffixes for backwards compatibility, i.e. report an integer overflow, not an invalid suffix.

You can see the overflow in effect with compiled example, e.g. ./example -size 1Y which cannot fit in an unsigned long long, i.e. within 64 bit.

ferivoz avatar Sep 29 '25 11:09 ferivoz