namjaejeon / exfatprogs

exFAT filesystem userspace utilities
https://github.com/exfatprogs/exfatprogs
GNU General Public License v2.0
33 stars 63 forks source link

fix Out-of-Bounds Accesses in function bytes_to_human_readable #58

Closed yijiangqiu1 closed 2 years ago

yijiangqiu1 commented 2 years ago

In function bytes_to_human_readable, if bytes > 1024PB, the variable named i will be 6 and in “snprintf(buf, sizeof(buf), "%u.%02u %s", quoti, remain, units[i]);”, function will access units[6] . This will cause Out-of-Bounds Accesses.

Signed-off-by: yijiangqiu1 wangfangli@xiaomi.com