From 714a4f6ac6032aec281fe9b59e39e2aebe37cecd Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Wed, 27 Jan 2021 22:06:43 +0700 Subject: [PATCH] sanity null check on localTime --- src/wolfsftp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/wolfsftp.c b/src/wolfsftp.c index 66b166e..f7ccbb2 100644 --- a/src/wolfsftp.c +++ b/src/wolfsftp.c @@ -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;