The following issues were found

src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid32_fma.c
5 issues
Array '__bid_reciprocals10_128[0]' accessed at index -7, which is out of bounds.
Error

Line: 381 CWE codes: 786

                } 

      // get P*(2^M[extra_digits])/10^extra_digits
      __mul_128x128_full (Q_high, Q_low, P,
			  bid_reciprocals10_128[extra_digits]);
      // now get P/10^extra_digits: shift Q_high right by M[extra_digits]-128
      amount = bid_recip_scale[extra_digits];
      __shr_128_long (C128, Q_high, amount);


            

Reported by Cppcheck.

Array '__bid_recip_scale[0]' accessed at index -7, which is out of bounds.
Error

Line: 384 CWE codes: 786

                    __mul_128x128_full (Q_high, Q_low, P,
			  bid_reciprocals10_128[extra_digits]);
      // now get P/10^extra_digits: shift Q_high right by M[extra_digits]-128
      amount = bid_recip_scale[extra_digits];
      __shr_128_long (C128, Q_high, amount);

      C64 = __low_64 (C128);



            

Reported by Cppcheck.

Array '__bid_reciprocals10_128[0]' accessed at index -7, which is out of bounds.
Error

Line: 408 CWE codes: 786

              
	  // test whether fractional part is 0
	  if (!(remainder_h | rem_l)
	      && (Q_low.w[1] < bid_reciprocals10_128[extra_digits].w[1]
		  || (Q_low.w[1] == bid_reciprocals10_128[extra_digits].w[1]
		      && Q_low.w[0] <
		      bid_reciprocals10_128[extra_digits].w[0]))) {
	    C64--;
	  }

            

Reported by Cppcheck.

Array '__bid_reciprocals10_128[0]' accessed at index -7, which is out of bounds.
Error

Line: 409 CWE codes: 786

              	  // test whether fractional part is 0
	  if (!(remainder_h | rem_l)
	      && (Q_low.w[1] < bid_reciprocals10_128[extra_digits].w[1]
		  || (Q_low.w[1] == bid_reciprocals10_128[extra_digits].w[1]
		      && Q_low.w[0] <
		      bid_reciprocals10_128[extra_digits].w[0]))) {
	    C64--;
	  }
	}

            

Reported by Cppcheck.

Array '__bid_reciprocals10_128[0]' accessed at index -7, which is out of bounds.
Error

Line: 411 CWE codes: 786

              	      && (Q_low.w[1] < bid_reciprocals10_128[extra_digits].w[1]
		  || (Q_low.w[1] == bid_reciprocals10_128[extra_digits].w[1]
		      && Q_low.w[0] <
		      bid_reciprocals10_128[extra_digits].w[0]))) {
	    C64--;
	  }
	}
#endif


            

Reported by Cppcheck.

src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/packaging/zip.py
5 issues
Unused argument 'kw'
Error

Line: 33 Column: 1

              
from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot

def package(env, target, source, PACKAGEROOT, **kw):
    bld = env['BUILDERS']['Zip']
    bld.set_suffix('.zip')
    target, source = stripinstallbuilder(target, source, env)
    target, source = putintopackageroot(target, source, env, PACKAGEROOT)
    return bld(env, target, source)

            

Reported by Pylint.

Trailing whitespace
Error

Line: 8 Column: 2

              
#
# Copyright (c) 2001 - 2019 The SCons Foundation
# 
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to

            

Reported by Pylint.

Line too long (124/100)
Error

Line: 29 Column: 1

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

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

from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot

def package(env, target, source, PACKAGEROOT, **kw):
    bld = env['BUILDERS']['Zip']

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 33 Column: 1

              
from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot

def package(env, target, source, PACKAGEROOT, **kw):
    bld = env['BUILDERS']['Zip']
    bld.set_suffix('.zip')
    target, source = stripinstallbuilder(target, source, env)
    target, source = putintopackageroot(target, source, env, PACKAGEROOT)
    return bld(env, target, source)

            

Reported by Pylint.

Argument name "PACKAGEROOT" doesn't conform to snake_case naming style
Error

Line: 33 Column: 1

              
from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot

def package(env, target, source, PACKAGEROOT, **kw):
    bld = env['BUILDERS']['Zip']
    bld.set_suffix('.zip')
    target, source = stripinstallbuilder(target, source, env)
    target, source = putintopackageroot(target, source, env, PACKAGEROOT)
    return bld(env, target, source)

            

Reported by Pylint.

src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/packaging/src_zip.py
5 issues
Unused argument 'kw'
Error

Line: 33 Column: 1

              
from SCons.Tool.packaging import putintopackageroot

def package(env, target, source, PACKAGEROOT, **kw):
    bld = env['BUILDERS']['Zip']
    bld.set_suffix('.zip')
    target, source = putintopackageroot(target, source, env, PACKAGEROOT, honor_install_location=0)
    return bld(env, target, source)


            

Reported by Pylint.

Trailing whitespace
Error

Line: 8 Column: 2

              
#
# Copyright (c) 2001 - 2019 The SCons Foundation
# 
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to

            

Reported by Pylint.

Line too long (128/100)
Error

Line: 29 Column: 1

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

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

from SCons.Tool.packaging import putintopackageroot

def package(env, target, source, PACKAGEROOT, **kw):
    bld = env['BUILDERS']['Zip']

            

Reported by Pylint.

Argument name "PACKAGEROOT" doesn't conform to snake_case naming style
Error

Line: 33 Column: 1

              
from SCons.Tool.packaging import putintopackageroot

def package(env, target, source, PACKAGEROOT, **kw):
    bld = env['BUILDERS']['Zip']
    bld.set_suffix('.zip')
    target, source = putintopackageroot(target, source, env, PACKAGEROOT, honor_install_location=0)
    return bld(env, target, source)


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 33 Column: 1

              
from SCons.Tool.packaging import putintopackageroot

def package(env, target, source, PACKAGEROOT, **kw):
    bld = env['BUILDERS']['Zip']
    bld.set_suffix('.zip')
    target, source = putintopackageroot(target, source, env, PACKAGEROOT, honor_install_location=0)
    return bld(env, target, source)


            

Reported by Pylint.

src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/packaging/tarbz2.py
5 issues
Unused argument 'kw'
Error

Line: 33 Column: 1

              
from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot

def package(env, target, source, PACKAGEROOT, **kw):
    bld = env['BUILDERS']['Tar']
    bld.set_suffix('.tar.bz2')
    target, source = putintopackageroot(target, source, env, PACKAGEROOT)
    target, source = stripinstallbuilder(target, source, env)
    return bld(env, target, source, TARFLAGS='-jc')

            

Reported by Pylint.

Trailing whitespace
Error

Line: 8 Column: 2

              
#
# Copyright (c) 2001 - 2019 The SCons Foundation
# 
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to

            

Reported by Pylint.

Line too long (127/100)
Error

Line: 29 Column: 1

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

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

from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot

def package(env, target, source, PACKAGEROOT, **kw):
    bld = env['BUILDERS']['Tar']

            

Reported by Pylint.

Argument name "PACKAGEROOT" doesn't conform to snake_case naming style
Error

Line: 33 Column: 1

              
from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot

def package(env, target, source, PACKAGEROOT, **kw):
    bld = env['BUILDERS']['Tar']
    bld.set_suffix('.tar.bz2')
    target, source = putintopackageroot(target, source, env, PACKAGEROOT)
    target, source = stripinstallbuilder(target, source, env)
    return bld(env, target, source, TARFLAGS='-jc')

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 33 Column: 1

              
from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot

def package(env, target, source, PACKAGEROOT, **kw):
    bld = env['BUILDERS']['Tar']
    bld.set_suffix('.tar.bz2')
    target, source = putintopackageroot(target, source, env, PACKAGEROOT)
    target, source = stripinstallbuilder(target, source, env)
    return bld(env, target, source, TARFLAGS='-jc')

            

Reported by Pylint.

src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/packaging/targz.py
5 issues
Unused argument 'kw'
Error

Line: 33 Column: 1

              
from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot

def package(env, target, source, PACKAGEROOT, **kw):
    bld = env['BUILDERS']['Tar']
    bld.set_suffix('.tar.gz')
    target, source = stripinstallbuilder(target, source, env)
    target, source = putintopackageroot(target, source, env, PACKAGEROOT)
    return bld(env, target, source, TARFLAGS='-zc')

            

Reported by Pylint.

Trailing whitespace
Error

Line: 8 Column: 2

              
#
# Copyright (c) 2001 - 2019 The SCons Foundation
# 
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to

            

Reported by Pylint.

Line too long (126/100)
Error

Line: 29 Column: 1

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

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

from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot

def package(env, target, source, PACKAGEROOT, **kw):
    bld = env['BUILDERS']['Tar']

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 33 Column: 1

              
from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot

def package(env, target, source, PACKAGEROOT, **kw):
    bld = env['BUILDERS']['Tar']
    bld.set_suffix('.tar.gz')
    target, source = stripinstallbuilder(target, source, env)
    target, source = putintopackageroot(target, source, env, PACKAGEROOT)
    return bld(env, target, source, TARFLAGS='-zc')

            

Reported by Pylint.

Argument name "PACKAGEROOT" doesn't conform to snake_case naming style
Error

Line: 33 Column: 1

              
from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot

def package(env, target, source, PACKAGEROOT, **kw):
    bld = env['BUILDERS']['Tar']
    bld.set_suffix('.tar.gz')
    target, source = stripinstallbuilder(target, source, env)
    target, source = putintopackageroot(target, source, env, PACKAGEROOT)
    return bld(env, target, source, TARFLAGS='-zc')

            

Reported by Pylint.

src/third_party/wiredtiger/ext/test/fail_fs/fail_fs.c
5 issues
access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 507 Column: 16 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                  (void)file_system; /* Unused */
    (void)session;     /* Unused */

    *existp = (access(name, F_OK) == 0);
    return (0);
}

/*
 * fail_fs_open --

            

Reported by FlawFinder.

getenv - Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once
Security

Line: 484 Column: 18 CWE codes: 807 20
Suggestion: Check environment variables carefully before using them

                  char *s, *value;

    result = 0;
    if ((value = getenv(name)) != NULL) {
        s = value;
        if (strcmp(value, "true") == 0)
            result = 1;
        else if (strcmp(value, "false") != 0) {
            result = strtoll(value, &s, 10);

            

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: 557 Column: 20 CWE codes: 362

                   */
    if (file_type == WT_FS_OPEN_FILE_TYPE_DIRECTORY)
        fd = -1;
    else if ((fd = open(name, open_flags, 0666)) < 0) {
        ret = errno;
        goto err;
    }

    /* We create a handle structure for each open. */

            

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: 411 Column: 11 CWE codes: 126

              
    entries = NULL;
    allocated = count = 0;
    len = strlen(directory);
    prefix_len = prefix == NULL ? 0 : strlen(prefix);

    fail_fs_lock(&fail_fs->lock);
    TAILQ_FOREACH (fail_fh, &fail_fs->fileq, q) {
        name = fail_fh->iface.name;

            

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: 412 Column: 39 CWE codes: 126

                  entries = NULL;
    allocated = count = 0;
    len = strlen(directory);
    prefix_len = prefix == NULL ? 0 : strlen(prefix);

    fail_fs_lock(&fail_fs->lock);
    TAILQ_FOREACH (fail_fh, &fail_fs->fileq, q) {
        name = fail_fh->iface.name;
        if (strncmp(name, directory, len) != 0 ||

            

Reported by FlawFinder.

src/mongo/db/traffic_reader.cpp
4 issues
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: 211 Column: 22 CWE codes: 362

              
// Open the connection to the input file
#ifdef _WIN32
    auto inputFd = ::open(inputFile.c_str(), O_RDONLY | O_BINARY);
#else
    auto inputFd = ::open(inputFile.c_str(), O_RDONLY);
#endif

    uassert(ErrorCodes::FileNotOpen,

            

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: 213 Column: 22 CWE codes: 362

              #ifdef _WIN32
    auto inputFd = ::open(inputFile.c_str(), O_RDONLY | O_BINARY);
#else
    auto inputFd = ::open(inputFile.c_str(), O_RDONLY);
#endif

    uassert(ErrorCodes::FileNotOpen,
            str::stream() << "Specified file does not exist (" << inputFile << ")",
            inputFd > 0);

            

Reported by FlawFinder.

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

Line: 89 Column: 20 CWE codes: 120 20

              #ifdef _WIN32
        auto r = _read(fd, buf, toRead);
#else
        auto r = ::read(fd, buf, toRead);
#endif

        if (r == -1) {
            auto pair = errnoAndDescription();


            

Reported by FlawFinder.

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

Line: 116 Column: 35 CWE codes: 120 20

                  if (!readBytes(4, buf, fd)) {
        return boost::none;
    }
    auto len = ConstDataView(buf).read<LittleEndian<uint32_t>>();

    uassert(ErrorCodes::FailedToParse, "packet too large", len < MaxMessageSizeBytes);
    uassert(
        ErrorCodes::FailedToParse, "could not read full packet", readBytes(len - 4, buf + 4, fd));


            

Reported by FlawFinder.

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

Line: 42 Column: 1

              import SCons.Scanner.IDL
import SCons.Util

from .MSCommon import msvc_exists

def midl_emitter(target, source, env):
    """Produces a list of outputs from the MIDL compiler"""
    base, _ = SCons.Util.splitext(str(target[0]))
    tlb = target[0]

            

Reported by Pylint.

Line too long (115/100)
Error

Line: 34 Column: 1

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

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

import SCons.Action
import SCons.Builder
import SCons.Defaults
import SCons.Scanner.IDL

            

Reported by Pylint.

Line too long (159/100)
Error

Line: 78 Column: 1

              
    env['MIDL']          = 'MIDL.EXE'
    env['MIDLFLAGS']     = SCons.Util.CLVar('/nologo')
    env['MIDLCOM']       = '$MIDL $MIDLFLAGS /tlb ${TARGETS[0]} /h ${TARGETS[1]} /iid ${TARGETS[2]} /proxy ${TARGETS[3]} /dlldata ${TARGETS[4]} $SOURCE 2> NUL'
    env['BUILDERS']['TypeLibrary'] = midl_builder

def exists(env):
    return msvc_exists(env)


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 81 Column: 1

                  env['MIDLCOM']       = '$MIDL $MIDLFLAGS /tlb ${TARGETS[0]} /h ${TARGETS[1]} /iid ${TARGETS[2]} /proxy ${TARGETS[3]} /dlldata ${TARGETS[4]} $SOURCE 2> NUL'
    env['BUILDERS']['TypeLibrary'] = midl_builder

def exists(env):
    return msvc_exists(env)

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

            

Reported by Pylint.

src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
4 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

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

                  _wtOpenConfig = config;

    {
        char buf[(2 * 8 /*bytes in hex*/) + 1 /*nul terminator*/];
        invariantWTOK(_conn->query_timestamp(_conn, buf, "get=recovery"));

        std::uint64_t tmp;
        fassert(50758, NumberParser().base(16)(buf, &tmp));
        _recoveryTimestamp = Timestamp(tmp);

            

Reported by FlawFinder.

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

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

                  }

    {
        char buf[(2 * 8 /*bytes in hex*/) + 1 /*nul terminator*/];
        int ret = _conn->query_timestamp(_conn, buf, "get=oldest");
        if (ret != WT_NOTFOUND) {
            invariantWTOK(ret);

            std::uint64_t tmp;

            

Reported by FlawFinder.

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

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

              uint64_t _fetchAllDurableValue(WT_CONNECTION* conn) {
    // Fetch the latest all_durable value from the storage engine. This value will be a timestamp
    // that has no holes (uncommitted transactions with lower timestamps) behind it.
    char buf[(2 * 8 /*bytes in hex*/) + 1 /*nul terminator*/];
    auto wtStatus = conn->query_timestamp(conn, buf, "get=all_durable");
    if (wtStatus == WT_NOTFOUND) {
        // Treat this as lowest possible timestamp; we need to see all preexisting data but no new
        // (timestamped) data.
        return StorageEngine::kMinimumTimestamp;

            

Reported by FlawFinder.

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

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

              }

std::uint64_t WiredTigerKVEngine::_getCheckpointTimestamp() const {
    char buf[(2 * 8 /*bytes in hex*/) + 1 /*nul terminator*/];
    invariantWTOK(_conn->query_timestamp(_conn, buf, "get=last_checkpoint"));

    std::uint64_t tmp;
    fassert(50963, NumberParser().base(16)(buf, &tmp));
    return tmp;

            

Reported by FlawFinder.

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

Line: 39 Column: 1

              
import SCons.Defaults
from SCons.Scanner.Fortran import FortranScan
from .FortranCommon import add_all_to_env

def generate(env):
    """Add Builders and construction variables for ifort to an Environment."""
    # ifort supports Fortran 90 and Fortran 95
    # Additionally, ifort recognizes more file extensions.

            

Reported by Pylint.

Line too long (116/100)
Error

Line: 35 Column: 1

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

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

import SCons.Defaults
from SCons.Scanner.Fortran import FortranScan
from .FortranCommon import add_all_to_env


            

Reported by Pylint.

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

Line: 61 Column: 5

              
    add_all_to_env(env)

    fc = 'ifort'

    for dialect in ['F77', 'F90', 'FORTRAN', 'F95']:
        env['%s' % dialect] = fc
        env['SH%s' % dialect] = '$%s' % dialect
        if env['PLATFORM'] == 'posix':

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 81 Column: 1

                  else:
        env['FORTRANMODDIRPREFIX'] = "-module "

def exists(env):
    return env.Detect('ifort')

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

            

Reported by Pylint.