RTEMS | shell: Check getcwd() return value in pwd command (!1554)

xiaojun zheng (@zhengxiaojun) gitlab at rtems.org
Tue Nov 3 01:30:39 UTC 2026



xiaojun zheng created a merge request: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1554

Project:Branches: zhengxiaojun/rtems:fix_pwd to rtems/rtos/rtems:main
Author: xiaojun zheng

## Summary

shell: Check getcwd() return value in pwd command

Check the return value of getcwd() in rtems_shell_main_pwd(). Print the
current working directory only if getcwd() succeeds. Report an error
message with the errno value otherwise. Avoid printing the uninitialized
buffer content when getcwd() fails.


## Generative AI

<!-- If you have used AI please use the "AI Contribution" template otherwise leave this blank see our fulls statement at https://www.rtems.org/generative-ai/-->


<!-- 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/1554
You're receiving this email because of your account on gitlab.rtems.org. Unsubscribe from this thread: https://gitlab.rtems.org/-/namespace/49/sent_notifications/6-aujpkjum2xnwy6fer17mm7ty5-1d/unsubscribe | Manage all notifications: https://gitlab.rtems.org/-/profile/notifications | Help: https://gitlab.rtems.org/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20261103/193fb2b1/attachment.htm>


More information about the bugs mailing list