-
Notifications
You must be signed in to change notification settings - Fork 107
tidy clang-tidy #1002
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
Open
ejohnstown
wants to merge
6
commits into
wolfSSL:master
Choose a base branch
from
ejohnstown:tidy-tidy
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
tidy clang-tidy #1002
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7ea43b9
Add parameter names to function declarations
ejohnstown 5084489
Remove redundant preprocessor guard
ejohnstown 457cf7c
Move unsafe call out of signal handler
ejohnstown d170a02
Use reentrant time conversion in SFTP
ejohnstown d0639c7
Tighten SCP timestamp bounds check
ejohnstown 921b7ea
Bound sshd Include directive recursion
ejohnstown 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
Some comments aren't visible on the classic Files Changed page.
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2721,7 +2721,7 @@ int wolfSSH_SFTP_RecvOpenDir(WOLFSSH* ssh, int reqId, byte* data, word32 maxSz) | |
|
|
||
| #define WS_DATE_SIZE 12 | ||
|
|
||
| #if defined(XGMTIME) && defined(XSNPRINTF) | ||
| #if defined(XSNPRINTF) | ||
| /* converts epoch time to recommended calendar time from | ||
| * draft-ietf-secsh-filexfer-02.txt */ | ||
| static void getDate(char* buf, int len, struct tm* t) | ||
|
|
@@ -2762,12 +2762,13 @@ static void getDate(char* buf, int len, struct tm* t) | |
| * return WS_SUCCESS on success */ | ||
| static int SFTP_CreateLongName(WS_SFTPNAME* name) | ||
| { | ||
| #if defined(XGMTIME) && defined(XSNPRINTF) | ||
| #if defined(XSNPRINTF) | ||
| char sizeStr[32]; | ||
| char perm[11]; | ||
| int linkCount = 1; /* @TODO set to correct value */ | ||
| char date[WS_DATE_SIZE + 1]; /* +1 for null terminator */ | ||
| struct tm* localTime = NULL; | ||
| struct tm localTime; | ||
| time_t mtime; | ||
| int i; | ||
| WS_SFTP_FILEATRB* atr; | ||
| #endif | ||
|
|
@@ -2777,15 +2778,17 @@ static int SFTP_CreateLongName(WS_SFTPNAME* name) | |
| return WS_BAD_ARGUMENT; | ||
| } | ||
|
|
||
| #if defined(XGMTIME) && defined(XSNPRINTF) | ||
| #if defined(XSNPRINTF) | ||
| atr = &name->atrb; | ||
|
|
||
| /* get date as calendar date */ | ||
| localTime = XGMTIME((const time_t*)&atr->mtime, &localTime); | ||
| if (localTime == NULL) { | ||
| /* get date as calendar date; use the reentrant WLOCALTIME | ||
| * wrapper so the shared static buffer behind gmtime() is | ||
| * not used. */ | ||
|
ejohnstown marked this conversation as resolved.
|
||
| mtime = (time_t)atr->mtime; | ||
| if (!WLOCALTIME(&mtime, &localTime)) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This switches from UTC time to local time in all platforms except Zephyr which uses |
||
| return WS_MEMORY_E; | ||
| } | ||
| getDate(date, sizeof(date), localTime); | ||
| getDate(date, sizeof(date), &localTime); | ||
| totalSz += WS_DATE_SIZE; | ||
|
|
||
| /* set permissions */ | ||
|
|
@@ -2838,7 +2841,7 @@ static int SFTP_CreateLongName(WS_SFTPNAME* name) | |
| name->lSz = totalSz; | ||
| name->lName[totalSz] = '\0'; | ||
|
|
||
| #if defined(XGMTIME) && defined(XSNPRINTF) | ||
| #if defined(XSNPRINTF) | ||
| WSNPRINTF(name->lName, totalSz, "%s %3d %8d %8d %s %s %s", | ||
| perm, linkCount, atr->uid, atr->gid, sizeStr, date, name->fName); | ||
| #else | ||
|
|
||
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.