Merge pull request #314 from JacobBarthelmeh/static_analysis

sanity null check on localTime
pull/315/head
John Safranek 2021-01-27 08:39:21 -08:00 committed by GitHub
commit 322d7cd6f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -2305,6 +2305,9 @@ static int SFTP_CreateLongName(WS_SFTPNAME* name)
/* get date as calendar date */
localTime = XGMTIME((const time_t*)&atr->mtime, &localTime);
if (localTime == NULL) {
return WS_MEMORY_E;
}
getDate(date, sizeof(date), localTime);
totalSz += WS_DATE_SIZE;