RTEMS | cpukit/libmisc/shell:fix command df overflow (!210)
xiaojun zheng (@zhengxiaojun)
gitlab at rtems.org
Fri Sep 13 08:48:28 UTC 2024
xiaojun zheng commented on a discussion on cpukit/libmisc/shell/main_df.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/210#note_112043
>
> struct statvfs svfs;
> int code;
> - char f_buf[16], u_buf[16], a_buf[16];
> + char f_buf[20], u_buf[20], a_buf[20];
I think gcc considers `block_size` to be a 64-bit number, and be written to a buffer, the buffer size is less than the biggest length, so gcc throw out a warnning. Since the maximum number after the conversion is less than `16777216T`, I think `block_size` can be force to uint32_t when write to buffer, and increase buffer size is not necessary.
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/210#note_112043
You're receiving this email because of your account on gitlab.rtems.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20240913/7efb1ef0/attachment-0001.htm>
More information about the bugs
mailing list