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
My understanding is that unsafe should be used to mark code that requires that rustc disable some of its memory safety checks. But I don't see how passing an invalid XID to XidNew::new() can ever cause memory safety issues. The worst that can happen is that the X server will reply to a request with an error (like BadWindow), which the application will be forced to handle. This doesn't seem meaningfully different to me than having a valid XID, acquired from Connection::generate_id(), that later becomes invalid due to some code destroying the resource (or even the X server doing so, out of your application's control), and then attempting to use it. Either way, there do not seem to be any safety issues.
Am I missing something here?
(I also just noticed #167, and I think the same question applies to that. Passing an invalid or otherwise inappropriate file descriptor obviously will not work very well, but should not cause memory safety issues. If it does, then the underlying code itself has safety issues that should be worked out.)
The text was updated successfully, but these errors were encountered:
My understanding is that
unsafe
should be used to mark code that requires that rustc disable some of its memory safety checks. But I don't see how passing an invalid XID toXidNew::new()
can ever cause memory safety issues. The worst that can happen is that the X server will reply to a request with an error (likeBadWindow
), which the application will be forced to handle. This doesn't seem meaningfully different to me than having a valid XID, acquired fromConnection::generate_id()
, that later becomes invalid due to some code destroying the resource (or even the X server doing so, out of your application's control), and then attempting to use it. Either way, there do not seem to be any safety issues.Am I missing something here?
(I also just noticed #167, and I think the same question applies to that. Passing an invalid or otherwise inappropriate file descriptor obviously will not work very well, but should not cause memory safety issues. If it does, then the underlying code itself has safety issues that should be worked out.)
The text was updated successfully, but these errors were encountered: