The following issues were found
src/third_party/abseil-cpp-master/abseil-cpp/absl/debugging/internal/address_is_readable.cc
1 issues
Line: 121
Column: 14
CWE codes:
120
20
} while (bytes_written == -1 && errno == EINTR);
if (bytes_written == 1) { // remove the byte from the pipe
char c;
while (read(read_fd, &c, 1) == -1 && errno == EINTR) {
}
}
if (errno == EBADF) { // Descriptors invalid.
// If pid_and_fds contains the problematic file descriptors we just used,
// this call will forget them, and the loop will try again.
Reported by FlawFinder.
src/third_party/abseil-cpp-master/abseil-cpp/absl/debugging/internal/demangle.cc
1 issues
Line: 445
Column: 3
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
static bool MaybeAppendDecimal(State *state, unsigned int val) {
// Max {32-64}-bit unsigned int is 20 digits.
constexpr size_t kMaxLength = 20;
char buf[kMaxLength];
// We can't use itoa or sprintf as neither is specified to be
// async-signal-safe.
if (state->parse_state.append) {
// We can't have a one-before-the-beginning pointer, so instead start with
Reported by FlawFinder.
src/third_party/abseil-cpp-master/abseil-cpp/absl/debugging/leak_check_fail_test.cc
1 issues
Line: 31
ABSL_RAW_LOG(INFO, "Should detect leaked string %s", foo);
}
TEST(LeakCheckTest, LeakMemoryAfterDisablerScope) {
// This test is expected to cause lsan failures on program exit. Therefore the
// test will be run only by external_leak_check_test.sh, which will verify a
// failed exit code.
{ absl::LeakCheckDisabler disabler; }
char* foo = strdup("lsan should also complain about this leaked string");
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/debugging/leak_check_test.cc
1 issues
Line: 33
#endif
}
TEST(LeakCheckTest, IgnoreLeakSuppressesLeakedMemoryErrors) {
auto foo = absl::IgnoreLeak(new std::string("some ignored leaked string"));
ABSL_RAW_LOG(INFO, "Ignoring leaked string %s", foo->c_str());
}
TEST(LeakCheckTest, LeakCheckDisablerIgnoresLeak) {
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/debugging/stacktrace.cc
1 issues
Line: 46
#include "absl/debugging/internal/stacktrace_config.h"
#if defined(ABSL_STACKTRACE_INL_HEADER)
#include ABSL_STACKTRACE_INL_HEADER
#else
# error Cannot calculate stack trace: will need to write for your environment
# include "absl/debugging/internal/stacktrace_aarch64-inl.inc"
# include "absl/debugging/internal/stacktrace_arm-inl.inc"
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/flags/internal/path_util_test.cc
1 issues
Line: 36
// --------------------------------------------------------------------
TEST(FlagsPathUtilTest, TestPackage) {
EXPECT_EQ(flags::Package(""), "");
EXPECT_EQ(flags::Package("a.cc"), "");
EXPECT_EQ(flags::Package("dir/a.cc"), "dir/");
EXPECT_EQ(flags::Package("dir1/dir2/a.cc"), "dir1/dir2/");
EXPECT_EQ(flags::Package("../dir1/dir2/a.cc"), "../dir1/dir2/");
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/flags/internal/registry.h
1 issues
Line: 90
Column: 37
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:
alignas(kRetiredFlagObjAlignment) char buf_[kRetiredFlagObjSize];
};
} // namespace flags_internal
ABSL_NAMESPACE_END
} // namespace absl
Reported by FlawFinder.
src/third_party/abseil-cpp-master/abseil-cpp/absl/flags/internal/sequence_lock_test.cc
1 issues
Line: 43
const int num_threads_;
};
TEST_P(ConcurrentSequenceLockTest, ReadAndWrite) {
const int buf_words =
flags::AlignUp(buf_bytes_, sizeof(uint64_t)) / sizeof(uint64_t);
// The buffer that will be protected by the SequenceLock.
absl::FixedArray<std::atomic<uint64_t>> protected_buf(buf_words);
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/flags/internal/usage_test.cc
1 issues
Line: 104
using UsageReportingDeathTest = UsageReportingTest;
TEST_F(UsageReportingDeathTest, TestSetProgramUsageMessage) {
EXPECT_EQ(absl::ProgramUsageMessage(), kTestUsageMessage);
#ifndef _WIN32
// TODO(rogeeff): figure out why this does not work on Windows.
EXPECT_DEATH_IF_SUPPORTED(
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/flags/marshalling_test.cc
1 issues
Line: 109
// --------------------------------------------------------------------
TEST(MarshallingTest, TestInt16Parsing) {
std::string err;
int16_t value;
// Decimal values.
EXPECT_TRUE(absl::ParseFlag("1", &value, &err));
Reported by Cppcheck.