nxp-imx / mfgtools

Freescale/NXP I.MX Chip image deploy tools.
BSD 3-Clause "New" or "Revised" License
523 stars 293 forks source link

fix: integer overflow causing segmentation fault #400

Closed oddlama closed 6 months ago

oddlama commented 7 months ago

This fixes a segmentation fault when trying to flash images from any armv7 host. uuu compares a size_t to UINT64_MAX which is obviously never true on 32-bit architectures. When calling the faulty with UNIT64_MAX, the size_t overflows. This PR fixes this by comparing to correct variable SIZE_MAX instead.

oddlama commented 7 months ago

Oh and without further inspection this sounds like it could have been the culprit in #375 .