You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since the fields in the struct body are all declared as pub, and the get_loaded_* functions are also declared as pub, and these functions call from_raw_parts without any checks, there may be a potential UB risk. Although resource is a private mod, I would suggest that it might be better to mark these functions as unsafe. This is just a little concern of mine, if you can make sure that UB doesn't happen here, please don't mind my concern.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello, thank you for your contribution in thin work. I'm scanning rust project for unsound problems, I notice the following code.
Since the fields in the struct body are all declared as pub, and the get_loaded_* functions are also declared as pub, and these functions call from_raw_parts without any checks, there may be a potential UB risk. Although resource is a private mod, I would suggest that it might be better to mark these functions as unsafe. This is just a little concern of mine, if you can make sure that UB doesn't happen here, please don't mind my concern.
Beta Was this translation helpful? Give feedback.
All reactions