From 103812fae8eeb3a4941cead08c4a7fab80971b30 Mon Sep 17 00:00:00 2001 From: Greg Alexander Date: Sat, 18 Jun 2016 15:37:47 -0400 Subject: [PATCH] don't pass localtime() a pointer into struct timespec (within struct stat), because there is no guarantee that its tv_sec will be of type time_t --- openssh/sftp-common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openssh/sftp-common.c b/openssh/sftp-common.c index 7763fe3..be2a491 100644 --- a/openssh/sftp-common.c +++ b/openssh/sftp-common.c @@ -189,7 +189,8 @@ char * ls_file(const char *name, const struct stat *st, int remote, int si_units) { int ulen, glen, sz = 0; - struct tm *ltime = localtime(&st->st_mtime); + time_t st_time = st->st_mtime; + struct tm *ltime = localtime(&st_time); char *user, *group; char buf[1024], mode[11+1], tbuf[12+1], ubuf[11+1], gbuf[11+1]; char sbuf[FMT_SCALED_STRSIZE];