linux-msm / qdl

BSD 3-Clause "New" or "Revised" License
196 stars 76 forks source link

firehose: fix >4GB lseek file offsets #21

Closed flto closed 3 years ago

flto commented 3 years ago

The byte offset value for lseek can easily exceed 4GB, cast as off_t to avoid overflow when converting sectors to bytes for lseek.

(and use lseek64/off64_t so this fixes 32-bit builds of qdl too)

flto commented 3 years ago

Changed to use _FILE_OFFSET_BITS.

4GB is correct for 64-bit builds, the cast from unsigned to off_t lets it work up to 4GB