-
Notifications
You must be signed in to change notification settings - Fork 677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
recvmsg: incorrect lifetime returned #2083
Comments
Yes, I think your analysis is correct. Would you submit a PR? |
I can but I'm not available to do it this week. I can submit one next week. Please feel free to fix if you require this sooner. |
An updated nix fixes an incorrect lifetime. cc nix-rust/nix#2083
An updated nix fixes an incorrect lifetime. cc nix-rust/nix#2083 Signed-off-by: Colin Walters <walters@verbum.org>
Good catch on this! Looks like one of my projects was affected containers/containers-image-proxy-rs#52 I guess any potentially problematic code will now fail to compile, which is good. I wonder if this could use a bit more visibility though with e.g. a rustsec advisory? |
Using a GH code search I'm seeing a few other repositories likely affected too. |
the current signature of recvmsg is:
note the iov param:
iov: &'outer mut [IoSliceMut<'inner>]
now in the resulting
RecvMsg
we can access the iovs using a method namediovs()
. This method iterates the iov array provided. But the lifetime of the iov array is'outer
and not'inner
.So the signature of the result should be changed to
Result<RecvMsg<'a, 'outer, S>>
.If all sounds correct, i can open a PR to fix this.
example fail scenario with tokio (note the move closure):
The text was updated successfully, but these errors were encountered: