The following issues were found

src/third_party/wiredtiger/dist/s_function_loop.py
8 issues
Anomalous backslash in string: '\)'. String constant might be missing an r prefix.
Error

Line: 5 Column: 62

              # Each input line is the content of a C function.
import re, sys

p = re.compile('((for |while |_FOREACH|FOREACH_BEGIN)\([^{)]*\)|do) {')
for line in sys.stdin:
    matched = 0
    m = p.search(line)
    while m != None:
        matched = 1

            

Reported by Pylint.

Anomalous backslash in string: '\('. String constant might be missing an r prefix.
Error

Line: 5 Column: 54

              # Each input line is the content of a C function.
import re, sys

p = re.compile('((for |while |_FOREACH|FOREACH_BEGIN)\([^{)]*\)|do) {')
for line in sys.stdin:
    matched = 0
    m = p.search(line)
    while m != None:
        matched = 1

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # Mark outer loop boundaries with {@ and }@ .  Nested loops are not marked.
# Each input line is the content of a C function.
import re, sys

p = re.compile('((for |while |_FOREACH|FOREACH_BEGIN)\([^{)]*\)|do) {')
for line in sys.stdin:
    matched = 0
    m = p.search(line)
    while m != None:

            

Reported by Pylint.

Multiple imports on one line (re, sys)
Error

Line: 3 Column: 1

              # Mark outer loop boundaries with {@ and }@ .  Nested loops are not marked.
# Each input line is the content of a C function.
import re, sys

p = re.compile('((for |while |_FOREACH|FOREACH_BEGIN)\([^{)]*\)|do) {')
for line in sys.stdin:
    matched = 0
    m = p.search(line)
    while m != None:

            

Reported by Pylint.

Constant name "matched" doesn't conform to UPPER_CASE naming style
Error

Line: 7 Column: 5

              
p = re.compile('((for |while |_FOREACH|FOREACH_BEGIN)\([^{)]*\)|do) {')
for line in sys.stdin:
    matched = 0
    m = p.search(line)
    while m != None:
        matched = 1
        pos = m.end()
        out = line[:pos] + "@"

            

Reported by Pylint.

Comparison 'm != None' should be 'm is not None'
Error

Line: 9 Column: 11

              for line in sys.stdin:
    matched = 0
    m = p.search(line)
    while m != None:
        matched = 1
        pos = m.end()
        out = line[:pos] + "@"
        level = 1
        length = len(line)

            

Reported by Pylint.

Constant name "matched" doesn't conform to UPPER_CASE naming style
Error

Line: 10 Column: 9

                  matched = 0
    m = p.search(line)
    while m != None:
        matched = 1
        pos = m.end()
        out = line[:pos] + "@"
        level = 1
        length = len(line)
        while level > 0 and pos < length:

            

Reported by Pylint.

Constant name "level" doesn't conform to UPPER_CASE naming style
Error

Line: 13 Column: 9

                      matched = 1
        pos = m.end()
        out = line[:pos] + "@"
        level = 1
        length = len(line)
        while level > 0 and pos < length:
            c = line[pos:pos+1]
            pos += 1
            out += c

            

Reported by Pylint.

src/third_party/wiredtiger/dist/db.py
8 issues
Missing module docstring
Error

Line: 1 Column: 1

              # A simple python script to build a file that can be bulk-loaded into a
# WiredTiger database for smoke-testing.

import getopt, random, sys

dmin = 7        # Minimum data size
dmax = 837      # Maximum data size

seed = None     # Random number seed

            

Reported by Pylint.

Multiple imports on one line (getopt, random, sys)
Error

Line: 4 Column: 1

              # A simple python script to build a file that can be bulk-loaded into a
# WiredTiger database for smoke-testing.

import getopt, random, sys

dmin = 7        # Minimum data size
dmax = 837      # Maximum data size

seed = None     # Random number seed

            

Reported by Pylint.

Constant name "dmin" doesn't conform to UPPER_CASE naming style
Error

Line: 6 Column: 1

              
import getopt, random, sys

dmin = 7        # Minimum data size
dmax = 837      # Maximum data size

seed = None     # Random number seed
pairs = 100000  # Key/data pairs to output


            

Reported by Pylint.

Constant name "dmax" doesn't conform to UPPER_CASE naming style
Error

Line: 7 Column: 1

              import getopt, random, sys

dmin = 7        # Minimum data size
dmax = 837      # Maximum data size

seed = None     # Random number seed
pairs = 100000  # Key/data pairs to output

opts, args = getopt.getopt(sys.argv[1:], "m:n:s:")

            

Reported by Pylint.

Constant name "seed" doesn't conform to UPPER_CASE naming style
Error

Line: 9 Column: 1

              dmin = 7        # Minimum data size
dmax = 837      # Maximum data size

seed = None     # Random number seed
pairs = 100000  # Key/data pairs to output

opts, args = getopt.getopt(sys.argv[1:], "m:n:s:")
for o, a in opts:
    if o == "-m":

            

Reported by Pylint.

Constant name "pairs" doesn't conform to UPPER_CASE naming style
Error

Line: 10 Column: 1

              dmax = 837      # Maximum data size

seed = None     # Random number seed
pairs = 100000  # Key/data pairs to output

opts, args = getopt.getopt(sys.argv[1:], "m:n:s:")
for o, a in opts:
    if o == "-m":
        dmax = int(a)

            

Reported by Pylint.

Constant name "fmt" doesn't conform to UPPER_CASE naming style
Error

Line: 23 Column: 5

              
random.seed(seed)
for i in range(pairs):
    fmt = "%010d\ndata: %0" + str(random.randrange(dmin, dmax)) + "d"
    print(fmt % (i, i))

            

Reported by Pylint.

Standard pseudo-random generators are not suitable for security/cryptographic purposes.
Security blacklist

Line: 23
Suggestion: https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html#b311-random

              
random.seed(seed)
for i in range(pairs):
    fmt = "%010d\ndata: %0" + str(random.randrange(dmin, dmax)) + "d"
    print(fmt % (i, i))

            

Reported by Bandit.

src/third_party/mozjs-60/extract/js/src/wasm/WasmCode.cpp
8 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 301 Column: 5 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                  if (!codeBytes)
        return nullptr;

    memcpy(codeBytes.get(), unlinkedBytes.begin(), unlinkedBytes.length());
    memset(codeBytes.get() + unlinkedBytes.length(), 0, padding);

    return create(tier, Move(codeBytes), codeLength, bytecode, linkData, metadata, codeRanges);
}


            

Reported by FlawFinder.

strlen - Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected)
Security

Line: 183 Column: 31 CWE codes: 126

              static bool
AppendToString(const char* str, UTF8Bytes* bytes)
{
    return bytes->append(str, strlen(str)) && bytes->append('\0');
}
#endif

static void
SendCodeRangesToProfiler(const ModuleSegment& ms, const Bytes& bytecode, const Metadata& metadata,

            

Reported by FlawFinder.

strlen - Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected)
Security

Line: 485 Column: 20 CWE codes: 126

              static size_t
StringLengthWithNullChar(const char* chars)
{
    return chars ? strlen(chars) + 1 : 0;
}

size_t
CacheableChars::serializedSize() const
{

            

Reported by FlawFinder.

strlen - Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected)
Security

Line: 991 Column: 42 CWE codes: 126

                  const char* funcIndexStr = NumberToCString(nullptr, &cbuf, funcIndex);
    MOZ_ASSERT(funcIndexStr);

    return name->append(beforeFuncIndex, strlen(beforeFuncIndex)) &&
           name->append(funcIndexStr, strlen(funcIndexStr)) &&
           name->append(afterFuncIndex, strlen(afterFuncIndex));
}

size_t

            

Reported by FlawFinder.

strlen - Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected)
Security

Line: 992 Column: 39 CWE codes: 126

                  MOZ_ASSERT(funcIndexStr);

    return name->append(beforeFuncIndex, strlen(beforeFuncIndex)) &&
           name->append(funcIndexStr, strlen(funcIndexStr)) &&
           name->append(afterFuncIndex, strlen(afterFuncIndex));
}

size_t
CodeTier::serializedSize() const

            

Reported by FlawFinder.

strlen - Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected)
Security

Line: 993 Column: 41 CWE codes: 126

              
    return name->append(beforeFuncIndex, strlen(beforeFuncIndex)) &&
           name->append(funcIndexStr, strlen(funcIndexStr)) &&
           name->append(afterFuncIndex, strlen(afterFuncIndex));
}

size_t
CodeTier::serializedSize() const
{

            

Reported by FlawFinder.

strlen - Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected)
Security

Line: 1331 Column: 40 CWE codes: 126

                          return;

        if (const char* filename = metadata().filename.get()) {
            if (!name.append(filename, strlen(filename)))
                return;
        } else {
            if (!name.append('?'))
                return;
        }

            

Reported by FlawFinder.

strlen - Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected)
Security

Line: 1339 Column: 39 CWE codes: 126

                      }

        if (!name.append(':') ||
            !name.append(bytecodeStr, strlen(bytecodeStr)) ||
            !name.append(")\0", 2))
        {
            return;
        }


            

Reported by FlawFinder.

src/third_party/abseil-cpp-master/abseil-cpp/absl/strings/string_view_test.cc
8 issues
syntax error
Error

Line: 80

                return false;
}

TEST(StringViewTest, Ctor) {
  {
    // Null.
    absl::string_view s10;
    EXPECT_TRUE(s10.data() == nullptr);
    EXPECT_EQ(0, s10.length());

            

Reported by Cppcheck.

char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 310 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

                EXPECT_FALSE(is_type<size_t>::same(""));

  // Make sure absl::string_view::npos continues to be a header constant.
  char test[absl::string_view::npos & 1] = {0};
  EXPECT_EQ(0, test[0]);
}

TEST(StringViewTest, STL1) {
  const absl::string_view a("abcdefghijklmnopqrstuvwxyz");

            

Reported by FlawFinder.

char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 358 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

                EXPECT_TRUE(e.empty());
  EXPECT_TRUE(e.begin() == e.end());

  char buf[4] = { '%', '%', '%', '%' };
  EXPECT_EQ(a.copy(buf, 4), 4);
  EXPECT_EQ(buf[0], a[0]);
  EXPECT_EQ(buf[1], a[1]);
  EXPECT_EQ(buf[2], a[2]);
  EXPECT_EQ(buf[3], a[3]);

            

Reported by FlawFinder.

strlen - Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected)
Security

Line: 129 Column: 22 CWE codes: 126

                  const mstring str2("SLEEPING!");

    absl::string_view s1(str1);
    s1.remove_prefix(strlen("BUNGIE-JUM"));

    absl::string_view s2(str2);
    s2.remove_prefix(strlen("SLEE"));

    EXPECT_EQ(s1, s2);

            

Reported by FlawFinder.

strlen - Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected)
Security

Line: 132 Column: 22 CWE codes: 126

                  s1.remove_prefix(strlen("BUNGIE-JUM"));

    absl::string_view s2(str2);
    s2.remove_prefix(strlen("SLEE"));

    EXPECT_EQ(s1, s2);
    EXPECT_EQ(s1, "PING!");
  }


            

Reported by FlawFinder.

strlen - Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected)
Security

Line: 710 Column: 18 CWE codes: 126

              TEST(StringViewTest, UTF8) {
  std::string utf8 = "\u00E1";
  std::string utf8_twice = utf8 + " " + utf8;
  int utf8_len = strlen(utf8.data());
  EXPECT_EQ(utf8_len, absl::string_view(utf8_twice).find_first_of(" "));
  EXPECT_EQ(utf8_len, absl::string_view(utf8_twice).find_first_of(" \t"));
}

TEST(StringViewTest, FindConformance) {

            

Reported by FlawFinder.

strlen - Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected)
Security

Line: 942 Column: 15 CWE codes: 126

                  static const char kHi[] = "hi";
    absl::string_view s = absl::NullSafeStringView(kHi);
    EXPECT_EQ(kHi, s.data());
    EXPECT_EQ(strlen(kHi), s.size());
    EXPECT_EQ(absl::string_view("hi"), s);
  }
}

TEST(StringViewTest, ConstexprNullSafeStringView) {

            

Reported by FlawFinder.

strlen - Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected)
Security

Line: 961 Column: 15 CWE codes: 126

                  static constexpr char kHi[] = "hi";
    absl::string_view s = absl::NullSafeStringView(kHi);
    EXPECT_EQ(kHi, s.data());
    EXPECT_EQ(strlen(kHi), s.size());
    EXPECT_EQ(absl::string_view("hi"), s);
  }
  {
    constexpr absl::string_view s = absl::NullSafeStringView("hello");
    EXPECT_EQ(s.size(), 5);

            

Reported by FlawFinder.

src/third_party/wiredtiger/test/py_install/testbase.py
8 issues
Unable to import 'wiredtiger'
Error

Line: 31 Column: 1

              
# A quick sanity test of an installation via 'pip install wiredtiger'.

import wiredtiger, shutil, os
from wiredtiger import wiredtiger_open, wiredtiger_version

wthome = "WTPY_TEST"
shutil.rmtree(wthome, ignore_errors=True)
os.mkdir(wthome)

            

Reported by Pylint.

Unable to import 'wiredtiger'
Error

Line: 32 Column: 1

              # A quick sanity test of an installation via 'pip install wiredtiger'.

import wiredtiger, shutil, os
from wiredtiger import wiredtiger_open, wiredtiger_version

wthome = "WTPY_TEST"
shutil.rmtree(wthome, ignore_errors=True)
os.mkdir(wthome)
conn = wiredtiger_open(wthome, "create")

            

Reported by Pylint.

Unused import wiredtiger
Error

Line: 31 Column: 1

              
# A quick sanity test of an installation via 'pip install wiredtiger'.

import wiredtiger, shutil, os
from wiredtiger import wiredtiger_open, wiredtiger_version

wthome = "WTPY_TEST"
shutil.rmtree(wthome, ignore_errors=True)
os.mkdir(wthome)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              #!/usr/bin/env python
#
# Public Domain 2014-present MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled

            

Reported by Pylint.

standard import "import wiredtiger, shutil, os" should be placed before "import wiredtiger, shutil, os"
Error

Line: 31 Column: 1

              
# A quick sanity test of an installation via 'pip install wiredtiger'.

import wiredtiger, shutil, os
from wiredtiger import wiredtiger_open, wiredtiger_version

wthome = "WTPY_TEST"
shutil.rmtree(wthome, ignore_errors=True)
os.mkdir(wthome)

            

Reported by Pylint.

Multiple imports on one line (wiredtiger, shutil, os)
Error

Line: 31 Column: 1

              
# A quick sanity test of an installation via 'pip install wiredtiger'.

import wiredtiger, shutil, os
from wiredtiger import wiredtiger_open, wiredtiger_version

wthome = "WTPY_TEST"
shutil.rmtree(wthome, ignore_errors=True)
os.mkdir(wthome)

            

Reported by Pylint.

standard import "import wiredtiger, shutil, os" should be placed before "import wiredtiger, shutil, os"
Error

Line: 31 Column: 1

              
# A quick sanity test of an installation via 'pip install wiredtiger'.

import wiredtiger, shutil, os
from wiredtiger import wiredtiger_open, wiredtiger_version

wthome = "WTPY_TEST"
shutil.rmtree(wthome, ignore_errors=True)
os.mkdir(wthome)

            

Reported by Pylint.

Constant name "wthome" doesn't conform to UPPER_CASE naming style
Error

Line: 34 Column: 1

              import wiredtiger, shutil, os
from wiredtiger import wiredtiger_open, wiredtiger_version

wthome = "WTPY_TEST"
shutil.rmtree(wthome, ignore_errors=True)
os.mkdir(wthome)
conn = wiredtiger_open(wthome, "create")
session = conn.open_session()
session.create('table:foo', 'key_format=S,value_format=i')

            

Reported by Pylint.

src/third_party/mozjs-60/extract/js/src/vm/Time.cpp
8 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 380 Column: 9 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

              #endif // XP_WIN

    if (fake_tm_year && result) {
        char real_year[16];
        char fake_year[16];
        size_t real_year_len;
        size_t fake_year_len;
        char* p;


            

Reported by FlawFinder.

char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 381 Column: 9 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

              
    if (fake_tm_year && result) {
        char real_year[16];
        char fake_year[16];
        size_t real_year_len;
        size_t fake_year_len;
        char* p;

        sprintf(real_year, "%d", prtm->tm_year);

            

Reported by FlawFinder.

sprintf - Does not check for buffer overflows
Security

Line: 386 Column: 9 CWE codes: 120
Suggestion: Use sprintf_s, snprintf, or vsnprintf

                      size_t fake_year_len;
        char* p;

        sprintf(real_year, "%d", prtm->tm_year);
        real_year_len = strlen(real_year);
        sprintf(fake_year, "%d", fake_tm_year);
        fake_year_len = strlen(fake_year);

        /* Replace the fake year in the result with the real year. */

            

Reported by FlawFinder.

sprintf - Does not check for buffer overflows
Security

Line: 388 Column: 9 CWE codes: 120
Suggestion: Use sprintf_s, snprintf, or vsnprintf

              
        sprintf(real_year, "%d", prtm->tm_year);
        real_year_len = strlen(real_year);
        sprintf(fake_year, "%d", fake_tm_year);
        fake_year_len = strlen(fake_year);

        /* Replace the fake year in the result with the real year. */
        for (p = buf; (p = strstr(p, fake_year)); p += real_year_len) {
            size_t new_result = result + real_year_len - fake_year_len;

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 398 Column: 13 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                              return 0;
            }
            memmove(p + real_year_len, p + fake_year_len, strlen(p + fake_year_len));
            memcpy(p, real_year, real_year_len);
            result = new_result;
            *(buf + result) = '\0';
        }
    }
#endif

            

Reported by FlawFinder.

strlen - Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected)
Security

Line: 387 Column: 25 CWE codes: 126

                      char* p;

        sprintf(real_year, "%d", prtm->tm_year);
        real_year_len = strlen(real_year);
        sprintf(fake_year, "%d", fake_tm_year);
        fake_year_len = strlen(fake_year);

        /* Replace the fake year in the result with the real year. */
        for (p = buf; (p = strstr(p, fake_year)); p += real_year_len) {

            

Reported by FlawFinder.

strlen - Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected)
Security

Line: 389 Column: 25 CWE codes: 126

                      sprintf(real_year, "%d", prtm->tm_year);
        real_year_len = strlen(real_year);
        sprintf(fake_year, "%d", fake_tm_year);
        fake_year_len = strlen(fake_year);

        /* Replace the fake year in the result with the real year. */
        for (p = buf; (p = strstr(p, fake_year)); p += real_year_len) {
            size_t new_result = result + real_year_len - fake_year_len;
            if ((int)new_result >= buflen) {

            

Reported by FlawFinder.

strlen - Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected)
Security

Line: 397 Column: 59 CWE codes: 126

                          if ((int)new_result >= buflen) {
                return 0;
            }
            memmove(p + real_year_len, p + fake_year_len, strlen(p + fake_year_len));
            memcpy(p, real_year, real_year_len);
            result = new_result;
            *(buf + result) = '\0';
        }
    }

            

Reported by FlawFinder.

src/third_party/abseil-cpp-master/abseil-cpp/absl/random/zipf_distribution_test.cc
8 issues
syntax error
Error

Line: 49

                                                uint8_t, uint16_t, uint32_t, uint64_t>;
TYPED_TEST_CASE(ZipfDistributionTypedTest, IntTypes);

TYPED_TEST(ZipfDistributionTypedTest, SerializeTest) {
  using param_type = typename absl::zipf_distribution<TypeParam>::param_type;

  constexpr int kCount = 1000;
  absl::InsecureBitGen gen;
  for (const auto& param : {

            

Reported by Cppcheck.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 106 Column: 29 CWE codes: 120

                    if (sample < sample_min) sample_min = sample;
    }
    ABSL_INTERNAL_LOG(INFO,
                      absl::StrCat("Range: ", +sample_min, ", ", +sample_max));
  }
}

class ZipfModel {
 public:

            

Reported by FlawFinder.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 308 Column: 37 CWE codes: 120

                if (chi_square > threshold) {
    ABSL_INTERNAL_LOG(INFO, "values");
    for (size_t i = 0; i < expected.size(); i++) {
      ABSL_INTERNAL_LOG(INFO, absl::StrCat(points[i], ": ", buckets[i],
                                           " vs. E=", expected[i]));
    }
    ABSL_INTERNAL_LOG(INFO, absl::StrCat("trials ", trials));
    ABSL_INTERNAL_LOG(INFO,
                      absl::StrCat("mean ", avg, " vs. expected ", mean()));

            

Reported by FlawFinder.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 311 Column: 35 CWE codes: 120

                    ABSL_INTERNAL_LOG(INFO, absl::StrCat(points[i], ": ", buckets[i],
                                           " vs. E=", expected[i]));
    }
    ABSL_INTERNAL_LOG(INFO, absl::StrCat("trials ", trials));
    ABSL_INTERNAL_LOG(INFO,
                      absl::StrCat("mean ", avg, " vs. expected ", mean()));
    ABSL_INTERNAL_LOG(INFO, absl::StrCat(kChiSquared, "(data, ", dof, ") = ",
                                         chi_square, " (", p_actual, ")"));
    ABSL_INTERNAL_LOG(INFO,

            

Reported by FlawFinder.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 313 Column: 29 CWE codes: 120

                  }
    ABSL_INTERNAL_LOG(INFO, absl::StrCat("trials ", trials));
    ABSL_INTERNAL_LOG(INFO,
                      absl::StrCat("mean ", avg, " vs. expected ", mean()));
    ABSL_INTERNAL_LOG(INFO, absl::StrCat(kChiSquared, "(data, ", dof, ") = ",
                                         chi_square, " (", p_actual, ")"));
    ABSL_INTERNAL_LOG(INFO,
                      absl::StrCat(kChiSquared, " @ 0.9995 = ", threshold));
    FAIL() << kChiSquared << " value of " << chi_square

            

Reported by FlawFinder.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 314 Column: 35 CWE codes: 120

                  ABSL_INTERNAL_LOG(INFO, absl::StrCat("trials ", trials));
    ABSL_INTERNAL_LOG(INFO,
                      absl::StrCat("mean ", avg, " vs. expected ", mean()));
    ABSL_INTERNAL_LOG(INFO, absl::StrCat(kChiSquared, "(data, ", dof, ") = ",
                                         chi_square, " (", p_actual, ")"));
    ABSL_INTERNAL_LOG(INFO,
                      absl::StrCat(kChiSquared, " @ 0.9995 = ", threshold));
    FAIL() << kChiSquared << " value of " << chi_square
           << " is above the threshold.";

            

Reported by FlawFinder.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 317 Column: 29 CWE codes: 120

                  ABSL_INTERNAL_LOG(INFO, absl::StrCat(kChiSquared, "(data, ", dof, ") = ",
                                         chi_square, " (", p_actual, ")"));
    ABSL_INTERNAL_LOG(INFO,
                      absl::StrCat(kChiSquared, " @ 0.9995 = ", threshold));
    FAIL() << kChiSquared << " value of " << chi_square
           << " is above the threshold.";
  }
}


            

Reported by FlawFinder.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 345 Column: 28 CWE codes: 120

              std::string ParamName(
    const ::testing::TestParamInfo<zipf_u64::param_type>& info) {
  const auto& p = info.param;
  std::string name = absl::StrCat("k_", p.k(), "__q_", absl::SixDigits(p.q()),
                                  "__v_", absl::SixDigits(p.v()));
  return absl::StrReplaceAll(name, {{"+", "_"}, {"-", "_"}, {".", "_"}});
}

INSTANTIATE_TEST_SUITE_P(All, ZipfTest, ::testing::ValuesIn(GenParams()),

            

Reported by FlawFinder.

src/third_party/abseil-cpp-master/abseil-cpp/absl/random/poisson_distribution_test.cc
8 issues
syntax error
Error

Line: 78

                                                uint8_t, uint16_t, uint32_t, uint64_t>;
TYPED_TEST_CASE(PoissonDistributionInterfaceTest, IntTypes);

TYPED_TEST(PoissonDistributionInterfaceTest, SerializeTest) {
  using param_type = typename absl::poisson_distribution<TypeParam>::param_type;
  const double kMax =
      std::min(1e10 /* assertion limit */,
               static_cast<double>(std::numeric_limits<TypeParam>::max()));


            

Reported by Cppcheck.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 137 Column: 35 CWE codes: 120

                    if (sample < sample_min) sample_min = sample;
    }

    ABSL_INTERNAL_LOG(INFO, absl::StrCat("Range {", param.mean(), "}: ",
                                         +sample_min, ", ", +sample_max));

    // Validate stream serialization.
    std::stringstream ss;
    ss << before;

            

Reported by FlawFinder.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 191 Column: 35 CWE codes: 120

                }

  void LogCDF() {
    ABSL_INTERNAL_LOG(INFO, absl::StrCat("CDF (mean = ", mean_, ")"));
    for (const auto c : cdf_) {
      ABSL_INTERNAL_LOG(INFO,
                        absl::StrCat(c.index, ": pmf=", c.pmf, " cdf=", c.cdf));
    }
  }

            

Reported by FlawFinder.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 194 Column: 31 CWE codes: 120

                  ABSL_INTERNAL_LOG(INFO, absl::StrCat("CDF (mean = ", mean_, ")"));
    for (const auto c : cdf_) {
      ABSL_INTERNAL_LOG(INFO,
                        absl::StrCat(c.index, ": pmf=", c.pmf, " cdf=", c.cdf));
    }
  }

 private:
  const double mean_;

            

Reported by FlawFinder.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 342 Column: 28 CWE codes: 120

              
std::string ZParamName(const ::testing::TestParamInfo<ZParam>& info) {
  const auto& p = info.param;
  std::string name = absl::StrCat("mean_", absl::SixDigits(p.mean));
  return absl::StrReplaceAll(name, {{"+", "_"}, {"-", "_"}, {".", "_"}});
}

INSTANTIATE_TEST_SUITE_P(All, PoissonDistributionZTest,
                         ::testing::ValuesIn(GetZParams()), ZParamName);

            

Reported by FlawFinder.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 442 Column: 35 CWE codes: 120

                if (chi_square > threshold) {
    LogCDF();

    ABSL_INTERNAL_LOG(INFO, absl::StrCat("VALUES  buckets=", counts.size(),
                                         "  samples=", kSamples));
    for (size_t i = 0; i < counts.size(); i++) {
      ABSL_INTERNAL_LOG(
          INFO, absl::StrCat(cutoffs_[i], ": ", counts[i], " vs. E=", e[i]));
    }

            

Reported by FlawFinder.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 446 Column: 23 CWE codes: 120

                                                       "  samples=", kSamples));
    for (size_t i = 0; i < counts.size(); i++) {
      ABSL_INTERNAL_LOG(
          INFO, absl::StrCat(cutoffs_[i], ": ", counts[i], " vs. E=", e[i]));
    }

    ABSL_INTERNAL_LOG(
        INFO,
        absl::StrCat(kChiSquared, "(data, dof=", dof, ") = ", chi_square, " (",

            

Reported by FlawFinder.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 451 Column: 15 CWE codes: 120

              
    ABSL_INTERNAL_LOG(
        INFO,
        absl::StrCat(kChiSquared, "(data, dof=", dof, ") = ", chi_square, " (",
                     p, ")\n", " vs.\n", kChiSquared, " @ 0.98 = ", threshold));
  }
  return p;
}


            

Reported by FlawFinder.

src/third_party/wiredtiger/test/suite/test_empty_value.py
8 issues
Unable to import 'wiredtiger'
Error

Line: 32 Column: 1

              # test_empty_value.py
#       Smoke test empty row-store values.

from wiredtiger import stat
import wiredtiger, wttest

# Smoke test empty row-store values.
class test_row_store_empty_values(wttest.WiredTigerTestCase):
    conn_config = 'statistics=(all)'

            

Reported by Pylint.

Unable to import 'wiredtiger'
Error

Line: 33 Column: 1

              #       Smoke test empty row-store values.

from wiredtiger import stat
import wiredtiger, wttest

# Smoke test empty row-store values.
class test_row_store_empty_values(wttest.WiredTigerTestCase):
    conn_config = 'statistics=(all)'


            

Reported by Pylint.

Unused import wiredtiger
Error

Line: 33 Column: 1

              #       Smoke test empty row-store values.

from wiredtiger import stat
import wiredtiger, wttest

# Smoke test empty row-store values.
class test_row_store_empty_values(wttest.WiredTigerTestCase):
    conn_config = 'statistics=(all)'


            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              #!/usr/bin/env python
#
# Public Domain 2014-present MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled

            

Reported by Pylint.

Multiple imports on one line (wiredtiger, wttest)
Error

Line: 33 Column: 1

              #       Smoke test empty row-store values.

from wiredtiger import stat
import wiredtiger, wttest

# Smoke test empty row-store values.
class test_row_store_empty_values(wttest.WiredTigerTestCase):
    conn_config = 'statistics=(all)'


            

Reported by Pylint.

Missing class docstring
Error

Line: 36 Column: 1

              import wiredtiger, wttest

# Smoke test empty row-store values.
class test_row_store_empty_values(wttest.WiredTigerTestCase):
    conn_config = 'statistics=(all)'

    # Smoke test empty row-store values.
    def test_row_store_empty_values(self):
        nentries = 25000

            

Reported by Pylint.

Class name "test_row_store_empty_values" doesn't conform to PascalCase naming style
Error

Line: 36 Column: 1

              import wiredtiger, wttest

# Smoke test empty row-store values.
class test_row_store_empty_values(wttest.WiredTigerTestCase):
    conn_config = 'statistics=(all)'

    # Smoke test empty row-store values.
    def test_row_store_empty_values(self):
        nentries = 25000

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 40 Column: 5

                  conn_config = 'statistics=(all)'

    # Smoke test empty row-store values.
    def test_row_store_empty_values(self):
        nentries = 25000
        uri = 'file:test_empty_values'          # This is a btree layer test.

        # Create the object, open the cursor, insert some records with zero-length values.
        self.session.create(uri, 'key_format=S,value_format=u')

            

Reported by Pylint.

src/third_party/abseil-cpp-master/abseil-cpp/absl/flags/marshalling.cc
8 issues
StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 166 Column: 45 CWE codes: 120

              // AbslUnparseFlag specializations for various builtin flag types.

std::string Unparse(bool v) { return v ? "true" : "false"; }
std::string Unparse(short v) { return absl::StrCat(v); }
std::string Unparse(unsigned short v) { return absl::StrCat(v); }
std::string Unparse(int v) { return absl::StrCat(v); }
std::string Unparse(unsigned int v) { return absl::StrCat(v); }
std::string Unparse(long v) { return absl::StrCat(v); }
std::string Unparse(unsigned long v) { return absl::StrCat(v); }

            

Reported by FlawFinder.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 167 Column: 54 CWE codes: 120

              
std::string Unparse(bool v) { return v ? "true" : "false"; }
std::string Unparse(short v) { return absl::StrCat(v); }
std::string Unparse(unsigned short v) { return absl::StrCat(v); }
std::string Unparse(int v) { return absl::StrCat(v); }
std::string Unparse(unsigned int v) { return absl::StrCat(v); }
std::string Unparse(long v) { return absl::StrCat(v); }
std::string Unparse(unsigned long v) { return absl::StrCat(v); }
std::string Unparse(long long v) { return absl::StrCat(v); }

            

Reported by FlawFinder.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 168 Column: 43 CWE codes: 120

              std::string Unparse(bool v) { return v ? "true" : "false"; }
std::string Unparse(short v) { return absl::StrCat(v); }
std::string Unparse(unsigned short v) { return absl::StrCat(v); }
std::string Unparse(int v) { return absl::StrCat(v); }
std::string Unparse(unsigned int v) { return absl::StrCat(v); }
std::string Unparse(long v) { return absl::StrCat(v); }
std::string Unparse(unsigned long v) { return absl::StrCat(v); }
std::string Unparse(long long v) { return absl::StrCat(v); }
std::string Unparse(unsigned long long v) { return absl::StrCat(v); }

            

Reported by FlawFinder.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 169 Column: 52 CWE codes: 120

              std::string Unparse(short v) { return absl::StrCat(v); }
std::string Unparse(unsigned short v) { return absl::StrCat(v); }
std::string Unparse(int v) { return absl::StrCat(v); }
std::string Unparse(unsigned int v) { return absl::StrCat(v); }
std::string Unparse(long v) { return absl::StrCat(v); }
std::string Unparse(unsigned long v) { return absl::StrCat(v); }
std::string Unparse(long long v) { return absl::StrCat(v); }
std::string Unparse(unsigned long long v) { return absl::StrCat(v); }
template <typename T>

            

Reported by FlawFinder.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 170 Column: 44 CWE codes: 120

              std::string Unparse(unsigned short v) { return absl::StrCat(v); }
std::string Unparse(int v) { return absl::StrCat(v); }
std::string Unparse(unsigned int v) { return absl::StrCat(v); }
std::string Unparse(long v) { return absl::StrCat(v); }
std::string Unparse(unsigned long v) { return absl::StrCat(v); }
std::string Unparse(long long v) { return absl::StrCat(v); }
std::string Unparse(unsigned long long v) { return absl::StrCat(v); }
template <typename T>
std::string UnparseFloatingPointVal(T v) {

            

Reported by FlawFinder.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 171 Column: 53 CWE codes: 120

              std::string Unparse(int v) { return absl::StrCat(v); }
std::string Unparse(unsigned int v) { return absl::StrCat(v); }
std::string Unparse(long v) { return absl::StrCat(v); }
std::string Unparse(unsigned long v) { return absl::StrCat(v); }
std::string Unparse(long long v) { return absl::StrCat(v); }
std::string Unparse(unsigned long long v) { return absl::StrCat(v); }
template <typename T>
std::string UnparseFloatingPointVal(T v) {
  // digits10 is guaranteed to roundtrip correctly in string -> value -> string

            

Reported by FlawFinder.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 172 Column: 49 CWE codes: 120

              std::string Unparse(unsigned int v) { return absl::StrCat(v); }
std::string Unparse(long v) { return absl::StrCat(v); }
std::string Unparse(unsigned long v) { return absl::StrCat(v); }
std::string Unparse(long long v) { return absl::StrCat(v); }
std::string Unparse(unsigned long long v) { return absl::StrCat(v); }
template <typename T>
std::string UnparseFloatingPointVal(T v) {
  // digits10 is guaranteed to roundtrip correctly in string -> value -> string
  // conversions, but may not be enough to represent all the values correctly.

            

Reported by FlawFinder.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 173 Column: 58 CWE codes: 120

              std::string Unparse(long v) { return absl::StrCat(v); }
std::string Unparse(unsigned long v) { return absl::StrCat(v); }
std::string Unparse(long long v) { return absl::StrCat(v); }
std::string Unparse(unsigned long long v) { return absl::StrCat(v); }
template <typename T>
std::string UnparseFloatingPointVal(T v) {
  // digits10 is guaranteed to roundtrip correctly in string -> value -> string
  // conversions, but may not be enough to represent all the values correctly.
  std::string digit10_str =

            

Reported by FlawFinder.