The following issues were found
src/third_party/wiredtiger/test/suite/test_stat06.py
12 issues
Line: 29
Column: 1
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
import helper, wiredtiger, wttest
from time import sleep
from wiredtiger import stat
# test_stat06.py
# Check that statistics are started or stopped when intended
Reported by Pylint.
Line: 31
Column: 1
import helper, wiredtiger, wttest
from time import sleep
from wiredtiger import stat
# test_stat06.py
# Check that statistics are started or stopped when intended
class test_stat06(wttest.WiredTigerTestCase):
Reported by Pylint.
Line: 29
Column: 1
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
import helper, wiredtiger, wttest
from time import sleep
from wiredtiger import stat
# test_stat06.py
# Check that statistics are started or stopped when intended
Reported by Pylint.
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.
Line: 29
Column: 1
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
import helper, wiredtiger, wttest
from time import sleep
from wiredtiger import stat
# test_stat06.py
# Check that statistics are started or stopped when intended
Reported by Pylint.
Line: 30
Column: 1
# OTHER DEALINGS IN THE SOFTWARE.
import helper, wiredtiger, wttest
from time import sleep
from wiredtiger import stat
# test_stat06.py
# Check that statistics are started or stopped when intended
class test_stat06(wttest.WiredTigerTestCase):
Reported by Pylint.
Line: 31
Column: 1
import helper, wiredtiger, wttest
from time import sleep
from wiredtiger import stat
# test_stat06.py
# Check that statistics are started or stopped when intended
class test_stat06(wttest.WiredTigerTestCase):
Reported by Pylint.
Line: 35
Column: 1
# test_stat06.py
# Check that statistics are started or stopped when intended
class test_stat06(wttest.WiredTigerTestCase):
def test_stats_on(self):
self.close_conn()
self.conn = self.wiredtiger_open(None, "statistics=(fast)")
self.stats_gathered(True)
Reported by Pylint.
Line: 35
Column: 1
# test_stat06.py
# Check that statistics are started or stopped when intended
class test_stat06(wttest.WiredTigerTestCase):
def test_stats_on(self):
self.close_conn()
self.conn = self.wiredtiger_open(None, "statistics=(fast)")
self.stats_gathered(True)
Reported by Pylint.
Line: 37
Column: 5
# Check that statistics are started or stopped when intended
class test_stat06(wttest.WiredTigerTestCase):
def test_stats_on(self):
self.close_conn()
self.conn = self.wiredtiger_open(None, "statistics=(fast)")
self.stats_gathered(True)
def test_stats_off(self):
Reported by Pylint.
src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid64_next.c
12 issues
Line: 115
CWE codes:
758
if (C1 >= MASK_BINARY_OR2) { // x >= 2^53
// split the 64-bit value in two 32-bit halves to avoid rounding errors
if (C1 >= 0x0000000100000000ull) { // x >= 2^32
tmp1.d = (double) (C1 >> 32); // exact conversion
x_nr_bits =
33 + ((((unsigned int) (tmp1.ui64 >> 52)) & 0x7ff) - 0x3ff);
} else { // x < 2^32
tmp1.d = (double) C1; // exact conversion
x_nr_bits =
Reported by Cppcheck.
Line: 117
CWE codes:
758
if (C1 >= 0x0000000100000000ull) { // x >= 2^32
tmp1.d = (double) (C1 >> 32); // exact conversion
x_nr_bits =
33 + ((((unsigned int) (tmp1.ui64 >> 52)) & 0x7ff) - 0x3ff);
} else { // x < 2^32
tmp1.d = (double) C1; // exact conversion
x_nr_bits =
1 + ((((unsigned int) (tmp1.ui64 >> 52)) & 0x7ff) - 0x3ff);
}
Reported by Cppcheck.
Line: 121
CWE codes:
758
} else { // x < 2^32
tmp1.d = (double) C1; // exact conversion
x_nr_bits =
1 + ((((unsigned int) (tmp1.ui64 >> 52)) & 0x7ff) - 0x3ff);
}
} else { // if x < 2^53
tmp1.d = (double) C1; // exact conversion
x_nr_bits =
1 + ((((unsigned int) (tmp1.ui64 >> 52)) & 0x7ff) - 0x3ff);
Reported by Cppcheck.
Line: 126
CWE codes:
758
} else { // if x < 2^53
tmp1.d = (double) C1; // exact conversion
x_nr_bits =
1 + ((((unsigned int) (tmp1.ui64 >> 52)) & 0x7ff) - 0x3ff);
}
q1 = bid_nr_digits[x_nr_bits - 1].digits;
if (q1 == 0) {
q1 = bid_nr_digits[x_nr_bits - 1].digits1;
if (C1 >= bid_nr_digits[x_nr_bits - 1].threshold_lo)
Reported by Cppcheck.
Line: 168
CWE codes:
758
// if significand has 54 bits
if (C1 & MASK_BINARY_OR2) {
res =
x_sign | (x_exp << 51) | MASK_STEERING_BITS | (C1 &
MASK_BINARY_SIG2);
} else { // significand fits in 53 bits
res = x_sign | (x_exp << 53) | C1;
}
} // end -MAXFP <= x <= -MINFP - 1 ulp OR MINFP <= x <= MAXFP - 1 ulp
Reported by Cppcheck.
Line: 171
CWE codes:
758
x_sign | (x_exp << 51) | MASK_STEERING_BITS | (C1 &
MASK_BINARY_SIG2);
} else { // significand fits in 53 bits
res = x_sign | (x_exp << 53) | C1;
}
} // end -MAXFP <= x <= -MINFP - 1 ulp OR MINFP <= x <= MAXFP - 1 ulp
} // end x is not special and is not zero
BID_RETURN (res);
}
Reported by Cppcheck.
Line: 262
CWE codes:
758
// split the 64-bit value in two 32-bit halves to avoid
// rounding errors
if (C1 >= 0x0000000100000000ull) { // x >= 2^32
tmp1.d = (double) (C1 >> 32); // exact conversion
x_nr_bits =
33 + ((((unsigned int) (tmp1.ui64 >> 52)) & 0x7ff) - 0x3ff);
} else { // x < 2^32
tmp1.d = (double) C1; // exact conversion
x_nr_bits =
Reported by Cppcheck.
Line: 264
CWE codes:
758
if (C1 >= 0x0000000100000000ull) { // x >= 2^32
tmp1.d = (double) (C1 >> 32); // exact conversion
x_nr_bits =
33 + ((((unsigned int) (tmp1.ui64 >> 52)) & 0x7ff) - 0x3ff);
} else { // x < 2^32
tmp1.d = (double) C1; // exact conversion
x_nr_bits =
1 + ((((unsigned int) (tmp1.ui64 >> 52)) & 0x7ff) - 0x3ff);
}
Reported by Cppcheck.
Line: 268
CWE codes:
758
} else { // x < 2^32
tmp1.d = (double) C1; // exact conversion
x_nr_bits =
1 + ((((unsigned int) (tmp1.ui64 >> 52)) & 0x7ff) - 0x3ff);
}
} else { // if x < 2^53
tmp1.d = (double) C1; // exact conversion
x_nr_bits =
1 + ((((unsigned int) (tmp1.ui64 >> 52)) & 0x7ff) - 0x3ff);
Reported by Cppcheck.
Line: 273
CWE codes:
758
} else { // if x < 2^53
tmp1.d = (double) C1; // exact conversion
x_nr_bits =
1 + ((((unsigned int) (tmp1.ui64 >> 52)) & 0x7ff) - 0x3ff);
}
q1 = bid_nr_digits[x_nr_bits - 1].digits;
if (q1 == 0) {
q1 = bid_nr_digits[x_nr_bits - 1].digits1;
if (C1 >= bid_nr_digits[x_nr_bits - 1].threshold_lo)
Reported by Cppcheck.
src/third_party/wiredtiger/test/suite/test_txn24.py
12 issues
Line: 34
Column: 1
# cache stuck issue.
#
import wiredtiger, wttest
import time
from wtscenario import make_scenarios
class test_txn24(wttest.WiredTigerTestCase):
Reported by Pylint.
Line: 48
Column: 5
]
scenarios = make_scenarios(key_format_values)
def conn_config(self):
# We want to either eliminate or keep the application thread role in eviction to minimum.
# This will ensure that the dedicated eviction threads are doing the heavy lifting.
return 'cache_size=100MB,eviction_target=80,eviction_dirty_target=5,eviction_trigger=100,\
eviction_updates_target=5,eviction_dirty_trigger=99,eviction_updates_trigger=100,\
eviction=(threads_max=4)'
Reported by Pylint.
Line: 34
Column: 1
# cache stuck issue.
#
import wiredtiger, wttest
import time
from wtscenario import make_scenarios
class test_txn24(wttest.WiredTigerTestCase):
Reported by Pylint.
Line: 35
Column: 1
#
import wiredtiger, wttest
import time
from wtscenario import make_scenarios
class test_txn24(wttest.WiredTigerTestCase):
session_config = 'isolation=snapshot'
Reported by Pylint.
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.
Line: 34
Column: 1
# cache stuck issue.
#
import wiredtiger, wttest
import time
from wtscenario import make_scenarios
class test_txn24(wttest.WiredTigerTestCase):
Reported by Pylint.
Line: 35
Column: 1
#
import wiredtiger, wttest
import time
from wtscenario import make_scenarios
class test_txn24(wttest.WiredTigerTestCase):
session_config = 'isolation=snapshot'
Reported by Pylint.
Line: 38
Column: 1
import time
from wtscenario import make_scenarios
class test_txn24(wttest.WiredTigerTestCase):
session_config = 'isolation=snapshot'
key_format_values = [
('integer-row', dict(key_format='i')),
Reported by Pylint.
Line: 38
Column: 1
import time
from wtscenario import make_scenarios
class test_txn24(wttest.WiredTigerTestCase):
session_config = 'isolation=snapshot'
key_format_values = [
('integer-row', dict(key_format='i')),
Reported by Pylint.
Line: 48
Column: 5
]
scenarios = make_scenarios(key_format_values)
def conn_config(self):
# We want to either eliminate or keep the application thread role in eviction to minimum.
# This will ensure that the dedicated eviction threads are doing the heavy lifting.
return 'cache_size=100MB,eviction_target=80,eviction_dirty_target=5,eviction_trigger=100,\
eviction_updates_target=5,eviction_dirty_trigger=99,eviction_updates_trigger=100,\
eviction=(threads_max=4)'
Reported by Pylint.
src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/rmic.py
12 issues
Line: 126
Column: 12
env['RMICCOM'] = '$RMIC $RMICFLAGS -d ${TARGET.attributes.java_lookupdir} -classpath ${SOURCE.attributes.java_classdir} ${SOURCES.attributes.java_classname}'
env['JAVACLASSSUFFIX'] = '.class'
def exists(env):
# As reported by Jan Nijtmans in issue #2730, the simple
# return env.Detect('rmic')
# doesn't always work during initialization. For now, we
# stop trying to detect an executable (analogous to the
# javac Builder).
Reported by Pylint.
Line: 132
Column: 3
# doesn't always work during initialization. For now, we
# stop trying to detect an executable (analogous to the
# javac Builder).
# TODO: Come up with a proper detect() routine...and enable it.
return 1
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
Reported by Pylint.
Line: 34
Column: 1
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/Tool/rmic.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan"
import os.path
import SCons.Action
import SCons.Builder
Reported by Pylint.
Line: 46
Column: 1
from SCons.Tool.JavaCommon import get_java_install_dirs
def emit_rmic_classes(target, source, env):
"""Create and return lists of Java RMI stub and skeleton
class files to be created from a set of class files.
"""
class_suffix = env.get('JAVACLASSSUFFIX', '.class')
classdir = env.get('JAVACLASSDIR')
Reported by Pylint.
Line: 55
Column: 13
if not classdir:
try:
s = source[0]
except IndexError:
classdir = '.'
else:
try:
classdir = s.attributes.java_classdir
Reported by Pylint.
Line: 65
Column: 9
classdir = '.'
classdir = env.Dir(classdir).rdir()
if str(classdir) == '.':
c_ = None
else:
c_ = str(classdir) + os.sep
slist = []
for src in source:
Reported by Pylint.
Line: 67
Column: 9
if str(classdir) == '.':
c_ = None
else:
c_ = str(classdir) + os.sep
slist = []
for src in source:
try:
classname = src.attributes.java_classname
Reported by Pylint.
Line: 79
Column: 9
classname = classname[len(c_):]
if class_suffix and classname[:-len(class_suffix)] == class_suffix:
classname = classname[-len(class_suffix):]
s = src.rfile()
s.attributes.java_classdir = classdir
s.attributes.java_classname = classname
slist.append(s)
stub_suffixes = ['_Stub']
Reported by Pylint.
Line: 89
Column: 9
stub_suffixes.append('_Skel')
tlist = []
for s in source:
for suff in stub_suffixes:
fname = s.attributes.java_classname.replace('.', os.sep) + \
suff + class_suffix
t = target[0].File(fname)
t.attributes.java_lookupdir = target[0]
Reported by Pylint.
Line: 93
Column: 13
for suff in stub_suffixes:
fname = s.attributes.java_classname.replace('.', os.sep) + \
suff + class_suffix
t = target[0].File(fname)
t.attributes.java_lookupdir = target[0]
tlist.append(t)
return tlist, source
Reported by Pylint.
src/third_party/wiredtiger/test/3rdparty/testtools-0.9.34/testtools/tests/test_tags.py
12 issues
Line: 10
Column: 1
from testtools.tags import TagContext
class TestTags(TestCase):
def test_no_tags(self):
# A tag context has no tags initially.
tag_context = TagContext()
self.assertEqual(set(), tag_context.get_current_tags())
Reported by Pylint.
Line: 12
Column: 5
class TestTags(TestCase):
def test_no_tags(self):
# A tag context has no tags initially.
tag_context = TagContext()
self.assertEqual(set(), tag_context.get_current_tags())
def test_add_tag(self):
Reported by Pylint.
Line: 17
Column: 5
tag_context = TagContext()
self.assertEqual(set(), tag_context.get_current_tags())
def test_add_tag(self):
# A tag added with change_tags appears in get_current_tags.
tag_context = TagContext()
tag_context.change_tags(set(['foo']), set())
self.assertEqual(set(['foo']), tag_context.get_current_tags())
Reported by Pylint.
Line: 23
Column: 5
tag_context.change_tags(set(['foo']), set())
self.assertEqual(set(['foo']), tag_context.get_current_tags())
def test_add_tag_twice(self):
# Calling change_tags twice to add tags adds both tags to the current
# tags.
tag_context = TagContext()
tag_context.change_tags(set(['foo']), set())
tag_context.change_tags(set(['bar']), set())
Reported by Pylint.
Line: 32
Column: 5
self.assertEqual(
set(['foo', 'bar']), tag_context.get_current_tags())
def test_change_tags_returns_tags(self):
# change_tags returns the current tags. This is a convenience.
tag_context = TagContext()
tags = tag_context.change_tags(set(['foo']), set())
self.assertEqual(set(['foo']), tags)
Reported by Pylint.
Line: 38
Column: 5
tags = tag_context.change_tags(set(['foo']), set())
self.assertEqual(set(['foo']), tags)
def test_remove_tag(self):
# change_tags can remove tags from the context.
tag_context = TagContext()
tag_context.change_tags(set(['foo']), set())
tag_context.change_tags(set(), set(['foo']))
self.assertEqual(set(), tag_context.get_current_tags())
Reported by Pylint.
Line: 45
Column: 5
tag_context.change_tags(set(), set(['foo']))
self.assertEqual(set(), tag_context.get_current_tags())
def test_child_context(self):
# A TagContext can have a parent. If so, its tags are the tags of the
# parent at the moment of construction.
parent = TagContext()
parent.change_tags(set(['foo']), set())
child = TagContext(parent)
Reported by Pylint.
Line: 54
Column: 5
self.assertEqual(
parent.get_current_tags(), child.get_current_tags())
def test_add_to_child(self):
# Adding a tag to the child context doesn't affect the parent.
parent = TagContext()
parent.change_tags(set(['foo']), set())
child = TagContext(parent)
child.change_tags(set(['bar']), set())
Reported by Pylint.
Line: 63
Column: 5
self.assertEqual(set(['foo', 'bar']), child.get_current_tags())
self.assertEqual(set(['foo']), parent.get_current_tags())
def test_remove_in_child(self):
# A tag that was in the parent context can be removed from the child
# context without affect the parent.
parent = TagContext()
parent.change_tags(set(['foo']), set())
child = TagContext(parent)
Reported by Pylint.
Line: 73
Column: 5
self.assertEqual(set(), child.get_current_tags())
self.assertEqual(set(['foo']), parent.get_current_tags())
def test_parent(self):
# The parent can be retrieved from a child context.
parent = TagContext()
parent.change_tags(set(['foo']), set())
child = TagContext(parent)
child.change_tags(set(), set(['foo']))
Reported by Pylint.
src/third_party/wiredtiger/src/support/err.c
12 issues
Line: 282
Column: 13
CWE codes:
134
Suggestion:
Use a constant for the format specification
if (fprintf(stderr, "WiredTiger Error%s%s: ", error == 0 ? "" : ": ",
error == 0 ? "" : __wt_strerror(session, error, NULL, 0)) < 0)
WT_TRET(EIO);
if (vfprintf(stderr, fmt, ap) < 0)
WT_TRET(EIO);
if (fprintf(stderr, "\n") < 0)
WT_TRET(EIO);
if (fflush(stderr) != 0)
WT_TRET(EIO);
Reported by FlawFinder.
Line: 299
Column: 63
CWE codes:
134
Suggestion:
Use a constant for the format specification
*/
void
__wt_err_func(WT_SESSION_IMPL *session, int error, const char *func, int line, const char *fmt, ...)
WT_GCC_FUNC_ATTRIBUTE((cold)) WT_GCC_FUNC_ATTRIBUTE((format(printf, 5, 6)))
WT_GCC_FUNC_ATTRIBUTE((visibility("default")))
{
va_list ap;
/*
Reported by FlawFinder.
Line: 319
Column: 63
CWE codes:
134
Suggestion:
Use a constant for the format specification
*/
void
__wt_errx_func(WT_SESSION_IMPL *session, const char *func, int line, const char *fmt, ...)
WT_GCC_FUNC_ATTRIBUTE((cold)) WT_GCC_FUNC_ATTRIBUTE((format(printf, 4, 5)))
WT_GCC_FUNC_ATTRIBUTE((visibility("default")))
{
va_list ap;
/*
Reported by FlawFinder.
Line: 339
Column: 68
CWE codes:
134
Suggestion:
Use a constant for the format specification
*/
int
__wt_panic_func(WT_SESSION_IMPL *session, int error, const char *func, int line, const char *fmt,
...) WT_GCC_FUNC_ATTRIBUTE((cold)) WT_GCC_FUNC_ATTRIBUTE((format(printf, 5, 6)))
WT_GCC_FUNC_ATTRIBUTE((visibility("default")))
{
WT_CONNECTION_IMPL *conn;
va_list ap;
Reported by FlawFinder.
Line: 424
Column: 33
CWE codes:
134
Suggestion:
Use a constant for the format specification
*/
int
__wt_ext_err_printf(WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, const char *fmt, ...)
WT_GCC_FUNC_ATTRIBUTE((format(printf, 3, 4)))
{
WT_DECL_RET;
WT_SESSION_IMPL *session;
va_list ap;
Reported by FlawFinder.
Line: 445
Column: 33
CWE codes:
134
Suggestion:
Use a constant for the format specification
*/
void
__wt_verbose_worker(WT_SESSION_IMPL *session, const char *fmt, ...)
WT_GCC_FUNC_ATTRIBUTE((format(printf, 2, 3))) WT_GCC_FUNC_ATTRIBUTE((cold))
{
va_list ap;
va_start(ap, fmt);
WT_IGNORE_RET(__eventv(session, true, 0, NULL, 0, fmt, ap));
Reported by FlawFinder.
Line: 460
Column: 33
CWE codes:
134
Suggestion:
Use a constant for the format specification
*/
int
__wt_msg(WT_SESSION_IMPL *session, const char *fmt, ...) WT_GCC_FUNC_ATTRIBUTE((cold))
WT_GCC_FUNC_ATTRIBUTE((format(printf, 2, 3)))
{
WT_DECL_ITEM(buf);
WT_DECL_RET;
WT_EVENT_HANDLER *handler;
WT_SESSION *wt_session;
Reported by FlawFinder.
Line: 486
Column: 33
CWE codes:
134
Suggestion:
Use a constant for the format specification
*/
int
__wt_ext_msg_printf(WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, const char *fmt, ...)
WT_GCC_FUNC_ATTRIBUTE((format(printf, 3, 4)))
{
WT_DECL_ITEM(buf);
WT_DECL_RET;
WT_EVENT_HANDLER *handler;
WT_SESSION_IMPL *session;
Reported by FlawFinder.
Line: 96
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
* SECURITY:
* Buffer placed at the end of the stack in case snprintf overflows.
*/
char s[256];
if (__wt_snprintf(s, sizeof(s), "application %s event handler failed: %s", which,
__wt_strerror(session, error, NULL, 0)) != 0)
return;
Reported by FlawFinder.
Line: 177
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
WT_EVENT_HANDLER *handler;
WT_SESSION *wt_session;
size_t len, remain;
char *p, tid[128];
const char *err, *prefix;
/*
* We're using a stack buffer because we want error messages no matter
* what, and allocating a WT_ITEM, or the memory it needs, might fail.
Reported by FlawFinder.
src/third_party/wiredtiger/test/suite/test_txn18.py
12 issues
Line: 35
Column: 1
import fnmatch, os, shutil, time
from suite_subprocess import suite_subprocess
import wiredtiger, wttest
from wtscenario import make_scenarios
class test_txn18(wttest.WiredTigerTestCase, suite_subprocess):
t1 = 'table:test_txn18'
conn_config = 'log=(archive=false,enabled,file_max=100K),' + \
Reported by Pylint.
Line: 33
Column: 1
# Transactions: test recovery settings
#
import fnmatch, os, shutil, time
from suite_subprocess import suite_subprocess
import wiredtiger, wttest
from wtscenario import make_scenarios
class test_txn18(wttest.WiredTigerTestCase, suite_subprocess):
Reported by Pylint.
Line: 33
Column: 1
# Transactions: test recovery settings
#
import fnmatch, os, shutil, time
from suite_subprocess import suite_subprocess
import wiredtiger, wttest
from wtscenario import make_scenarios
class test_txn18(wttest.WiredTigerTestCase, suite_subprocess):
Reported by Pylint.
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.
Line: 33
Column: 1
# Transactions: test recovery settings
#
import fnmatch, os, shutil, time
from suite_subprocess import suite_subprocess
import wiredtiger, wttest
from wtscenario import make_scenarios
class test_txn18(wttest.WiredTigerTestCase, suite_subprocess):
Reported by Pylint.
Line: 35
Column: 1
import fnmatch, os, shutil, time
from suite_subprocess import suite_subprocess
import wiredtiger, wttest
from wtscenario import make_scenarios
class test_txn18(wttest.WiredTigerTestCase, suite_subprocess):
t1 = 'table:test_txn18'
conn_config = 'log=(archive=false,enabled,file_max=100K),' + \
Reported by Pylint.
Line: 35
Column: 1
import fnmatch, os, shutil, time
from suite_subprocess import suite_subprocess
import wiredtiger, wttest
from wtscenario import make_scenarios
class test_txn18(wttest.WiredTigerTestCase, suite_subprocess):
t1 = 'table:test_txn18'
conn_config = 'log=(archive=false,enabled,file_max=100K),' + \
Reported by Pylint.
Line: 38
Column: 1
import wiredtiger, wttest
from wtscenario import make_scenarios
class test_txn18(wttest.WiredTigerTestCase, suite_subprocess):
t1 = 'table:test_txn18'
conn_config = 'log=(archive=false,enabled,file_max=100K),' + \
'transaction_sync=(method=dsync,enabled)'
conn_recerror = conn_config + ',log=(recover=error)'
conn_recon = conn_config + ',log=(recover=on)'
Reported by Pylint.
Line: 38
Column: 1
import wiredtiger, wttest
from wtscenario import make_scenarios
class test_txn18(wttest.WiredTigerTestCase, suite_subprocess):
t1 = 'table:test_txn18'
conn_config = 'log=(archive=false,enabled,file_max=100K),' + \
'transaction_sync=(method=dsync,enabled)'
conn_recerror = conn_config + ',log=(recover=error)'
conn_recon = conn_config + ',log=(recover=on)'
Reported by Pylint.
Line: 51
Column: 5
]
scenarios = make_scenarios(key_format_values)
def simulate_crash(self, olddir, newdir):
''' Simulate a crash from olddir and restart in newdir. '''
# with the connection still open, copy files to new directory
shutil.rmtree(newdir, ignore_errors=True)
os.mkdir(newdir)
for fname in os.listdir(olddir):
Reported by Pylint.
src/third_party/fmt/dist/include/fmt/format.h
12 issues
Line: 292
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
inline bool is_big_endian() {
const auto u = 1u;
struct bytes {
char data[sizeof(u)];
};
return bit_cast<bytes>(u).data[0] == 0;
}
// A fallback implementation of uintptr_t for systems that lack it.
Reported by FlawFinder.
Line: 299
Column: 12
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
// A fallback implementation of uintptr_t for systems that lack it.
struct fallback_uintptr {
unsigned char value[sizeof(void*)];
fallback_uintptr() = default;
explicit fallback_uintptr(const void* p) {
*this = bit_cast<fallback_uintptr>(p);
if (is_big_endian()) {
Reported by FlawFinder.
Line: 889
Column: 16
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
static const char hex_digits[];
static const char foreground_color[];
static const char background_color[];
static const char reset_color[5];
static const wchar_t wreset_color[5];
static const char signs[];
static const char left_padding_shifts[5];
static const char right_padding_shifts[5];
Reported by FlawFinder.
Line: 890
Column: 16
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
static const char foreground_color[];
static const char background_color[];
static const char reset_color[5];
static const wchar_t wreset_color[5];
static const char signs[];
static const char left_padding_shifts[5];
static const char right_padding_shifts[5];
// DEPRECATED! These are for ABI compatibility.
Reported by FlawFinder.
Line: 892
Column: 16
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
static const char reset_color[5];
static const wchar_t wreset_color[5];
static const char signs[];
static const char left_padding_shifts[5];
static const char right_padding_shifts[5];
// DEPRECATED! These are for ABI compatibility.
static const uint32_t zero_or_powers_of_10_32[];
static const uint64_t zero_or_powers_of_10_64[];
Reported by FlawFinder.
Line: 893
Column: 16
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
static const wchar_t wreset_color[5];
static const char signs[];
static const char left_padding_shifts[5];
static const char right_padding_shifts[5];
// DEPRECATED! These are for ABI compatibility.
static const uint32_t zero_or_powers_of_10_32[];
static const uint64_t zero_or_powers_of_10_64[];
};
Reported by FlawFinder.
Line: 1038
Column: 53
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
*dst++ = static_cast<Char>(*src++);
*dst = static_cast<Char>(*src);
}
FMT_INLINE void copy2(char* dst, const char* src) { memcpy(dst, src, 2); }
template <typename Iterator> struct format_decimal_result {
Iterator begin;
Iterator end;
};
Reported by FlawFinder.
Line: 1124
Column: 3
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
return out;
}
// Buffer should be large enough to hold all digits (digits / BASE_BITS + 1).
char buffer[num_bits<UInt>() / BASE_BITS + 1];
format_uint<BASE_BITS>(buffer, value, num_digits, upper);
return detail::copy_str<Char>(buffer, buffer + num_digits, out);
}
// A converter from UTF-8 to UTF-16.
Reported by FlawFinder.
Line: 1589
Column: 3
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
locale_ref locale;
const basic_format_specs<Char>& specs;
UInt abs_value;
char prefix[4];
unsigned prefix_size;
using iterator =
remove_reference_t<decltype(reserve(std::declval<OutputIt&>(), 0))>;
Reported by FlawFinder.
Line: 1679
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
++group;
}
if (group == groups.cend()) size += sep_size * ((n - 1) / groups.back());
char digits[40];
format_decimal(digits, abs_value, num_digits);
basic_memory_buffer<Char> buffer;
size += static_cast<int>(prefix_size);
const auto usize = to_unsigned(size);
buffer.resize(usize);
Reported by FlawFinder.
src/third_party/IntelRDFPMathLib20U1/LIBRARY/float128/f_format.h
12 issues
Line: 1572
Column: 14
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
unsigned long l[1];
unsigned int i[1];
unsigned short s[2];
unsigned char c[4];
struct {
unsigned hi_bits : 7;
unsigned exponent : 8;
unsigned sign_bit : 1;
unsigned char c[2];
Reported by FlawFinder.
Line: 1577
Column: 18
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
unsigned hi_bits : 7;
unsigned exponent : 8;
unsigned sign_bit : 1;
unsigned char c[2];
}
vax_f_float;
struct {
unsigned char c[2];
unsigned hi_bits : 7;
Reported by FlawFinder.
Line: 1581
Column: 18
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
}
vax_f_float;
struct {
unsigned char c[2];
unsigned hi_bits : 7;
unsigned exponent : 8;
unsigned sign_bit : 1;
}
ieee_single;
Reported by FlawFinder.
Line: 1588
Column: 18
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
}
ieee_single;
struct {
unsigned char c[3];
unsigned exponent : 7;
unsigned sign_bit : 1;
}
ibm_short;
}
Reported by FlawFinder.
Line: 1605
Column: 14
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
unsigned long l[2];
unsigned int i[2];
unsigned short s[4];
unsigned char c[8];
struct {
unsigned hi_bits : 7;
unsigned exponent : 8;
unsigned sign_bit : 1;
unsigned char c[6];
Reported by FlawFinder.
Line: 1610
Column: 18
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
unsigned hi_bits : 7;
unsigned exponent : 8;
unsigned sign_bit : 1;
unsigned char c[6];
}
vax_d_float;
struct {
unsigned hi_bits : 4;
unsigned exponent : 11;
Reported by FlawFinder.
Line: 1617
Column: 18
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
unsigned hi_bits : 4;
unsigned exponent : 11;
unsigned sign_bit : 1;
unsigned char c[6];
}
vax_g_float;
struct {
unsigned char c[6];
unsigned hi_bits : 4;
Reported by FlawFinder.
Line: 1621
Column: 18
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
}
vax_g_float;
struct {
unsigned char c[6];
unsigned hi_bits : 4;
unsigned exponent : 11;
unsigned sign_bit : 1;
}
ieee_double;
Reported by FlawFinder.
Line: 1628
Column: 18
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
}
ieee_double;
struct {
unsigned char c[7];
unsigned exponent : 7;
unsigned sign_bit : 1;
}
ibm_long;
struct {
Reported by FlawFinder.
Line: 1634
Column: 18
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
}
ibm_long;
struct {
unsigned char c[6];
unsigned exponent : 15;
unsigned sign_bit : 1;
}
cray;
}
Reported by FlawFinder.
src/third_party/wiredtiger/src/support/timestamp.c
12 issues
Line: 31
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
__wt_time_point_to_string(
wt_timestamp_t ts, wt_timestamp_t durable_ts, uint64_t txn_id, char *tp_string)
{
char ts_string[WT_TS_INT_STRING_SIZE];
WT_IGNORE_RET(__wt_snprintf(tp_string, WT_TP_STRING_SIZE, "%s/%s/%" PRIu64,
__wt_timestamp_to_string(ts, ts_string), __wt_timestamp_to_string(durable_ts, ts_string),
txn_id));
return (tp_string);
Reported by FlawFinder.
Line: 46
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 *
__wt_time_window_to_string(WT_TIME_WINDOW *tw, char *tw_string)
{
char ts_string[4][WT_TS_INT_STRING_SIZE];
WT_IGNORE_RET(__wt_snprintf(tw_string, WT_TIME_STRING_SIZE,
"start: %s/%s/%" PRIu64 " stop: %s/%s/%" PRIu64 "%s",
__wt_timestamp_to_string(tw->durable_start_ts, ts_string[0]),
__wt_timestamp_to_string(tw->start_ts, ts_string[1]), tw->start_txn,
Reported by FlawFinder.
Line: 65
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 *
__wt_time_aggregate_to_string(WT_TIME_AGGREGATE *ta, char *ta_string)
{
char ts_string[4][WT_TS_INT_STRING_SIZE];
WT_IGNORE_RET(__wt_snprintf(ta_string, WT_TIME_STRING_SIZE,
"newest durable: %s/%s oldest start: %s/%" PRIu64 " newest stop %s/%" PRIu64 "%s",
__wt_timestamp_to_string(ta->newest_start_durable_ts, ts_string[0]),
__wt_timestamp_to_string(ta->newest_stop_durable_ts, ts_string[1]),
Reported by FlawFinder.
Line: 93
Column: 15
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
}
if (ts == WT_TS_MAX) {
#define WT_TS_MAX_HEX_STRING "ffffffffffffffff"
(void)memcpy(hex_timestamp, WT_TS_MAX_HEX_STRING, strlen(WT_TS_MAX_HEX_STRING) + 1);
return;
}
for (p = hex_timestamp; ts != 0; ts >>= 4)
*p++ = (char)__wt_hex((u_char)(ts & 0x0f));
Reported by FlawFinder.
Line: 116
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
void
__wt_verbose_timestamp(WT_SESSION_IMPL *session, wt_timestamp_t ts, const char *msg)
{
char ts_string[WT_TS_INT_STRING_SIZE];
__wt_verbose(
session, WT_VERB_TIMESTAMP, "Timestamp %s: %s", __wt_timestamp_to_string(ts, ts_string), msg);
}
Reported by FlawFinder.
Line: 161
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
WT_SESSION_IMPL *session, WT_TIME_AGGREGATE *ta, bool silent)
{
wt_timestamp_t stable;
char time_string[WT_TIME_STRING_SIZE], ts_string[WT_TS_INT_STRING_SIZE];
stable = __time_stable(session);
if (ta->newest_start_durable_ts > stable)
WT_TIME_ERROR("a newest start durable time after");
Reported by FlawFinder.
Line: 185
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
__time_aggregate_validate_parent(
WT_SESSION_IMPL *session, WT_TIME_AGGREGATE *ta, WT_TIME_AGGREGATE *parent, bool silent)
{
char time_string[2][WT_TIME_STRING_SIZE];
if (ta->newest_start_durable_ts > parent->newest_start_durable_ts)
WT_TIME_VALIDATE_RET(session,
"aggregate time window has a newest start durable time after its parent's; time "
"aggregate %s, parent %s",
Reported by FlawFinder.
Line: 246
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
__wt_time_aggregate_validate(
WT_SESSION_IMPL *session, WT_TIME_AGGREGATE *ta, WT_TIME_AGGREGATE *parent, bool silent)
{
char time_string[2][WT_TIME_STRING_SIZE];
if (ta->oldest_start_ts > ta->newest_stop_ts)
WT_TIME_VALIDATE_RET(session,
"aggregate time window has an oldest start time after its newest stop time; time "
"aggregate %s",
Reported by FlawFinder.
Line: 322
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
__time_value_validate_parent_stable(WT_SESSION_IMPL *session, WT_TIME_WINDOW *tw, bool silent)
{
wt_timestamp_t stable;
char time_string[WT_TIME_STRING_SIZE], ts_string[WT_TS_INT_STRING_SIZE];
stable = __time_stable(session);
if (tw->durable_start_ts > stable)
WT_TIME_ERROR("a durable start time after");
Reported by FlawFinder.
Line: 346
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
__time_value_validate_parent(
WT_SESSION_IMPL *session, WT_TIME_WINDOW *tw, WT_TIME_AGGREGATE *parent, bool silent)
{
char time_string[2][WT_TIME_STRING_SIZE];
if (parent->newest_start_durable_ts != WT_TS_NONE &&
tw->durable_start_ts > parent->newest_start_durable_ts)
WT_TIME_VALIDATE_RET(session,
"value time window has a durable start time after its parent's newest durable start "
Reported by FlawFinder.