Some class members are not zero-initialized, which can cause seemingly
innocent initializations to result in uninitialized memory, which can
cause UB. While unlikely, this shows up as a critical issue in SVACE.
I have changed the constructors so that they explicitly initialize
members in order to fix the issue.
Change-Id: I16e1f253985e1c37f3b5ee67d3d9c91696706054
#include <time.h>
+#include <cynara-error.h>
#include "PolicyKey.h"
namespace Cynara {
class MonitorEntry {
public:
- MonitorEntry() = default;
+ MonitorEntry()
+ : m_result(CYNARA_API_ACCESS_DENIED), m_timestamp{0, 0} {}
MonitorEntry(PolicyKey key, const int &result, const struct timespec ×tamp)
: m_key(std::move(key)), m_result(result), m_timestamp(timestamp) {}
friend class PolicyKey;
public:
- PolicyKeyFeature() = default;
+ PolicyKeyFeature()
+ : m_isAny(false) {}
typedef std::string ValueType;