- Incorrect deallocator used
- Bad bit shift operation
Change-Id: I2ea1f33da459ee62883be6038dfd7268d2782558
Signed-off-by: Sangwan Kwon <sangwan.kwon@samsung.com>
// This file is subset of chromium-efl/net/http/transport_security_state.cc
+#include <stdexcept>
+
#include "net/http/transport_security_state.h"
#include "net/http/transport_security_state_static.h"
#include "base/logging.h"
// insufficient bits in the input or true otherwise.
bool Read(unsigned num_bits, uint32* out) {
DCHECK_LE(num_bits, 32u);
+ if (num_bits > 32u)
+ throw std::invalid_argument("num_bits should be less equal than 32u.");
uint32 ret = 0;
for (unsigned i = 0; i < num_bits; ++i) {
TPKP_E_INVALID_CERT, "Failed to convert pem pubkey to der.");
TPKP::RawBuffer pubkeyder(der, der + len);
- free(der);
+ OPENSSL_free(der);
unsigned char *hashResult = nullptr;
TPKP::RawBuffer out;
switch (algo) {