forked from openssh/openssh-portable
-
Notifications
You must be signed in to change notification settings - Fork 372
Fix SCP stack overflow when copying over directories #565
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
Merged
bagajjal
merged 11 commits into
PowerShell:latestw_all
from
vthiebaut10:scp_copy_more_levels
Feb 18, 2022
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
57ec6ef
avoid local arrays of size PATH_MAX
vthiebaut10 d9149a1
Change xrealloc to xreallocarray
vthiebaut10 346e224
Add #ifdef blocks for my changes
vthiebaut10 2abdca2
Fixed a couple of things
vthiebaut10 bb42857
Address review comments
vthiebaut10 10950f4
Finish addressing review comments
vthiebaut10 ce2594c
Fix regression
vthiebaut10 0830d82
PATH_MAX vs MAX_PATH confusion
vthiebaut10 9949b9b
Fixed a potential memory leak
vthiebaut10 c0f51c8
add comment
vthiebaut10 a4b4ab4
fix a couple of accidental extra lines
vthiebaut10 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on what calculations, you are using 20 here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest, not very precise calculations. Just by experience,
"C%04o %lld", (u_int) (stb.st_mode & FILEMODEMASK), (long long)stb.st_sizeis less than 20 characters on all the tests I ran, I can't know for sure that this is always gonna be the case. I thought about just doing2 * strlen(last), but I think it's more likely to have a filename with a very short name than the rest of the string to be more than 20 characters long.