The following issues were found
src/third_party/abseil-cpp-master/abseil-cpp/absl/time/internal/cctz/src/time_zone_format_test.cc
1 issues
Line: 74
// Testing format()
//
TEST(Format, TimePointResolution) {
const char kFmt[] = "%H:%M:%E*S";
const time_zone utc = utc_time_zone();
const time_point<chrono::nanoseconds> t0 =
chrono::system_clock::from_time_t(1420167845) +
chrono::milliseconds(123) + chrono::microseconds(456) +
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/time/internal/test_util.cc
1 issues
Line: 91
Column: 5
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
std::size_t Read(void* ptr, std::size_t size) override {
const std::size_t len = std::min<std::size_t>(size, end_ - data_);
memcpy(ptr, data_, len);
data_ += len;
return len;
}
int Skip(std::size_t offset) override {
Reported by FlawFinder.
src/third_party/abseil-cpp-master/abseil-cpp/absl/time/time_test.cc
1 issues
Line: 60
// A gMock matcher to match timespec values. Use this matcher like:
// timespec ts1, ts2;
// EXPECT_THAT(ts1, TimespecMatcher(ts2));
MATCHER_P(TimespecMatcher, ts, "") {
if (ts.tv_sec == arg.tv_sec && ts.tv_nsec == arg.tv_nsec) return true;
*result_listener << "expected: {" << ts.tv_sec << ", " << ts.tv_nsec << "} ";
*result_listener << "actual: {" << arg.tv_sec << ", " << arg.tv_nsec << "}";
return false;
}
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/time/time_zone_test.cc
1 issues
Line: 33
EXPECT_EQ(tz, tz2);
}
TEST(TimeZone, Equality) {
absl::TimeZone a, b;
EXPECT_EQ(a, b);
EXPECT_EQ(a.name(), b.name());
absl::TimeZone implicit_utc;
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/types/any_test.cc
1 issues
Line: 93
using ArrayType = int[2];
using DecayedArray = absl::decay_t<ArrayType>;
TEST(AnyTest, Noexcept) {
static_assert(std::is_nothrow_default_constructible<absl::any>(), "");
static_assert(std::is_nothrow_move_constructible<absl::any>(), "");
static_assert(std::is_nothrow_move_assignable<absl::any>(), "");
static_assert(noexcept(std::declval<absl::any&>().has_value()), "");
static_assert(noexcept(std::declval<absl::any&>().type()), "");
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/types/internal/conformance_profile.h
1 issues
Line: 281
Column: 15
CWE codes:
120
function_support max) {
if (min == max) {
std::string result =
absl::StrCat("Expected:\n ",
PessimisticPropertyDescription(
static_cast<function_support>(UnderlyingValue(min))),
"\n");
return result;
}
Reported by FlawFinder.
src/third_party/abseil-cpp-master/abseil-cpp/absl/types/internal/conformance_testing_test.cc
1 issues
Line: 121
TYPED_TEST_SUITE_P(ProfileTest);
TYPED_TEST_P(ProfileTest, HasAppropriateConstructionProperties) {
using profile = typename TypeParam::profile;
using arch = typename TypeParam::arch;
using expected_profile = typename TypeParam::expected_profile;
using props = ti::PropertiesOfT<profile>;
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/types/optional_test.cc
1 issues
Line: 173
ConvertsFromInPlaceT(absl::in_place_t) {} // NOLINT
};
TEST(optionalTest, DefaultConstructor) {
absl::optional<int> empty;
EXPECT_FALSE(empty);
constexpr absl::optional<int> cempty;
static_assert(!cempty.has_value(), "");
EXPECT_TRUE(
Reported by Cppcheck.
src/third_party/asio-master/asio/include/asio/basic_socket_streambuf.hpp
1 issues
Line: 634
Column: 16
CWE codes:
362
// Close and reopen the socket.
typename Protocol::endpoint ep(*i);
socket().close(ec_);
socket().open(ep.protocol(), ec_);
if (ec_)
continue;
// Try to complete the operation without blocking.
if (!socket().native_non_blocking())
Reported by FlawFinder.
src/third_party/asio-master/asio/include/asio/buffer.hpp
1 issues
Line: 1888
Column: 5
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
std::size_t source_size = source.size();
std::size_t n = target_size < source_size ? target_size : source_size;
if (n > 0)
memcpy(target.data(), source.data(), n);
return n;
}
template <typename TargetIterator, typename SourceIterator>
inline std::size_t buffer_copy(one_buffer, one_buffer,
Reported by FlawFinder.