The following issues were found
src/third_party/abseil-cpp-master/abseil-cpp/absl/base/internal/thread_identity.h
1 issues
Line: 146
Column: 20
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
// Private: Reserved for absl::synchronization_internal::Waiter.
struct WaiterState {
alignas(void*) char data[128];
} waiter_state;
// Used by PerThreadSem::{Get,Set}ThreadBlockedCounter().
std::atomic<int>* blocked_count_ptr;
Reported by FlawFinder.
src/third_party/abseil-cpp-master/abseil-cpp/absl/base/internal/thread_identity_test.cc
1 issues
Line: 65
num_identities_reused++;
}
TEST(ThreadIdentityTest, BasicIdentityWorks) {
// This tests for the main() thread.
TestThreadIdentityCurrent(nullptr);
}
TEST(ThreadIdentityTest, BasicIdentityWorksThreaded) {
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/base/internal/unique_small_name_test.cc
1 issues
Line: 36
int very_long_int_variable_name ABSL_INTERNAL_UNIQUE_SMALL_NAME() = 0;
char very_long_str_variable_name[] ABSL_INTERNAL_UNIQUE_SMALL_NAME() = "abc";
TEST(UniqueSmallName, NonAutomaticVar) {
EXPECT_EQ(very_long_int_variable_name, 0);
EXPECT_EQ(absl::string_view(very_long_str_variable_name), "abc");
}
int VeryLongFreeFunctionName() ABSL_INTERNAL_UNIQUE_SMALL_NAME();
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/base/optimization_test.cc
1 issues
Line: 40
EXPECT_TRUE(ABSL_PREDICT_TRUE(true) || false);
}
TEST(PredictTest, PredictFalse) {
EXPECT_TRUE(ABSL_PREDICT_FALSE(true));
EXPECT_FALSE(ABSL_PREDICT_FALSE(false));
EXPECT_TRUE(ABSL_PREDICT_FALSE(1 == 1));
EXPECT_FALSE(ABSL_PREDICT_FALSE(1 == 2));
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/base/spinlock_test_common.cc
1 issues
Line: 113
static_assert(std::is_trivially_destructible<SpinLock>(), "");
#endif
TEST(SpinLock, StackNonCooperativeDisablesScheduling) {
SpinLock spinlock(base_internal::SCHEDULE_KERNEL_ONLY);
spinlock.Lock();
EXPECT_FALSE(base_internal::SchedulingGuard::ReschedulingIsAllowed());
spinlock.Unlock();
}
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/base/throw_delegate_test.cc
1 issues
Line: 81
#endif
}
TEST(ThrowHelper, Test) {
// Not using EXPECT_THROW because we want to check the .what() message too.
ExpectThrowChar<std::logic_error>(ThrowStdLogicError);
ExpectThrowChar<std::invalid_argument>(ThrowStdInvalidArgument);
ExpectThrowChar<std::domain_error>(ThrowStdDomainError);
ExpectThrowChar<std::length_error>(ThrowStdLengthError);
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/cleanup/cleanup_test.cc
1 issues
Line: 94
bool fn_ptr_called = false;
void FnPtrFunction() { fn_ptr_called = true; }
TYPED_TEST(CleanupTest, FactoryProducesCorrectType) {
{
auto callback = TypeParam::AsCallback([] {});
auto cleanup = absl::MakeCleanup(std::move(callback));
static_assert(
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/container/btree_benchmark.cc
1 issues
Line: 558
Column: 17
CWE codes:
126
Suggestion:
This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it
other.values.begin(), other.values.begin() + std::min(Size, Copies));
}
bool operator==(const BigType& other) const {
return std::equal(values.begin(), values.begin() + std::min(Size, Copies),
other.values.begin());
}
// Support absl::Hash.
template <typename State>
Reported by FlawFinder.
src/third_party/abseil-cpp-master/abseil-cpp/absl/container/fixed_array.h
1 issues
Line: 433
Column: 29
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
private:
ABSL_ADDRESS_SANITIZER_REDZONE(redzone_begin_);
alignas(StorageElement) char buff_[sizeof(StorageElement[inline_elements])];
ABSL_ADDRESS_SANITIZER_REDZONE(redzone_end_);
};
class EmptyInlinedStorage {
public:
Reported by FlawFinder.
src/third_party/abseil-cpp-master/abseil-cpp/absl/container/fixed_array_exception_safety_test.cc
1 issues
Line: 54
using MoveFixedArrWithAlloc =
absl::FixedArray<MoveThrower, kInlined, MoveThrowAlloc>;
TEST(FixedArrayExceptionSafety, CopyConstructor) {
auto small = FixedArr(kSmallSize);
TestThrowingCtor<FixedArr>(small);
auto large = FixedArr(kLargeSize);
TestThrowingCtor<FixedArr>(large);
Reported by Cppcheck.