diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2020-06-19 00:37:57 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2020-06-19 00:37:57 +0200 |
commit | 9e327e44db5bc5aff1e3cba9e443e666e9f712df (patch) | |
tree | 2941f7353d8c621385025c5b39fe7ed80d55bf37 | |
parent | 9f743e36909ba5509edaacd3f0e0edee625a72f5 (diff) |
fixed crash on musl
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
-rw-r--r-- | protocol.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -504,7 +504,11 @@ static int create_timestamp(struct tm * const timestamp, *usec = ts_val.tv_usec; ts = time(NULL); gmtime_r(&ts, timestamp); - return strftime(timestamp_str, PROTOCOL_TIME_STRLEN, "%a, %d %b %Y %T %z", timestamp); + + if (timestamp_str) { + return strftime(timestamp_str, PROTOCOL_TIME_STRLEN, "%a, %d %b %Y %T %z", timestamp); + } + return 0; } void protocol_response_ping(unsigned char out[CRYPT_PACKET_SIZE_PING], struct connection * const state) |