The following issues were found

src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/dvi.py
7 issues
Using the global statement
Error

Line: 41 Column: 9

                  try:
        env['BUILDERS']['DVI']
    except KeyError:
        global DVIBuilder

        if DVIBuilder is None:
            # The suffix is hard-coded to '.dvi', not configurable via a
            # construction variable like $DVISUFFIX, because the output
            # file name is hard-coded within TeX.

            

Reported by Pylint.

Unused argument 'env'
Error

Line: 55 Column: 12

              
        env['BUILDERS']['DVI'] = DVIBuilder

def exists(env):
    # This only puts a skeleton Builder in place, so if someone
    # references this Tool directly, it's always "available."
    return 1

# Local Variables:

            

Reported by Pylint.

Line too long (114/100)
Error

Line: 30 Column: 1

              # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#

__revision__ = "src/engine/SCons/Tool/dvi.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan"

import SCons.Builder
import SCons.Tool

DVIBuilder = None

            

Reported by Pylint.

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

Line: 35 Column: 1

              import SCons.Builder
import SCons.Tool

DVIBuilder = None

def generate(env):
    try:
        env['BUILDERS']['DVI']
    except KeyError:

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 37 Column: 1

              
DVIBuilder = None

def generate(env):
    try:
        env['BUILDERS']['DVI']
    except KeyError:
        global DVIBuilder


            

Reported by Pylint.

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

Line: 41 Column: 9

                  try:
        env['BUILDERS']['DVI']
    except KeyError:
        global DVIBuilder

        if DVIBuilder is None:
            # The suffix is hard-coded to '.dvi', not configurable via a
            # construction variable like $DVISUFFIX, because the output
            # file name is hard-coded within TeX.

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 55 Column: 1

              
        env['BUILDERS']['DVI'] = DVIBuilder

def exists(env):
    # This only puts a skeleton Builder in place, so if someone
    # references this Tool directly, it's always "available."
    return 1

# Local Variables:

            

Reported by Pylint.

src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/cvf.py
7 issues
Attempted relative import beyond top-level package
Error

Line: 32 Column: 1

              
__revision__ = "src/engine/SCons/Tool/cvf.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan"

from . import fortran

compilers = ['f90']

def generate(env):
    """Add Builders and construction variables for compaq visual fortran to an Environment."""

            

Reported by Pylint.

Line too long (114/100)
Error

Line: 30 Column: 1

              # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#

__revision__ = "src/engine/SCons/Tool/cvf.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan"

from . import fortran

compilers = ['f90']


            

Reported by Pylint.

Line too long (146/100)
Error

Line: 42 Column: 1

                  fortran.generate(env)

    env['FORTRAN']        = 'f90'
    env['FORTRANCOM']     = '$FORTRAN $FORTRANFLAGS $_FORTRANMODFLAG $_FORTRANINCFLAGS /compile_only ${SOURCES.windows} /object:${TARGET.windows}'
    env['FORTRANPPCOM']   = '$FORTRAN $FORTRANFLAGS $CPPFLAGS $_CPPDEFFLAGS $_FORTRANMODFLAG $_FORTRANINCFLAGS /compile_only ${SOURCES.windows} /object:${TARGET.windows}'
    env['SHFORTRANCOM']   = '$SHFORTRAN $SHFORTRANFLAGS $_FORTRANMODFLAG $_FORTRANINCFLAGS /compile_only ${SOURCES.windows} /object:${TARGET.windows}'
    env['SHFORTRANPPCOM'] = '$SHFORTRAN $SHFORTRANFLAGS $CPPFLAGS $_CPPDEFFLAGS $_FORTRANMODFLAG $_FORTRANINCFLAGS /compile_only ${SOURCES.windows} /object:${TARGET.windows}'
    env['OBJSUFFIX']      = '.obj'
    env['FORTRANMODDIR'] = '${TARGET.dir}'

            

Reported by Pylint.

Line too long (170/100)
Error

Line: 43 Column: 1

              
    env['FORTRAN']        = 'f90'
    env['FORTRANCOM']     = '$FORTRAN $FORTRANFLAGS $_FORTRANMODFLAG $_FORTRANINCFLAGS /compile_only ${SOURCES.windows} /object:${TARGET.windows}'
    env['FORTRANPPCOM']   = '$FORTRAN $FORTRANFLAGS $CPPFLAGS $_CPPDEFFLAGS $_FORTRANMODFLAG $_FORTRANINCFLAGS /compile_only ${SOURCES.windows} /object:${TARGET.windows}'
    env['SHFORTRANCOM']   = '$SHFORTRAN $SHFORTRANFLAGS $_FORTRANMODFLAG $_FORTRANINCFLAGS /compile_only ${SOURCES.windows} /object:${TARGET.windows}'
    env['SHFORTRANPPCOM'] = '$SHFORTRAN $SHFORTRANFLAGS $CPPFLAGS $_CPPDEFFLAGS $_FORTRANMODFLAG $_FORTRANINCFLAGS /compile_only ${SOURCES.windows} /object:${TARGET.windows}'
    env['OBJSUFFIX']      = '.obj'
    env['FORTRANMODDIR'] = '${TARGET.dir}'
    env['FORTRANMODDIRPREFIX'] = '/module:'

            

Reported by Pylint.

Line too long (150/100)
Error

Line: 44 Column: 1

                  env['FORTRAN']        = 'f90'
    env['FORTRANCOM']     = '$FORTRAN $FORTRANFLAGS $_FORTRANMODFLAG $_FORTRANINCFLAGS /compile_only ${SOURCES.windows} /object:${TARGET.windows}'
    env['FORTRANPPCOM']   = '$FORTRAN $FORTRANFLAGS $CPPFLAGS $_CPPDEFFLAGS $_FORTRANMODFLAG $_FORTRANINCFLAGS /compile_only ${SOURCES.windows} /object:${TARGET.windows}'
    env['SHFORTRANCOM']   = '$SHFORTRAN $SHFORTRANFLAGS $_FORTRANMODFLAG $_FORTRANINCFLAGS /compile_only ${SOURCES.windows} /object:${TARGET.windows}'
    env['SHFORTRANPPCOM'] = '$SHFORTRAN $SHFORTRANFLAGS $CPPFLAGS $_CPPDEFFLAGS $_FORTRANMODFLAG $_FORTRANINCFLAGS /compile_only ${SOURCES.windows} /object:${TARGET.windows}'
    env['OBJSUFFIX']      = '.obj'
    env['FORTRANMODDIR'] = '${TARGET.dir}'
    env['FORTRANMODDIRPREFIX'] = '/module:'
    env['FORTRANMODDIRSUFFIX'] = ''

            

Reported by Pylint.

Line too long (174/100)
Error

Line: 45 Column: 1

                  env['FORTRANCOM']     = '$FORTRAN $FORTRANFLAGS $_FORTRANMODFLAG $_FORTRANINCFLAGS /compile_only ${SOURCES.windows} /object:${TARGET.windows}'
    env['FORTRANPPCOM']   = '$FORTRAN $FORTRANFLAGS $CPPFLAGS $_CPPDEFFLAGS $_FORTRANMODFLAG $_FORTRANINCFLAGS /compile_only ${SOURCES.windows} /object:${TARGET.windows}'
    env['SHFORTRANCOM']   = '$SHFORTRAN $SHFORTRANFLAGS $_FORTRANMODFLAG $_FORTRANINCFLAGS /compile_only ${SOURCES.windows} /object:${TARGET.windows}'
    env['SHFORTRANPPCOM'] = '$SHFORTRAN $SHFORTRANFLAGS $CPPFLAGS $_CPPDEFFLAGS $_FORTRANMODFLAG $_FORTRANINCFLAGS /compile_only ${SOURCES.windows} /object:${TARGET.windows}'
    env['OBJSUFFIX']      = '.obj'
    env['FORTRANMODDIR'] = '${TARGET.dir}'
    env['FORTRANMODDIRPREFIX'] = '/module:'
    env['FORTRANMODDIRSUFFIX'] = ''


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 51 Column: 1

                  env['FORTRANMODDIRPREFIX'] = '/module:'
    env['FORTRANMODDIRSUFFIX'] = ''

def exists(env):
    return env.Detect(compilers)

# Local Variables:
# tab-width:4
# indent-tabs-mode:nil

            

Reported by Pylint.

src/third_party/boost/boost/log/sinks/syslog_backend.hpp
7 issues
syslog - If syslog's format strings can be influenced by an attacker, they can be exploited
Security

Line: 53 Column: 11 CWE codes: 134
Suggestion: Use a constant format string for syslog

                  v6
};

namespace syslog {

    //! The enumeration defined the possible implementation types for the syslog backend
    enum impl_types
    {
#ifdef BOOST_LOG_USE_NATIVE_SYSLOG

            

Reported by FlawFinder.

syslog - If syslog's format strings can be influenced by an attacker, they can be exploited
Security

Line: 165 Column: 46 CWE codes: 134
Suggestion: Use a constant format string for syslog

                  typedef base_type::string_type string_type;

    //! Syslog severity level mapper type
    typedef boost::log::aux::light_function< syslog::level (record_view const&) > severity_mapper_type;

private:
    //! Pointer to the implementation
    implementation* m_pImpl;


            

Reported by FlawFinder.

syslog - If syslog's format strings can be influenced by an attacker, they can be exploited
Security

Line: 264 Column: 39 CWE codes: 134
Suggestion: Use a constant format string for syslog

                  void construct(ArgsT const& args)
    {
        construct(
            args[keywords::facility | syslog::user],
#if !defined(BOOST_LOG_NO_ASIO)
            args[keywords::use_impl | syslog::udp_socket_based],
#else
            args[keywords::use_impl | syslog::native],
#endif

            

Reported by FlawFinder.

syslog - If syslog's format strings can be influenced by an attacker, they can be exploited
Security

Line: 266 Column: 39 CWE codes: 134
Suggestion: Use a constant format string for syslog

                      construct(
            args[keywords::facility | syslog::user],
#if !defined(BOOST_LOG_NO_ASIO)
            args[keywords::use_impl | syslog::udp_socket_based],
#else
            args[keywords::use_impl | syslog::native],
#endif
            args[keywords::ip_version | v4],
            args[keywords::ident | std::string()]);

            

Reported by FlawFinder.

syslog - If syslog's format strings can be influenced by an attacker, they can be exploited
Security

Line: 268 Column: 39 CWE codes: 134
Suggestion: Use a constant format string for syslog

              #if !defined(BOOST_LOG_NO_ASIO)
            args[keywords::use_impl | syslog::udp_socket_based],
#else
            args[keywords::use_impl | syslog::native],
#endif
            args[keywords::ip_version | v4],
            args[keywords::ident | std::string()]);
    }
    BOOST_LOG_API void construct(

            

Reported by FlawFinder.

syslog - If syslog's format strings can be influenced by an attacker, they can be exploited
Security

Line: 274 Column: 36 CWE codes: 134
Suggestion: Use a constant format string for syslog

                          args[keywords::ident | std::string()]);
    }
    BOOST_LOG_API void construct(
        syslog::facility facility, syslog::impl_types use_impl, ip_versions ip_version, std::string const& ident);
#endif // BOOST_LOG_DOXYGEN_PASS
};

} // namespace sinks


            

Reported by FlawFinder.

syslog - If syslog's format strings can be influenced by an attacker, they can be exploited
Security

Line: 274 Column: 9 CWE codes: 134
Suggestion: Use a constant format string for syslog

                          args[keywords::ident | std::string()]);
    }
    BOOST_LOG_API void construct(
        syslog::facility facility, syslog::impl_types use_impl, ip_versions ip_version, std::string const& ident);
#endif // BOOST_LOG_DOXYGEN_PASS
};

} // namespace sinks


            

Reported by FlawFinder.

src/third_party/wiredtiger/test/suite/test_txn21.py
7 issues
Unable to import 'wiredtiger'
Error

Line: 33 Column: 1

              #   Transactions: smoke test the operation timeout API
#

import wiredtiger, wttest

class test_txn21(wttest.WiredTigerTestCase):

    # Connection-level configuration.
    def test_operation_timeout_conn(self):

            

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

              #   Transactions: smoke test the operation timeout API
#

import wiredtiger, wttest

class test_txn21(wttest.WiredTigerTestCase):

    # Connection-level configuration.
    def test_operation_timeout_conn(self):

            

Reported by Pylint.

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

Line: 35 Column: 1

              
import wiredtiger, wttest

class test_txn21(wttest.WiredTigerTestCase):

    # Connection-level configuration.
    def test_operation_timeout_conn(self):
        # Close the automatically opened connection and open one with the timeout configuration.
        conn_config = 'operation_timeout_ms=2000'

            

Reported by Pylint.

Missing class docstring
Error

Line: 35 Column: 1

              
import wiredtiger, wttest

class test_txn21(wttest.WiredTigerTestCase):

    # Connection-level configuration.
    def test_operation_timeout_conn(self):
        # Close the automatically opened connection and open one with the timeout configuration.
        conn_config = 'operation_timeout_ms=2000'

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 38 Column: 5

              class test_txn21(wttest.WiredTigerTestCase):

    # Connection-level configuration.
    def test_operation_timeout_conn(self):
        # Close the automatically opened connection and open one with the timeout configuration.
        conn_config = 'operation_timeout_ms=2000'
        self.conn.close()
        self.conn = wiredtiger.wiredtiger_open(self.home, conn_config)


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 45 Column: 5

                      self.conn = wiredtiger.wiredtiger_open(self.home, conn_config)

    # Transaction-level configuration.
    def test_operation_timeout_txn(self):
        # Test during begin.
        self.session.begin_transaction('operation_timeout_ms=2000')
        self.session.rollback_transaction()

        # Test during rollback.

            

Reported by Pylint.

src/third_party/boost/boost/iostreams/filter/gzip.hpp
7 issues
read - Check buffer boundaries if used in a loop including recursive loops
Security

Line: 203 Column: 21 CWE codes: 120 20

                                         std::streamsize buffer_size = default_device_buffer_size );

    template<typename Source>
    std::streamsize read(Source& src, char_type* s, std::streamsize n)
    {
        std::streamsize result = 0;

        // Read header.
        if (!(flags_ & f_header_done))

            

Reported by FlawFinder.

read - Check buffer boundaries if used in a loop including recursive loops
Security

Line: 215 Column: 46 CWE codes: 120 20

                      if (!(flags_ & f_body_done)) {

            // Read from basic_zlib_filter.
            std::streamsize amt = base_type::read(src, s + result, n - result);
            if (amt != -1) {
                result += amt;
                if (amt < n - result) { // Double-check for EOF.
                    amt = base_type::read(src, s + result, n - result);
                    if (amt != -1)

            

Reported by FlawFinder.

read - Check buffer boundaries if used in a loop including recursive loops
Security

Line: 219 Column: 38 CWE codes: 120 20

                          if (amt != -1) {
                result += amt;
                if (amt < n - result) { // Double-check for EOF.
                    amt = base_type::read(src, s + result, n - result);
                    if (amt != -1)
                        result += amt;
                }
            }
            if (amt == -1)

            

Reported by FlawFinder.

read - Check buffer boundaries if used in a loop including recursive loops
Security

Line: 461 Column: 21 CWE codes: 120 20

                  }

    template<typename Source>
    std::streamsize read(Source& src, char_type* s, std::streamsize n)
    {
        typedef char_traits<char>  traits_type;
        std::streamsize            result = 0;
        peekable_source<Source>    peek(src, putback_);
        while (result < n && state_ != s_done) {

            

Reported by FlawFinder.

read - Check buffer boundaries if used in a loop including recursive loops
Security

Line: 485 Column: 36 CWE codes: 120 20

                          } else if (state_ == s_body) {
                try {
                    std::streamsize amt = 
                        base_type::read(peek, s + result, n - result);
                    if (amt != -1) {
                        result += amt;
                        if (amt < n - result)
                            break;
                    } else {

            

Reported by FlawFinder.

read - Check buffer boundaries if used in a loop including recursive loops
Security

Line: 573 Column: 25 CWE codes: 120 20

                      explicit peekable_source(Source& src, const string_type& putback = "") 
            : src_(src), putback_(putback), offset_(0)
            { }
        std::streamsize read(char* s, std::streamsize n)
        {
            std::streamsize result = 0;

            // Copy characters from putback buffer
            std::streamsize pbsize = 

            

Reported by FlawFinder.

read - Check buffer boundaries if used in a loop including recursive loops
Security

Line: 591 Column: 35 CWE codes: 120 20

              
            // Read characters from src_
            std::streamsize amt = 
                boost::iostreams::read(src_, s + result, n - result);
            return amt != -1 ? 
                result + amt : 
                result ? result : -1;
        }
        bool putback(char c)

            

Reported by FlawFinder.

src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/MSCommon/arch.py
7 issues
Unused import os
Error

Line: 29 Column: 1

              __doc__ = """Module to define supported Windows chip architectures.
"""

import os

class ArchDefinition(object):
    """
    A class for defining architecture-specific settings and logic.
    """

            

Reported by Pylint.

Dangerous default value [] as argument
Error

Line: 35 Column: 5

                  """
    A class for defining architecture-specific settings and logic.
    """
    def __init__(self, arch, synonyms=[]):
        self.arch = arch
        self.synonyms = synonyms

SupportedArchitectureList = [
    ArchDefinition(

            

Reported by Pylint.

Line too long (124/100)
Error

Line: 24 Column: 1

              # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#

__revision__ = "src/engine/SCons/Tool/MSCommon/arch.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan"

__doc__ = """Module to define supported Windows chip architectures.
"""

import os

            

Reported by Pylint.

Class 'ArchDefinition' inherits from object, can be safely removed from bases in python3
Error

Line: 31 Column: 1

              
import os

class ArchDefinition(object):
    """
    A class for defining architecture-specific settings and logic.
    """
    def __init__(self, arch, synonyms=[]):
        self.arch = arch

            

Reported by Pylint.

Too few public methods (0/2)
Error

Line: 31 Column: 1

              
import os

class ArchDefinition(object):
    """
    A class for defining architecture-specific settings and logic.
    """
    def __init__(self, arch, synonyms=[]):
        self.arch = arch

            

Reported by Pylint.

Trailing whitespace
Error

Line: 54 Column: 1

                      'ia64',
        ['IA64'],
    ),
    
    ArchDefinition(
        'arm',
        ['ARM'],
    ),


            

Reported by Pylint.

Trailing newlines
Error

Line: 67 Column: 1

                  SupportedArchitectureMap[a.arch] = a
    for s in a.synonyms:
        SupportedArchitectureMap[s] = a


            

Reported by Pylint.

src/third_party/boost/boost/interprocess/detail/os_file_functions.hpp
7 issues
chmod - This accepts filename arguments; if an attacker can move those files, a race condition results.
Security

Line: 496 Column: 41 CWE codes: 362
Suggestion: Use fchmod( ) instead

              {  return hnd.handle; }

inline bool create_directory(const char *path)
{  return ::mkdir(path, 0777) == 0 && ::chmod(path, 0777) == 0; }

inline bool remove_directory(const char *path)
{  return ::rmdir(path) == 0; }

inline bool get_temporary_path(char *buffer, std::size_t buf_len, std::size_t &required_len)

            

Reported by FlawFinder.

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

Line: 204 Column: 17 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

                       ;remaining > 0
         ;remaining -= write_size){
         const std::size_t DataSize = 512;
         static char data [DataSize];
         write_size = DataSize < remaining ? DataSize : remaining;
         unsigned long written;
         winapi::write_file(hnd, data, (unsigned long)write_size, &written, 0);
         if(written != write_size){
            return false;

            

Reported by FlawFinder.

strcpy - Does not check for buffer overflows when copying to destination [MS-banned]
Security

Line: 507 Column: 12 CWE codes: 120
Suggestion: Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused)

                 if(buf_len < required_len)
      return false;
   else{
      std::strcpy(buffer, "/tmp");
   }
   return true;
}

inline file_handle_t create_new_file

            

Reported by FlawFinder.

open - Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents?
Security

Line: 516 Column: 16 CWE codes: 362

                 (const char *name, mode_t mode, const permissions & perm = permissions(), bool temporary = false)
{
   (void)temporary;
   int ret = ::open(name, ((int)mode) | O_EXCL | O_CREAT, perm.get_permissions());
   if(ret >= 0){
      ::fchmod(ret, perm.get_permissions());
   }
   return ret;
}

            

Reported by FlawFinder.

open - Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents?
Security

Line: 531 Column: 15 CWE codes: 362

                 //We need a loop to change permissions correctly using fchmod, since
   //with "O_CREAT only" ::open we don't know if we've created or opened the file.
   while(true){
      ret = ::open(name, ((int)mode) | O_EXCL | O_CREAT, perm.get_permissions());
      if(ret >= 0){
         ::fchmod(ret, perm.get_permissions());
         break;
      }
      else if(errno == EEXIST){

            

Reported by FlawFinder.

open - Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents?
Security

Line: 537 Column: 22 CWE codes: 362

                       break;
      }
      else if(errno == EEXIST){
         if((ret = ::open(name, (int)mode)) >= 0 || errno != ENOENT){
            break;
         }
      }
      else{
         break;

            

Reported by FlawFinder.

open - Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents?
Security

Line: 552 Column: 13 CWE codes: 362

                 (const char *name, mode_t mode, bool temporary = false)
{
   (void)temporary;
   return ::open(name, (int)mode);
}

inline bool delete_file(const char *name)
{  return ::unlink(name) == 0;   }


            

Reported by FlawFinder.

src/third_party/boost/boost/dynamic_bitset/dynamic_bitset.hpp
7 issues
setstate - This function is not sufficiently random for security-related functions such as key and nonce creation
Security

Line: 1707 Column: 12 CWE codes: 327
Suggestion: Use a more secure technique for acquiring random values

                  } // if opfx

    if(err != ok)
        os.setstate(err); // assume this does NOT throw
    return os;

}
#else


            

Reported by FlawFinder.

setstate - This function is not sufficiently random for security-related functions such as key and nonce creation
Security

Line: 1780 Column: 28 CWE codes: 327
Suggestion: Use a more secure technique for acquiring random values

              
        } BOOST_CATCH (...) { // see std 27.6.1.1/4
            bool rethrow = false;
            BOOST_TRY { os.setstate(ios_base::failbit); } BOOST_CATCH (...) { rethrow = true; } BOOST_CATCH_END

            if (rethrow)
                BOOST_RETHROW;
        }
        BOOST_CATCH_END

            

Reported by FlawFinder.

setstate - This function is not sufficiently random for security-related functions such as key and nonce creation
Security

Line: 1789 Column: 12 CWE codes: 327
Suggestion: Use a more secure technique for acquiring random values

                  }

    if(err != ok)
        os.setstate(err); // may throw exception
    return os;

}
#endif


            

Reported by FlawFinder.

setstate - This function is not sufficiently random for security-related functions such as key and nonce creation
Security

Line: 1848 Column: 24 CWE codes: 327
Suggestion: Use a more secure technique for acquiring random values

                                  appender.do_append(char(c) == '1');
                }
                BOOST_CATCH(...) {
                    is.setstate(std::ios::failbit); // assume this can't throw
                    BOOST_RETHROW;
                }
                BOOST_CATCH_END
            }


            

Reported by FlawFinder.

setstate - This function is not sufficiently random for security-related functions such as key and nonce creation
Security

Line: 1861 Column: 12 CWE codes: 327
Suggestion: Use a more secure technique for acquiring random values

                  if (b.size() == 0)
        err |= std::ios::failbit;
    if (err != std::ios::goodbit)
        is.setstate (err); // may throw

    return is;
}

#else // BOOST_OLD_IOSTREAMS

            

Reported by FlawFinder.

setstate - This function is not sufficiently random for security-related functions such as key and nonce creation
Security

Line: 1923 Column: 28 CWE codes: 327
Suggestion: Use a more secure technique for acquiring random values

                          // append to the underlying vector (out of memory)

            bool rethrow = false;   // see std 27.6.1.1/4
            BOOST_TRY { is.setstate(ios_base::badbit); }
            BOOST_CATCH(...) { rethrow = true; }
            BOOST_CATCH_END

            if (rethrow)
                BOOST_RETHROW;

            

Reported by FlawFinder.

setstate - This function is not sufficiently random for security-related functions such as key and nonce creation
Security

Line: 1938 Column: 12 CWE codes: 327
Suggestion: Use a more secure technique for acquiring random values

                  if (b.size() == 0 /*|| !cerberos*/)
        err |= ios_base::failbit;
    if (err != ios_base::goodbit)
        is.setstate (err); // may throw

    return is;

}


            

Reported by FlawFinder.

src/mongo/base/data_type_terminated_test.cpp
7 issues
syntax error
Error

Line: 120

                  ASSERT_EQUALS(expected, buf.substr(0, buf.size() - avail));
}

TEST(DataTypeTerminated, StringDataNormalLoad) {
    const StringData writes[] = {StringData("a"), StringData("bb"), StringData("ccc")};
    std::string buf;
    for (const auto& w : writes) {
        buf += w.toString();
        buf += '\0';

            

Reported by Cppcheck.

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

Line: 154 Column: 5 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

              
TEST(DataTypeTerminated, StoreStatusOkAdvanced) {
    // Test that an OK .store sets proper 'advanced'.
    char buf[4] = {};
    size_t advanced = 123;  // should be overwritten
    Status s = DataType::store(Terminated<'\0', Dummy<3>>(), buf, sizeof(buf), &advanced, 0);
    ASSERT_OK(s);
    ASSERT_EQ(StringData(buf, 4), StringData(std::string{'d', 'd', 'd', '\0'}));
    ASSERT_EQUALS(advanced, 4u);  // OK must overwrite advanced

            

Reported by FlawFinder.

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

Line: 187 Column: 5 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

              
TEST(DataTypeTerminated, StoreStatusPropagation) {
    // Test that the nested type's .store complaints are surfaced.
    char in[2];  // Not big enough to hold a Dummy<3>.
    size_t advanced = 123;
    Status s = DataType::store(Terminated<'\0', Dummy<3>>(), in, sizeof(in), &advanced, 0);
    ASSERT_EQ(s.codeString(), "Overflow");
    ASSERT_STRING_CONTAINS(s.reason(), "insufficient space for Dummy");
    ASSERT_EQUALS(advanced, 123u);  // fails must not overwrite advanced

            

Reported by FlawFinder.

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

Line: 210 Column: 5 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

              }

TEST(DataTypeTerminated, ErrorShortWrite) {
    char in[3] = {};
    auto x = Terminated<'\0', Dummy<3>>();
    size_t advanced = 123;
    Status s = DataType::store(x, in, sizeof(in), &advanced, 0);
    ASSERT_EQ(s.codeString(), "Overflow");
    ASSERT_STRING_CONTAINS(s.reason(), "couldn't write");

            

Reported by FlawFinder.

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

Line: 221 Column: 5 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

              }

TEST(DataTypeTerminated, ThroughDataRangeCursor) {
    char buf[100];
    const std::string parts[] = {"a", "bb", "ccc"};
    std::string serialized;
    for (const std::string& s : parts) {
        serialized += s + '\0';
    }

            

Reported by FlawFinder.

read - Check buffer boundaries if used in a loop including recursive loops
Security

Line: 241 Column: 25 CWE codes: 120 20

                      for (const std::string& s : parts) {
            Terminated<'\0', ConstDataRange> tcdr;
            ASSERT_OK(buf_source.readAndAdvanceNoThrow(&tcdr));
            std::string read(tcdr.value.data(), tcdr.value.data() + tcdr.value.length());
            ASSERT_EQUALS(s, read);
        }
    }
}


            

Reported by FlawFinder.

read - Check buffer boundaries if used in a loop including recursive loops
Security

Line: 242 Column: 30 CWE codes: 120 20

                          Terminated<'\0', ConstDataRange> tcdr;
            ASSERT_OK(buf_source.readAndAdvanceNoThrow(&tcdr));
            std::string read(tcdr.value.data(), tcdr.value.data() + tcdr.value.length());
            ASSERT_EQUALS(s, read);
        }
    }
}

}  // namespace

            

Reported by FlawFinder.

src/third_party/wiredtiger/test/3rdparty/python-subunit-0.0.16/python/subunit/tests/test_filters.py
7 issues
Unable to import 'testtools'
Error

Line: 20 Column: 1

              import sys
from tempfile import NamedTemporaryFile

from testtools import TestCase

from subunit.filters import find_stream


class TestFindStream(TestCase):

            

Reported by Pylint.

Unused import sys
Error

Line: 17 Column: 1

              #  limitations under that license.
#

import sys
from tempfile import NamedTemporaryFile

from testtools import TestCase

from subunit.filters import find_stream

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              #
#  subunit: extensions to Python unittest to get test results from subprocesses.
#  Copyright (C) 2013  Robert Collins <robertc@robertcollins.net>
#
#  Licensed under either the Apache License, Version 2.0 or the BSD 3-clause
#  license at the users choice. A copy of both licenses are available in the
#  project source as Apache-2.0 and BSD. You may not use this file except in
#  compliance with one of these two licences.
#

            

Reported by Pylint.

Missing class docstring
Error

Line: 25 Column: 1

              from subunit.filters import find_stream


class TestFindStream(TestCase):

    def test_no_argv(self):
        self.assertEqual('foo', find_stream('foo', []))

    def test_opens_file(self):

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 27 Column: 5

              
class TestFindStream(TestCase):

    def test_no_argv(self):
        self.assertEqual('foo', find_stream('foo', []))

    def test_opens_file(self):
        f = NamedTemporaryFile()
        f.write(b'foo')

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 30 Column: 5

                  def test_no_argv(self):
        self.assertEqual('foo', find_stream('foo', []))

    def test_opens_file(self):
        f = NamedTemporaryFile()
        f.write(b'foo')
        f.flush()
        stream = find_stream('bar', [f.name])
        self.assertEqual(b'foo', stream.read())

            

Reported by Pylint.

Variable name "f" doesn't conform to snake_case naming style
Error

Line: 31 Column: 9

                      self.assertEqual('foo', find_stream('foo', []))

    def test_opens_file(self):
        f = NamedTemporaryFile()
        f.write(b'foo')
        f.flush()
        stream = find_stream('bar', [f.name])
        self.assertEqual(b'foo', stream.read())

            

Reported by Pylint.