summaryrefslogtreecommitdiff
path: root/src/libimcv/ietf/ietf_attr_op_status.c
diff options
context:
space:
mode:
authorYves-Alexis Perez <corsac@corsac.net>2017-05-30 20:59:31 +0200
committerYves-Alexis Perez <corsac@corsac.net>2017-05-30 20:59:31 +0200
commitbba25e2ff6c4a193acb54560ea4417537bd2954e (patch)
tree9e074fe343f9ab6f5ce1e9c5142d9a6cf180fcda /src/libimcv/ietf/ietf_attr_op_status.c
parent05ddd767992d68bb38c7f16ece142e8c2e9ae016 (diff)
downloadvyos-strongswan-bba25e2ff6c4a193acb54560ea4417537bd2954e.tar.gz
vyos-strongswan-bba25e2ff6c4a193acb54560ea4417537bd2954e.zip
New upstream version 5.5.3
Diffstat (limited to 'src/libimcv/ietf/ietf_attr_op_status.c')
-rw-r--r--src/libimcv/ietf/ietf_attr_op_status.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libimcv/ietf/ietf_attr_op_status.c b/src/libimcv/ietf/ietf_attr_op_status.c
index f04c89b96..1f813b3c6 100644
--- a/src/libimcv/ietf/ietf_attr_op_status.c
+++ b/src/libimcv/ietf/ietf_attr_op_status.c
@@ -170,6 +170,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
chunk_t last_use;
uint16_t reserved;
struct tm t;
+ char buf[BUF_LEN];
*offset = 0;
@@ -208,7 +209,8 @@ METHOD(pa_tnc_attr_t, process, status_t,
*offset = 4;
/* Conversion from RFC 3339 ASCII string to time_t */
- if (sscanf(last_use.ptr, "%4d-%2d-%2dT%2d:%2d:%2dZ", &t.tm_year, &t.tm_mon,
+ snprintf(buf, sizeof(buf), "%.*s", (int)last_use.len, last_use.ptr);
+ if (sscanf(buf, "%4d-%2d-%2dT%2d:%2d:%2dZ", &t.tm_year, &t.tm_mon,
&t.tm_mday, &t.tm_hour, &t.tm_min, &t.tm_sec) != 6)
{
DBG1(DBG_TNC, "invalid last_use time format in IETF operational status");