smart subtransport: don't free the url when resetting the stream#4911
Closed
carlosmn wants to merge 1 commit into
Closed
smart subtransport: don't free the url when resetting the stream#4911carlosmn wants to merge 1 commit into
carlosmn wants to merge 1 commit into
Conversation
We reset the stream in the RPC (HTTP) case constantly and then pass the url field to the action method for the transport to perform their action. A transport would thus get `NULL` for the url and if it does use it, it might crash or at least return an error making it impossible for it to work. The transports that come with libgit2 keep their own copy of the url and thus this issue was not noticed.
Contributor
|
Oh awesome, thanks for the fix! |
Member
|
Didn't #4880 fix this? We just need to backport that fix, no? |
Member
Author
|
Oh, I missed that. That would solve it yes, though the only times when we pass It seems more confusing to do it that way than leave the freeing to the caller. |
Member
|
I don't know that I agree, the goal of the reset function is to give us the original state back. In any case, I think we'd need to do this free in the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We reset the stream in the RPC (HTTP) case constantly and then pass the url
field to the action method for the transport to perform their action.
A transport would thus get
NULLfor the url and if it does use it, it mightcrash or at least return an error making it impossible for it to work.
The transports that come with libgit2 keep their own copy of the url and thus
this issue was not noticed.
This should resolve the issue that cargo is experiencing with the changes in #4732 while still plugging the leak by freeing the URL before we set it anew when connecting.
/cc @grahamc @alexcrichton rust-lang/cargo#6365