Repository navigation
Conversation
"`session->userauth_pblc_method` is allocated in the ecdsa/ed25519 branches (lines 2393–2416), but then `userauth_read_blob_pubkey` is called immediately afterward with `&session->userauth_pblc_method` as an output parameter. Inside `userauth_read_blob_pubkey`, `*method` is unconditionally overwritten with a newly allocated buffer (see the `*method = pubkey` assignment), causing the allocation made just above to be leaked. The allocation in the ecdsa/ed25519 branches should be removed since `userauth_read_blob_pubkey` will derive and allocate the method from the public key data itself."
"`session->userauth_pblc_method` is allocated in the ecdsa/ed25519 branches (lines 2393–2416), but then `userauth_read_blob_pubkey` is called immediately afterward with `&session->userauth_pblc_method` as an output parameter. Inside `userauth_read_blob_pubkey`, `*method` is unconditionally overwritten with a newly allocated buffer (see the `*method = pubkey` assignment), causing the allocation made just above to be leaked. The allocation in the ecdsa/ed25519 branches should be removed since `userauth_read_blob_pubkey` will derive and allocate the method from the public key data itself." Follow-up to bc4e619 libssh2#752 Follow-up to ed439a2 libssh2#698
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.
This code section was merged as part of PR #752, which seems to me
unrelated to the intent of the patch, and also possibly unrelated to
the description of its subcommit:
"Add support for certificate signing with ssh-agent"
55abcb0#diff-8213ab9c800f30c1a7aff37863954e756f946a3b3f6bd7be376d634fd9beb9f4R2369
"
session->userauth_pblc_methodis allocated in the ecdsa/ed25519branches (lines 2393–2416), but then
userauth_read_blob_pubkeyiscalled immediately afterward with
&session->userauth_pblc_methodas anoutput parameter. Inside
userauth_read_blob_pubkey,*methodisunconditionally overwritten with a newly allocated buffer (see the
*method = pubkeyassignment), causing the allocation made just aboveto be leaked. The allocation in the ecdsa/ed25519 branches should be
removed since
userauth_read_blob_pubkeywill derive and allocate themethod from the public key data itself."
Reported by GitHub Code Quality
Follow-up to bc4e619 #752
Follow-up to ed439a2 #698
/cc @MichaelBuckley