The following issues were found

src/third_party/boost/boost/config/stdlib/libstdcpp3.hpp
1 issues
gets - Does not check for buffer overflows
Security

Line: 183 Column: 18 CWE codes: 120 20
Suggestion: Use fgets() instead

              #if (BOOST_LIBSTDCXX_VERSION < 50100)
// libstdc++ does not define this function as it's deprecated in C++11, but clang still looks for it,
// defining it here is a terrible cludge, but should get things working:
extern "C" char *gets (char *__s);
#endif
//
// clang is unable to parse some GCC headers, add those workarounds here:
//
#if BOOST_LIBSTDCXX_VERSION < 50000

            

Reported by FlawFinder.

src/third_party/boost/boost/concept_archetype.hpp
1 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 63 Column: 18 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 BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
          return *reinterpret_cast<T*>(0);
#else 
          static char d[sizeof(T)];
          return *reinterpret_cast<T*>(d);
#endif 
      }
  };


            

Reported by FlawFinder.

src/third_party/boost/boost/chrono/io/duration_put.hpp
1 issues
system - This causes a new program to execute and is difficult to use safely
Security

Line: 223 Column: 82 CWE codes: 78
Suggestion: try using a library call that implements the same functionality if available

                      *s++ = CharT(';');
        s = put_value(s, ios, fill, process_user_cpu_clock::duration(d.count().user));
        *s++ = CharT(';');
        s = put_value(s, ios, fill, process_system_cpu_clock::duration(d.count().system));
        *s++ = CharT('}');
        return s;
      }

      /**

            

Reported by FlawFinder.

src/third_party/boost/boost/chrono/io/duration_get.hpp
1 issues
system - This causes a new program to execute and is difficult to use safely
Security

Line: 404 Column: 99 CWE codes: 78
Suggestion: try using a library call that implements the same functionality if available

                          return s;
        }
        ++s;
        s = std::use_facet<std::num_get<CharT, iter_type> >(ios.getloc()).get(s, end, ios, err, r.system);
        if (s == end) {
            err |= std::ios_base::eofbit;
            return s;
        } else if (*s != '}') { // mandatory '}'
            err |= std::ios_base::failbit;

            

Reported by FlawFinder.

src/third_party/boost/boost/chrono/detail/static_assert.hpp
1 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 26 Column: 60 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

                  BOOST_MPL_ASSERT_MSG(boost::mpl::bool_< (CND) >::type::value, MSG, TYPES)
#else
//~ #elif defined(BOOST_CHRONO_USES_ARRAY_ASSERT)
#define BOOST_CHRONO_STATIC_ASSERT(CND, MSG, TYPES) static char BOOST_JOIN(boost_chrono_test_,__LINE__)[(CND)?1:-1]
//~ #define BOOST_CHRONO_STATIC_ASSERT(CND, MSG, TYPES)
#endif

#endif // BOOST_CHRONO_DETAIL_STATIC_ASSERT_HPP

            

Reported by FlawFinder.

src/third_party/boost/boost/chrono/detail/scan_keyword.hpp
1 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 66 Column: 14 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

                  const unsigned char doesnt_match = '\0';
    const unsigned char might_match = '\1';
    const unsigned char does_match = '\2';
    unsigned char statbuf[100];
    unsigned char* status = statbuf;
    //  Change free by free_aux to avoid
    // Error: Could not find a match for boost::interprocess::unique_ptr<unsigned char, void(*)(void*)>::unique_ptr(int, extern "C" void(void*))
    unique_ptr<unsigned char, void(*)(void*)> stat_hold(0, free_aux);
    if (nkw > sizeof(statbuf))

            

Reported by FlawFinder.

src/third_party/boost/boost/bind/bind.hpp
1 issues
equal - Function does not check the second iterator for over-read conditions
Security

Line: 1756 Column: 26 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

                  return bind_t<bool, name, list_type> ( name(), list_type(f, a2) ); \
}

BOOST_BIND_OPERATOR( ==, equal )
BOOST_BIND_OPERATOR( !=, not_equal )

BOOST_BIND_OPERATOR( <, less )
BOOST_BIND_OPERATOR( <=, less_equal )


            

Reported by FlawFinder.

src/mongo/db/s/config/sharding_catalog_manager_merge_chunks_test.cpp
1 issues
syntax error
Error

Line: 61

                  const KeyPattern _keyPattern{BSON("x" << 1)};
};

TEST_F(MergeChunkTest, MergeExistingChunksCorrectlyShouldSucceed) {
    const auto collEpoch = OID::gen();
    const boost::optional<Timestamp> collTimestamp(42);

    const auto collUuid = UUID::gen();
    ChunkType chunk;

            

Reported by Cppcheck.

src/mongo/db/s/config/sharding_catalog_manager_remove_shard_from_zone_test.cpp
1 issues
syntax error
Error

Line: 48

              
using RemoveShardFromZoneTest = ConfigServerTestFixture;

TEST_F(RemoveShardFromZoneTest, RemoveZoneThatNoLongerExistsShouldNotError) {
    ShardType shard;
    shard.setName("a");
    shard.setHost("a:1234");

    setupShards({shard});

            

Reported by Cppcheck.

src/mongo/db/s/config/sharding_catalog_manager_remove_shard_test.cpp
1 issues
syntax error
Error

Line: 113

                  OID _clusterId;
};

TEST_F(RemoveShardTest, RemoveShardAnotherShardDraining) {

    ShardType shard1;
    shard1.setName("shard1");
    shard1.setHost("host1:12345");
    shard1.setMaxSizeMB(100);

            

Reported by Cppcheck.