RTEMS | cpukit/libmisc/shell:fix command df overflow (!210)

Christian Mauderer (@c-mauderer) gitlab at rtems.org
Fri Sep 13 08:52:04 UTC 2024




Christian Mauderer commented on a discussion on cpukit/libmisc/shell/main_df.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/210#note_112044

 >  
 >    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];

OK. If it avoids a warning, that's fine. I don't think that the 3*4 additional bytes will be a problem in any application. I more or less just wondered why you selected 20 and therefore started to think about it. For the 2^64, 22 chars would have been necessary (20 for the number, one suffix and one `\0`. But I'm fine with your explanation.

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/210#note_112044
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/14ef7307/attachment.htm>


More information about the bugs mailing list