RTEMS | dosfs: Avoid NULL pointer dereference UB (!1348)

Yang Zhang (@Chloe) gitlab at rtems.org
Thu Jul 16 01:50:52 UTC 2026



Yang Zhang created a merge request: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1348

Project:Branches: Chloe/rtems:fix-dosfs-null-deref to rtems/rtos/rtems:main
Author:   Yang Zhang



## Summary

When creating utf8 or default converters, if memory allocation or initialization fails, 'self' becomes NULL. Returning '&self-\>super' results in a NULL pointer dereference, which is Undefined Behavior in C. This updates the code to explicitly check for NULL before returning.

## Generative AI

None

<!--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/1348
You're receiving this email because of your account on gitlab.rtems.org. Unsubscribe from this thread: https://gitlab.rtems.org/-/sent_notifications/4-84d79kkly9p4wsefitah3nkvn-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/20260716/e4af523d/attachment-0001.htm>


More information about the bugs mailing list