RTEMS | Fix off-by-one error in nvdisk/flashdisk device naming (!911)

Bhuvan B (@BhuvanB404) gitlab at rtems.org
Thu Jan 15 14:50:20 UTC 2026



Bhuvan B created a merge request: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/911

Project:Branches: BhuvanB404/rtems:fix/nvdisk-flashdisk-device-naming to rtems/rtos/rtems:main
Author:   Bhuvan B




## Summary

Fix off-by-one error in nvdisk/flashdisk device naming For example, with RTEMS_NVDISK_DEVICE_BASE_NAME = /dev/nvd:

name\[ sizeof( RTEMS_NVDISK_DEVICE_BASE_NAME ) \] 

name\[9\] is '\\0' which is being indexed currently.

 name\[8\] is the correct index to be modified.

Use sizeof(RTEMS_NVDISK_DEVICE_BASE_NAME) - 1 to correctly index the last character of the device name instead of the null terminator.

Closes #5402

Signed-off-by: BhuvanB404 bhuvanb1408 at gmail.com

<!--Default settings, if it is a dropdown it will set after submission-->

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/911
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/20260115/4eb4d9d2/attachment-0001.htm>


More information about the bugs mailing list