diff options
author | Underground78 <underground78@users.sourceforge.net> | 2016-01-09 13:48:31 +0300 |
---|---|---|
committer | Underground78 <underground78@users.sourceforge.net> | 2016-01-14 23:53:51 +0300 |
commit | 0ef1371b9d736a034e95270966c6c72c1581ad72 (patch) | |
tree | ae88c5c8b6a05abeaec8123b240157df86dcbf96 | |
parent | 04f2e5d36b89cdbaf13103f60d2819e707516be8 (diff) |
XmlRpcValue::timeFromXml: Always initialize all fields of struct tm.
The norm doesn't say anything about unknown day of the week/year but it is probably still better to give them a specific value which is clearly invalid.
Found with Coverity.
-rw-r--r-- | TimXmlRpc.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/TimXmlRpc.cpp b/TimXmlRpc.cpp index bae234e..60eb0d7 100644 --- a/TimXmlRpc.cpp +++ b/TimXmlRpc.cpp @@ -1001,7 +1001,7 @@ void XmlRpcValue::timeFromXml(const char* &s) if (sscanf_s(s, "%4d%2d%2dT%2d:%2d:%2d", &t.tm_year,&t.tm_mon,&t.tm_mday,&t.tm_hour,&t.tm_min,&t.tm_sec) != 6) throw XmlRpcException("Bad time value"); - t.tm_isdst = -1; + t.tm_wday = t.tm_yday = t.tm_isdst = -1; t.tm_mon -= 1; _type = TypeDateTime; u.asTime = new struct tm(t); |