md4c icon indicating copy to clipboard operation
md4c copied to clipboard

fix OFF_MAX redefinition and a potential overflow

Open acmepjz opened this issue 8 months ago • 0 comments

This addresses first two points of issue #281.

  • Since OFF_MAX is not used in the code at all, I just remove it.
  • SZ_MAX is used only at one place in the code, and 1024 * 1024 is always smaller than it, so it seems redundant.
  • 16 * size could overflow, which makes the MIN returns 0 which is unwanted. I've changed the code such that if that happens, it also returns 1024 * 1024.

acmepjz avatar Jun 11 '25 01:06 acmepjz