The following issues were found

src/third_party/wiredtiger/lang/python/wiredtiger/packing.py
24 issues
Unable to import 'wiredtiger.packutil'
Error

Line: 52 Column: 1

                u     bytes   raw byte array
"""

from wiredtiger.packutil import _chr, _is_string, _ord, _string_result, \
    empty_pack, x00
from wiredtiger.intpacking import pack_int, unpack_int

def __get_type(fmt):
    if not fmt:

            

Reported by Pylint.

Unable to import 'wiredtiger.intpacking'
Error

Line: 54 Column: 1

              
from wiredtiger.packutil import _chr, _is_string, _ord, _string_result, \
    empty_pack, x00
from wiredtiger.intpacking import pack_int, unpack_int

def __get_type(fmt):
    if not fmt:
        return None, fmt
    # Variable-sized encoding is the default (and only supported format in v1)

            

Reported by Pylint.

Unused variable 'i'
Error

Line: 121 Column: 17

                          s = s[1:]
        elif f in 'Bb':
            # byte type
            for i in range(size):
                v = _ord(s[0])
                if f != 'B':
                    v -= 0x80
                result.append(v)
                s = s[1:]

            

Reported by Pylint.

Unused variable 'j'
Error

Line: 129 Column: 17

                              s = s[1:]
        else:
            # integral type
            for j in range(size):
                v, s = unpack_int(s)
                result.append(v)
    return result

def __pack_iter_fmt(fmt, values):

            

Reported by Pylint.

Unused variable 'i'
Error

Line: 144 Column: 17

                          index += 1
        else:            # integral type
            size = size if havesize else 1
            for i in range(size):
                value = values[index]
                yield offset, havesize, 1, char, value
                index = index + 1

def pack(fmt, *values):

            

Reported by Pylint.

Unused variable 'i'
Error

Line: 156 Column: 5

                  if tfmt != '.':
        raise ValueError('Only variable-length encoding is currently supported')
    result = empty_pack
    i = 0
    for offset, havesize, size, f, val in __pack_iter_fmt(fmt, values):
        if f == 'x':
            if not havesize:
                result += x00
            else:

            

Reported by Pylint.

Too many branches (20/12)
Error

Line: 81 Column: 1

                          size = 0
            havesize = 0

def unpack(fmt, s):
    tfmt, fmt = __get_type(fmt)
    if not fmt:
        return ()
    if tfmt != '.':
        raise ValueError('Only variable-length encoding is currently supported')

            

Reported by Pylint.

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

Line: 81 Column: 1

                          size = 0
            havesize = 0

def unpack(fmt, s):
    tfmt, fmt = __get_type(fmt)
    if not fmt:
        return ()
    if tfmt != '.':
        raise ValueError('Only variable-length encoding is currently supported')

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 81 Column: 1

                          size = 0
            havesize = 0

def unpack(fmt, s):
    tfmt, fmt = __get_type(fmt)
    if not fmt:
        return ()
    if tfmt != '.':
        raise ValueError('Only variable-length encoding is currently supported')

            

Reported by Pylint.

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

Line: 88 Column: 33

                  if tfmt != '.':
        raise ValueError('Only variable-length encoding is currently supported')
    result = []
    for offset, havesize, size, f in __unpack_iter_fmt(fmt):
        if f == 'x':
            s = s[size:]
            # Note: no value, don't increment i
        elif f in 'SsUu':
            if not havesize:

            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_cursor05.py
23 issues
Unable to import 'wiredtiger'
Error

Line: 29 Column: 1

              # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.

import wiredtiger, wttest

# test_cursor05.py
#    Test cursors at the point where a cursor is first initialized, and when it
# hits an endpoint.  Mix that in with column groups.
class test_cursor05(wttest.WiredTigerTestCase):

            

Reported by Pylint.

Unused import wiredtiger
Error

Line: 29 Column: 1

              # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.

import wiredtiger, wttest

# test_cursor05.py
#    Test cursors at the point where a cursor is first initialized, and when it
# hits an endpoint.  Mix that in with column groups.
class test_cursor05(wttest.WiredTigerTestCase):

            

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: 29 Column: 1

              # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.

import wiredtiger, wttest

# test_cursor05.py
#    Test cursors at the point where a cursor is first initialized, and when it
# hits an endpoint.  Mix that in with column groups.
class test_cursor05(wttest.WiredTigerTestCase):

            

Reported by Pylint.

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

Line: 34 Column: 1

              # test_cursor05.py
#    Test cursors at the point where a cursor is first initialized, and when it
# hits an endpoint.  Mix that in with column groups.
class test_cursor05(wttest.WiredTigerTestCase):
    """
    Test basic operations
    """
    nentries = 2


            

Reported by Pylint.

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

Line: 50 Column: 37

                  def check_iterate_forward(self, cursor, expectcount):
        """ Use the cursor to iterate and check for the expected entries. """
        i = 0
        for ikey, skey, s1, i2, s3, i4 in cursor:
            #print 'forward: ' + str([ikey, skey, s1, i2, s3, i4])
            self.assertEqual(ikey, i)
            self.assertEqual(skey, 'key' + str(i))
            self.assertEqual(s1, 'val' + str(i))
            self.assertEqual(i2, i)

            

Reported by Pylint.

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

Line: 50 Column: 33

                  def check_iterate_forward(self, cursor, expectcount):
        """ Use the cursor to iterate and check for the expected entries. """
        i = 0
        for ikey, skey, s1, i2, s3, i4 in cursor:
            #print 'forward: ' + str([ikey, skey, s1, i2, s3, i4])
            self.assertEqual(ikey, i)
            self.assertEqual(skey, 'key' + str(i))
            self.assertEqual(s1, 'val' + str(i))
            self.assertEqual(i2, i)

            

Reported by Pylint.

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

Line: 50 Column: 29

                  def check_iterate_forward(self, cursor, expectcount):
        """ Use the cursor to iterate and check for the expected entries. """
        i = 0
        for ikey, skey, s1, i2, s3, i4 in cursor:
            #print 'forward: ' + str([ikey, skey, s1, i2, s3, i4])
            self.assertEqual(ikey, i)
            self.assertEqual(skey, 'key' + str(i))
            self.assertEqual(s1, 'val' + str(i))
            self.assertEqual(i2, i)

            

Reported by Pylint.

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

Line: 50 Column: 25

                  def check_iterate_forward(self, cursor, expectcount):
        """ Use the cursor to iterate and check for the expected entries. """
        i = 0
        for ikey, skey, s1, i2, s3, i4 in cursor:
            #print 'forward: ' + str([ikey, skey, s1, i2, s3, i4])
            self.assertEqual(ikey, i)
            self.assertEqual(skey, 'key' + str(i))
            self.assertEqual(s1, 'val' + str(i))
            self.assertEqual(i2, i)

            

Reported by Pylint.

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

Line: 67 Column: 14

                      while cursor.prev() == 0:
            i -= 1
            (ikey, skey) = cursor.get_keys()
            (s1, i2, s3, i4) = cursor.get_values()
            #print 'backward: ' + str([ikey, skey, s1, i2, s3, i4])
            self.assertEqual(ikey, i)
            self.assertEqual(skey, 'key' + str(i))
            self.assertEqual(s1, 'val' + str(i))
            self.assertEqual(i2, i)

            

Reported by Pylint.

src/third_party/mozjs-60/extract/js/src/jit/mips-shared/CodeGenerator-mips-shared.cpp
23 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: 1889 Column: 26 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                      ptrScratch = ToRegister(lir->ptrCopy());
    }

    if (IsUnaligned(mir->access())) {
        if (IsFloatingPointType(mir->type())) {
            masm.wasmUnalignedLoadFP(mir->access(), HeapReg, ToRegister(lir->ptr()), ptrScratch,
                                     ToFloatRegister(lir->output()), ToRegister(lir->getTemp(1)),
                                     InvalidReg, InvalidReg);
        } else {

            

Reported by FlawFinder.

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: 1891 Column: 43 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

              
    if (IsUnaligned(mir->access())) {
        if (IsFloatingPointType(mir->type())) {
            masm.wasmUnalignedLoadFP(mir->access(), HeapReg, ToRegister(lir->ptr()), ptrScratch,
                                     ToFloatRegister(lir->output()), ToRegister(lir->getTemp(1)),
                                     InvalidReg, InvalidReg);
        } else {
            masm.wasmUnalignedLoad(mir->access(), HeapReg, ToRegister(lir->ptr()),
                                   ptrScratch, ToRegister(lir->output()), ToRegister(lir->getTemp(1)));

            

Reported by FlawFinder.

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: 1895 Column: 41 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                                                   ToFloatRegister(lir->output()), ToRegister(lir->getTemp(1)),
                                     InvalidReg, InvalidReg);
        } else {
            masm.wasmUnalignedLoad(mir->access(), HeapReg, ToRegister(lir->ptr()),
                                   ptrScratch, ToRegister(lir->output()), ToRegister(lir->getTemp(1)));
        }
    } else {
        masm.wasmLoad(mir->access(), HeapReg, ToRegister(lir->ptr()), ptrScratch,
                      ToAnyRegister(lir->output()));

            

Reported by FlawFinder.

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: 1899 Column: 28 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                                                 ptrScratch, ToRegister(lir->output()), ToRegister(lir->getTemp(1)));
        }
    } else {
        masm.wasmLoad(mir->access(), HeapReg, ToRegister(lir->ptr()), ptrScratch,
                      ToAnyRegister(lir->output()));
    }
}

void

            

Reported by FlawFinder.

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: 1927 Column: 26 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                      ptrScratch = ToRegister(lir->ptrCopy());
    }

    if (IsUnaligned(mir->access())) {
        if (mir->access().type() == Scalar::Float32 ||
            mir->access().type() == Scalar::Float64) {
            masm.wasmUnalignedStoreFP(mir->access(), ToFloatRegister(lir->value()),
                                      HeapReg, ToRegister(lir->ptr()), ptrScratch,
                                      ToRegister(lir->getTemp(1)));

            

Reported by FlawFinder.

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: 1928 Column: 18 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                  }

    if (IsUnaligned(mir->access())) {
        if (mir->access().type() == Scalar::Float32 ||
            mir->access().type() == Scalar::Float64) {
            masm.wasmUnalignedStoreFP(mir->access(), ToFloatRegister(lir->value()),
                                      HeapReg, ToRegister(lir->ptr()), ptrScratch,
                                      ToRegister(lir->getTemp(1)));
        } else {

            

Reported by FlawFinder.

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: 1929 Column: 18 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

              
    if (IsUnaligned(mir->access())) {
        if (mir->access().type() == Scalar::Float32 ||
            mir->access().type() == Scalar::Float64) {
            masm.wasmUnalignedStoreFP(mir->access(), ToFloatRegister(lir->value()),
                                      HeapReg, ToRegister(lir->ptr()), ptrScratch,
                                      ToRegister(lir->getTemp(1)));
        } else {
            masm.wasmUnalignedStore(mir->access(), ToRegister(lir->value()), HeapReg,

            

Reported by FlawFinder.

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: 1930 Column: 44 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                  if (IsUnaligned(mir->access())) {
        if (mir->access().type() == Scalar::Float32 ||
            mir->access().type() == Scalar::Float64) {
            masm.wasmUnalignedStoreFP(mir->access(), ToFloatRegister(lir->value()),
                                      HeapReg, ToRegister(lir->ptr()), ptrScratch,
                                      ToRegister(lir->getTemp(1)));
        } else {
            masm.wasmUnalignedStore(mir->access(), ToRegister(lir->value()), HeapReg,
                                    ToRegister(lir->ptr()), ptrScratch,

            

Reported by FlawFinder.

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: 1934 Column: 42 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                                                    HeapReg, ToRegister(lir->ptr()), ptrScratch,
                                      ToRegister(lir->getTemp(1)));
        } else {
            masm.wasmUnalignedStore(mir->access(), ToRegister(lir->value()), HeapReg,
                                    ToRegister(lir->ptr()), ptrScratch,
                                    ToRegister(lir->getTemp(1)));
        }
    } else {
        masm.wasmStore(mir->access(), ToAnyRegister(lir->value()), HeapReg,

            

Reported by FlawFinder.

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: 1939 Column: 29 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                                                  ToRegister(lir->getTemp(1)));
        }
    } else {
        masm.wasmStore(mir->access(), ToAnyRegister(lir->value()), HeapReg,
                       ToRegister(lir->ptr()), ptrScratch);
    }
}

void

            

Reported by FlawFinder.

src/third_party/wiredtiger/test/suite/test_rollback_to_stable16.py
23 issues
Unable to import 'wiredtiger'
Error

Line: 35 Column: 1

              
import os, shutil
from helper import simulate_crash_restart
import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios

# test_rollback_to_stable16.py

            

Reported by Pylint.

Unable to import 'wiredtiger'
Error

Line: 36 Column: 1

              import os, shutil
from helper import simulate_crash_restart
import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios

# test_rollback_to_stable16.py
# Test that rollback to stable removes updates present on disk for column store.

            

Reported by Pylint.

An attribute defined in wttest line 401 hides this method
Error

Line: 65 Column: 5

              
    scenarios = make_scenarios(key_format_values, value_format_values, in_memory_values)

    def conn_config(self):
        config = 'cache_size=200MB,statistics=(all)'
        if self.in_memory:
            config += ',in_memory=true'
        else:
            config += ',in_memory=false'

            

Reported by Pylint.

Unused import os
Error

Line: 33 Column: 1

              # rollback_to_stable
# [END_TAGS]

import os, shutil
from helper import simulate_crash_restart
import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios

            

Reported by Pylint.

Unused import shutil
Error

Line: 33 Column: 1

              # rollback_to_stable
# [END_TAGS]

import os, shutil
from helper import simulate_crash_restart
import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios

            

Reported by Pylint.

Unused SimpleDataSet imported from wtdataset
Error

Line: 37 Column: 1

              from helper import simulate_crash_restart
import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios

# test_rollback_to_stable16.py
# Test that rollback to stable removes updates present on disk for column store.
class test_rollback_to_stable16(wttest.WiredTigerTestCase):

            

Reported by Pylint.

FIXME: WT-7304 Fixed length column store failing on rollback on disk values
Error

Line: 52 Column: 2

              
    value_format_values = [
        # Fixed length
        #FIXME: WT-7304 Fixed length column store failing on rollback on disk values
        # ('fixed', dict(value_format='8t')),
        # Variable length
        ('variable', dict(value_format='S')),
    ]


            

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 (os, shutil)
Error

Line: 33 Column: 1

              # rollback_to_stable
# [END_TAGS]

import os, shutil
from helper import simulate_crash_restart
import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios

            

Reported by Pylint.

third party import "import wiredtiger, wttest" should be placed before "from helper import simulate_crash_restart"
Error

Line: 35 Column: 1

              
import os, shutil
from helper import simulate_crash_restart
import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios

# test_rollback_to_stable16.py

            

Reported by Pylint.

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

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

              
namespace sinks {

namespace syslog {

    //! The function constructs log record level from an integer
    BOOST_LOG_API level make_level(int lev)
    {
        if (BOOST_UNLIKELY(static_cast< unsigned int >(lev) >= 8u))

            

Reported by FlawFinder.

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

Line: 113 Column: 23 CWE codes: 134
Suggestion: Use a constant format string for syslog

                  virtual ~implementation() {}

    //! The method sends the formatted message to the syslog host
    virtual void send(syslog::level lev, string_type const& formatted_message) = 0;
};


////////////////////////////////////////////////////////////////////////////////
//  Native syslog API support

            

Reported by FlawFinder.

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

Line: 191 Column: 12 CWE codes: 134
Suggestion: Use a constant format string for syslog

                  const shared_ptr< native_syslog_initializer > m_pSyslogInitializer;

    //! Constructor
    native(syslog::facility const& fac, std::string const& ident) :
        implementation(convert_facility(fac)),
        m_pSyslogInitializer(native_syslog_initializer::get_instance(ident, this->m_Facility))
    {
    }


            

Reported by FlawFinder.

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

Line: 198 Column: 15 CWE codes: 134
Suggestion: Use a constant format string for syslog

                  }

    //! The method sends the formatted message to the syslog host
    void send(syslog::level lev, string_type const& formatted_message) BOOST_OVERRIDE
    {
        int native_level;
        switch (lev)
        {
        case syslog::emergency:

            

Reported by FlawFinder.

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

Line: 203 Column: 14 CWE codes: 134
Suggestion: Use a constant format string for syslog

                      int native_level;
        switch (lev)
        {
        case syslog::emergency:
            native_level = LOG_EMERG; break;
        case syslog::alert:
            native_level = LOG_ALERT; break;
        case syslog::critical:
            native_level = LOG_CRIT; break;

            

Reported by FlawFinder.

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

Line: 205 Column: 14 CWE codes: 134
Suggestion: Use a constant format string for syslog

                      {
        case syslog::emergency:
            native_level = LOG_EMERG; break;
        case syslog::alert:
            native_level = LOG_ALERT; break;
        case syslog::critical:
            native_level = LOG_CRIT; break;
        case syslog::error:
            native_level = LOG_ERR; break;

            

Reported by FlawFinder.

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

Line: 207 Column: 14 CWE codes: 134
Suggestion: Use a constant format string for syslog

                          native_level = LOG_EMERG; break;
        case syslog::alert:
            native_level = LOG_ALERT; break;
        case syslog::critical:
            native_level = LOG_CRIT; break;
        case syslog::error:
            native_level = LOG_ERR; break;
        case syslog::warning:
            native_level = LOG_WARNING; break;

            

Reported by FlawFinder.

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

Line: 209 Column: 14 CWE codes: 134
Suggestion: Use a constant format string for syslog

                          native_level = LOG_ALERT; break;
        case syslog::critical:
            native_level = LOG_CRIT; break;
        case syslog::error:
            native_level = LOG_ERR; break;
        case syslog::warning:
            native_level = LOG_WARNING; break;
        case syslog::notice:
            native_level = LOG_NOTICE; break;

            

Reported by FlawFinder.

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

Line: 211 Column: 14 CWE codes: 134
Suggestion: Use a constant format string for syslog

                          native_level = LOG_CRIT; break;
        case syslog::error:
            native_level = LOG_ERR; break;
        case syslog::warning:
            native_level = LOG_WARNING; break;
        case syslog::notice:
            native_level = LOG_NOTICE; break;
        case syslog::debug:
            native_level = LOG_DEBUG; break;

            

Reported by FlawFinder.

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

Line: 213 Column: 14 CWE codes: 134
Suggestion: Use a constant format string for syslog

                          native_level = LOG_ERR; break;
        case syslog::warning:
            native_level = LOG_WARNING; break;
        case syslog::notice:
            native_level = LOG_NOTICE; break;
        case syslog::debug:
            native_level = LOG_DEBUG; break;
        default:
            native_level = LOG_INFO; break;

            

Reported by FlawFinder.

src/third_party/wiredtiger/test/suite/test_rollback_to_stable17.py
23 issues
Unable to import 'wiredtiger'
Error

Line: 31 Column: 1

              
import os, shutil
from helper import simulate_crash_restart
import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios

# test_rollback_to_stable17.py

            

Reported by Pylint.

Unable to import 'wiredtiger'
Error

Line: 32 Column: 1

              import os, shutil
from helper import simulate_crash_restart
import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios

# test_rollback_to_stable17.py
# Test that rollback to stable handles updates present on history store and data store for variable

            

Reported by Pylint.

An attribute defined in wttest line 401 hides this method
Error

Line: 54 Column: 5

              
    scenarios = make_scenarios(key_format_values, in_memory_values)

    def conn_config(self):
        config = 'cache_size=200MB,statistics=(all)'
        if self.in_memory:
            config += ',in_memory=true'
        else:
            config += ',in_memory=false'

            

Reported by Pylint.

Unused import os
Error

Line: 29 Column: 1

              # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.

import os, shutil
from helper import simulate_crash_restart
import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios

            

Reported by Pylint.

Unused import shutil
Error

Line: 29 Column: 1

              # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.

import os, shutil
from helper import simulate_crash_restart
import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios

            

Reported by Pylint.

Unused import wiredtiger
Error

Line: 31 Column: 1

              
import os, shutil
from helper import simulate_crash_restart
import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios

# test_rollback_to_stable17.py

            

Reported by Pylint.

Unused SimpleDataSet imported from wtdataset
Error

Line: 33 Column: 1

              from helper import simulate_crash_restart
import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios

# test_rollback_to_stable17.py
# Test that rollback to stable handles updates present on history store and data store for variable
# length column store.

            

Reported by Pylint.

Unused variable 'k'
Error

Line: 76 Column: 13

                      cursor = session.open_cursor(uri)

        count = 0
        for k, v in cursor:
            self.assertEqual(v, check_value)
            count += 1

        session.commit_transaction()
        self.assertEqual(count, nrows)

            

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 (os, shutil)
Error

Line: 29 Column: 1

              # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.

import os, shutil
from helper import simulate_crash_restart
import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios

            

Reported by Pylint.

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

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

                          process_times()
                : real(0)
                , user(0)
                , system(0){}

#if ! defined BOOST_CHRONO_DONT_PROVIDES_DEPRECATED_IO_SINCE_V2_0_0
            template <typename Rep2>
            explicit process_times(
                Rep2 r)

            

Reported by FlawFinder.

system - This causes a new program to execute and is difficult to use safely
Security

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

                              Rep2 r)
                : real(r)
                , user(r)
                , system(r){}
#endif
            template <typename Rep2>
            explicit process_times(
                process_times<Rep2> const& rhs)
                : real(rhs.real)

            

Reported by FlawFinder.

system - This causes a new program to execute and is difficult to use safely
Security

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

                              process_times<Rep2> const& rhs)
                : real(rhs.real)
                , user(rhs.user)
                , system(rhs.system){}
            process_times(
                rep r,
                rep u,
                rep s)
                : real(r)

            

Reported by FlawFinder.

system - This causes a new program to execute and is difficult to use safely
Security

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

                              process_times<Rep2> const& rhs)
                : real(rhs.real)
                , user(rhs.user)
                , system(rhs.system){}
            process_times(
                rep r,
                rep u,
                rep s)
                : real(r)

            

Reported by FlawFinder.

system - This causes a new program to execute and is difficult to use safely
Security

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

                              rep s)
                : real(r)
                , user(u)
                , system(s){}

            rep   real;    // real (i.e wall clock) time
            rep   user;    // user cpu time
            rep system;  // system cpu time


            

Reported by FlawFinder.

system - This causes a new program to execute and is difficult to use safely
Security

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

              
            rep   real;    // real (i.e wall clock) time
            rep   user;    // user cpu time
            rep system;  // system cpu time

#if ! defined BOOST_CHRONO_DONT_PROVIDES_DEPRECATED_IO_SINCE_V2_0_0
            operator rep() const
            {
              return real;

            

Reported by FlawFinder.

system - This causes a new program to execute and is difficult to use safely
Security

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

                          bool operator==(process_times<Rep2> const& rhs) {
                return (real==rhs.real &&
                        user==rhs.user &&
                        system==rhs.system);
            }

            process_times& operator+=(
                process_times const& rhs)
            {

            

Reported by FlawFinder.

system - This causes a new program to execute and is difficult to use safely
Security

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

                          {
                real+=rhs.real;
                user+=rhs.user;
                system+=rhs.system;
                return *this;
            }
            process_times& operator-=(
                process_times const& rhs)
            {

            

Reported by FlawFinder.

system - This causes a new program to execute and is difficult to use safely
Security

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

                          {
                real-=rhs.real;
                user-=rhs.user;
                system-=rhs.system;
                return *this;
            }
            process_times& operator*=(
                process_times const& rhs)
            {

            

Reported by FlawFinder.

system - This causes a new program to execute and is difficult to use safely
Security

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

                          {
                real*=rhs.real;
                user*=rhs.user;
                system*=rhs.system;
                return *this;
            }
            process_times& operator*=(rep const& rhs)
            {
                real*=rhs;

            

Reported by FlawFinder.

src/third_party/wiredtiger/test/suite/test_prepare03.py
23 issues
Unable to import 'wiredtiger'
Error

Line: 29 Column: 1

              # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.

import wiredtiger, wttest
from wtscenario import make_scenarios

# test_prepare03.py
#    Prepare: Cursor API usage generates expected error in prepared state.


            

Reported by Pylint.

Lambda may not be necessary
Error

Line: 96 Column: 17

                          cursor.set_value(self.genvalue(i))
            self.session.prepare_transaction("prepare_timestamp=2a")
            self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
                lambda:cursor.insert(), preparemsg)
            self.session.timestamp_transaction("commit_timestamp=2b")
            self.session.timestamp_transaction("durable_timestamp=2b")
            self.session.commit_transaction()
            cursor.insert()


            

Reported by Pylint.

Lambda may not be necessary
Error

Line: 111 Column: 17

                          self.session.begin_transaction()
            self.session.prepare_transaction("prepare_timestamp=2a")
            self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
                lambda:cursor.next(), preparemsg)
            self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
                lambda:cursor.get_key(), preparemsg)
            self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
                lambda:cursor.get_value(), preparemsg)
            self.session.timestamp_transaction("commit_timestamp=2b")

            

Reported by Pylint.

Lambda may not be necessary
Error

Line: 113 Column: 17

                          self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
                lambda:cursor.next(), preparemsg)
            self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
                lambda:cursor.get_key(), preparemsg)
            self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
                lambda:cursor.get_value(), preparemsg)
            self.session.timestamp_transaction("commit_timestamp=2b")
            self.session.timestamp_transaction("durable_timestamp=2b")
            self.session.commit_transaction()

            

Reported by Pylint.

Lambda may not be necessary
Error

Line: 115 Column: 17

                          self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
                lambda:cursor.get_key(), preparemsg)
            self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
                lambda:cursor.get_value(), preparemsg)
            self.session.timestamp_transaction("commit_timestamp=2b")
            self.session.timestamp_transaction("durable_timestamp=2b")
            self.session.commit_transaction()
            nextret = cursor.next()
            if nextret != 0:

            

Reported by Pylint.

Lambda may not be necessary
Error

Line: 141 Column: 17

                          self.session.begin_transaction()
            self.session.prepare_transaction("prepare_timestamp=2a")
            self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
                lambda:cursor.prev(), preparemsg)
            self.session.timestamp_transaction("commit_timestamp=2b")
            self.session.timestamp_transaction("durable_timestamp=2b")
            self.session.commit_transaction()
            prevret = cursor.prev()
            if prevret != 0:

            

Reported by Pylint.

Lambda may not be necessary
Error

Line: 169 Column: 13

                      self.session.begin_transaction()
        self.session.prepare_transaction("prepare_timestamp=2a")
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda:cursor.search(), preparemsg)
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda:cursor.update(), preparemsg)
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda:cursor.remove(), preparemsg)
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,

            

Reported by Pylint.

Lambda may not be necessary
Error

Line: 171 Column: 13

                      self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda:cursor.search(), preparemsg)
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda:cursor.update(), preparemsg)
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda:cursor.remove(), preparemsg)
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda:cursor.reserve(), preparemsg)
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,

            

Reported by Pylint.

Lambda may not be necessary
Error

Line: 173 Column: 13

                      self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda:cursor.update(), preparemsg)
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda:cursor.remove(), preparemsg)
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda:cursor.reserve(), preparemsg)
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda:cursor.reconfigure(), preparemsg)
        self.session.timestamp_transaction("commit_timestamp=2b")

            

Reported by Pylint.

Lambda may not be necessary
Error

Line: 175 Column: 13

                      self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda:cursor.remove(), preparemsg)
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda:cursor.reserve(), preparemsg)
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda:cursor.reconfigure(), preparemsg)
        self.session.timestamp_transaction("commit_timestamp=2b")
        self.session.timestamp_transaction("durable_timestamp=2b")
        self.session.commit_transaction()

            

Reported by Pylint.

src/third_party/icu4c-57.1/source/common/uloc.cpp
23 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

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

              }

typedef struct {
    char keyword[ULOC_KEYWORD_BUFFER_LEN];
    int32_t keywordLen;
    const char *valueStart;
    int32_t valueLen;
} KeywordStruct;


            

Reported by FlawFinder.

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

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

              { 
    const char* startSearchHere = NULL;
    const char* nextSeparator = NULL;
    char keywordNameBuffer[ULOC_KEYWORD_BUFFER_LEN];
    char localeKeywordNameBuffer[ULOC_KEYWORD_BUFFER_LEN];
    int32_t i = 0;
    int32_t result = 0;

    if(status && U_SUCCESS(*status) && localeID) {

            

Reported by FlawFinder.

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

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

                  const char* startSearchHere = NULL;
    const char* nextSeparator = NULL;
    char keywordNameBuffer[ULOC_KEYWORD_BUFFER_LEN];
    char localeKeywordNameBuffer[ULOC_KEYWORD_BUFFER_LEN];
    int32_t i = 0;
    int32_t result = 0;

    if(status && U_SUCCESS(*status) && localeID) {
      char tempBuffer[ULOC_FULLNAME_CAPACITY];

            

Reported by FlawFinder.

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

Line: 840 Column: 7 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

                  int32_t result = 0;

    if(status && U_SUCCESS(*status) && localeID) {
      char tempBuffer[ULOC_FULLNAME_CAPACITY];
      const char* tmpLocaleID;

      if (_hasBCP47Extension(localeID)) {
          _ConvertBCP47(tmpLocaleID, localeID, tempBuffer, sizeof(tempBuffer), status);
      } else {

            

Reported by FlawFinder.

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

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

                  int32_t needLen = 0;
    int32_t foundValueLen;
    int32_t keywordAtEnd = 0; /* is the keyword at the end of the string? */
    char keywordNameBuffer[ULOC_KEYWORD_BUFFER_LEN];
    char localeKeywordNameBuffer[ULOC_KEYWORD_BUFFER_LEN];
    int32_t i = 0;
    int32_t rc;
    char* nextSeparator = NULL;
    char* nextEqualsign = NULL;

            

Reported by FlawFinder.

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

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

                  int32_t foundValueLen;
    int32_t keywordAtEnd = 0; /* is the keyword at the end of the string? */
    char keywordNameBuffer[ULOC_KEYWORD_BUFFER_LEN];
    char localeKeywordNameBuffer[ULOC_KEYWORD_BUFFER_LEN];
    int32_t i = 0;
    int32_t rc;
    char* nextSeparator = NULL;
    char* nextEqualsign = NULL;
    char* startSearchHere = NULL;

            

Reported by FlawFinder.

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

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

                                  const char **pEnd) {
    int32_t i=0;
    int32_t offset;
    char lang[4]={ 0, 0, 0, 0 }; /* temporary buffer to hold language code for searching */

    /* if it starts with i- or x- then copy that prefix */
    if(_isIDPrefix(localeID)) {
        if(i<languageCapacity) {
            language[i]=(char)uprv_tolower(*localeID);

            

Reported by FlawFinder.

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

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

                                 const char **pEnd)
{
    int32_t idLen=0;
    char cnty[ULOC_COUNTRY_CAPACITY]={ 0, 0, 0, 0 };
    int32_t offset;

    /* copy the country as far as possible and count its length */
    while(!_isTerminator(localeID[idLen]) && !_isIDSeparator(localeID[idLen])) {
        if(idLen<(ULOC_COUNTRY_CAPACITY-1)) {   /*CWB*/

            

Reported by FlawFinder.

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

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

                                      UErrorCode* status) 
{
    int32_t i=0;
    char keywords[256];
    int32_t keywordsCapacity = 256;
    char tempBuffer[ULOC_FULLNAME_CAPACITY];
    const char* tmpLocaleID;

    if(status==NULL || U_FAILURE(*status)) {

            

Reported by FlawFinder.

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

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

                  int32_t i=0;
    char keywords[256];
    int32_t keywordsCapacity = 256;
    char tempBuffer[ULOC_FULLNAME_CAPACITY];
    const char* tmpLocaleID;

    if(status==NULL || U_FAILURE(*status)) {
        return 0;
    }

            

Reported by FlawFinder.

src/third_party/icu4c-57.1/source/common/loclikely.cpp
23 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

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

                       * script and region code without worrying about overrunning
         * the user-supplied buffer.
         **/
        char tagBuffer[ULOC_FULLNAME_CAPACITY];
        int32_t tagLength = 0;
        int32_t capacityRemaining = tagCapacity;
        UBool regionAppended = FALSE;

        if (langLength > 0) {

            

Reported by FlawFinder.

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

Line: 211 Column: 13 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

                          /*
             * Parse the alternateTags string for the language.
             */
            char alternateLang[ULOC_LANG_CAPACITY];
            int32_t alternateLangLength = sizeof(alternateLang);

            alternateLangLength =
                uloc_getLanguage(
                    alternateTags,

            

Reported by FlawFinder.

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

Line: 255 Column: 13 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

                          /*
             * Parse the alternateTags string for the script.
             */
            char alternateScript[ULOC_SCRIPT_CAPACITY];

            const int32_t alternateScriptLength =
                uloc_getScript(
                    alternateTags,
                    alternateScript,

            

Reported by FlawFinder.

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

Line: 290 Column: 13 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

                          /*
             * Parse the alternateTags string for the region.
             */
            char alternateRegion[ULOC_COUNTRY_CAPACITY];

            const int32_t alternateRegionLength =
                uloc_getCountry(
                    alternateTags,
                    alternateRegion,

            

Reported by FlawFinder.

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

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

                   * script and region code without worrying about overrunning
     * the user-supplied buffer.
     **/
    char tagBuffer[ULOC_FULLNAME_CAPACITY];
    char likelySubtagsBuffer[ULOC_FULLNAME_CAPACITY];

    if(U_FAILURE(*err)) {
        goto error;
    }

            

Reported by FlawFinder.

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

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

                   * the user-supplied buffer.
     **/
    char tagBuffer[ULOC_FULLNAME_CAPACITY];
    char likelySubtagsBuffer[ULOC_FULLNAME_CAPACITY];

    if(U_FAILURE(*err)) {
        goto error;
    }


            

Reported by FlawFinder.

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

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

                       int32_t maximizedLocaleIDCapacity,
         UErrorCode* err)
{
    char lang[ULOC_LANG_CAPACITY];
    int32_t langLength = sizeof(lang);
    char script[ULOC_SCRIPT_CAPACITY];
    int32_t scriptLength = sizeof(script);
    char region[ULOC_COUNTRY_CAPACITY];
    int32_t regionLength = sizeof(region);

            

Reported by FlawFinder.

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

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

              {
    char lang[ULOC_LANG_CAPACITY];
    int32_t langLength = sizeof(lang);
    char script[ULOC_SCRIPT_CAPACITY];
    int32_t scriptLength = sizeof(script);
    char region[ULOC_COUNTRY_CAPACITY];
    int32_t regionLength = sizeof(region);
    const char* trailing = "";
    int32_t trailingLength = 0;

            

Reported by FlawFinder.

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

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

                  int32_t langLength = sizeof(lang);
    char script[ULOC_SCRIPT_CAPACITY];
    int32_t scriptLength = sizeof(script);
    char region[ULOC_COUNTRY_CAPACITY];
    int32_t regionLength = sizeof(region);
    const char* trailing = "";
    int32_t trailingLength = 0;
    int32_t trailingIndex = 0;
    int32_t resultLength = 0;

            

Reported by FlawFinder.

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

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

                   * script and region code without worrying about overrunning
     * the user-supplied buffer.
     **/
    char maximizedTagBuffer[ULOC_FULLNAME_CAPACITY];
    int32_t maximizedTagBufferLength = sizeof(maximizedTagBuffer);

    char lang[ULOC_LANG_CAPACITY];
    int32_t langLength = sizeof(lang);
    char script[ULOC_SCRIPT_CAPACITY];

            

Reported by FlawFinder.