The following issues were found
src/third_party/wiredtiger/test/suite/test_hs15.py
9 issues
Line: 34
Column: 1
# [END_TAGS]
#
import time, wiredtiger, wttest
from wtscenario import make_scenarios
# test_hs15.py
# Ensure eviction doesn't clear the history store again after checkpoint has done so because of the same update without timestamp.
class test_hs15(wttest.WiredTigerTestCase):
Reported by Pylint.
Line: 34
Column: 1
# [END_TAGS]
#
import time, wiredtiger, wttest
from wtscenario import make_scenarios
# test_hs15.py
# Ensure eviction doesn't clear the history store again after checkpoint has done so because of the same update without timestamp.
class test_hs15(wttest.WiredTigerTestCase):
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
# [END_TAGS]
#
import time, wiredtiger, wttest
from wtscenario import make_scenarios
# test_hs15.py
# Ensure eviction doesn't clear the history store again after checkpoint has done so because of the same update without timestamp.
class test_hs15(wttest.WiredTigerTestCase):
Reported by Pylint.
Line: 38
Column: 1
from wtscenario import make_scenarios
# test_hs15.py
# Ensure eviction doesn't clear the history store again after checkpoint has done so because of the same update without timestamp.
class test_hs15(wttest.WiredTigerTestCase):
conn_config = 'cache_size=5MB'
session_config = 'isolation=snapshot'
key_format_values = [
('column', dict(key_format='r')),
Reported by Pylint.
Line: 39
Column: 1
# test_hs15.py
# Ensure eviction doesn't clear the history store again after checkpoint has done so because of the same update without timestamp.
class test_hs15(wttest.WiredTigerTestCase):
conn_config = 'cache_size=5MB'
session_config = 'isolation=snapshot'
key_format_values = [
('column', dict(key_format='r')),
('string-row', dict(key_format='S'))
Reported by Pylint.
Line: 39
Column: 1
# test_hs15.py
# Ensure eviction doesn't clear the history store again after checkpoint has done so because of the same update without timestamp.
class test_hs15(wttest.WiredTigerTestCase):
conn_config = 'cache_size=5MB'
session_config = 'isolation=snapshot'
key_format_values = [
('column', dict(key_format='r')),
('string-row', dict(key_format='S'))
Reported by Pylint.
Line: 48
Column: 5
]
scenarios = make_scenarios(key_format_values)
def create_key(self, i):
if self.key_format == 'S':
return str(i)
return i
def test_hs15(self):
Reported by Pylint.
Line: 53
Column: 5
return str(i)
return i
def test_hs15(self):
uri = 'table:test_hs15'
self.session.create(uri, 'key_format={},value_format=S'.format(self.key_format))
cursor = self.session.open_cursor(uri)
value1 = 'a' * 500
Reported by Pylint.
src/third_party/wiredtiger/test/suite/test_hs04.py
9 issues
Line: 33
Column: 1
# Test file_max configuration and reconfiguration for the history store table.
#
import wiredtiger, wttest
from wtscenario import make_scenarios
# Taken from src/include/misc.h.
WT_MB = 1048576
Reported by Pylint.
Line: 60
Column: 5
scenarios = make_scenarios(init_file_max_values, reconfig_file_max_values,
in_memory_values)
def conn_config(self):
config = 'statistics=(fast)'
if self.init_file_max is not None:
config += ',history_store=(file_max={})'.format(self.init_file_max)
if self.in_memory is not None:
config += ',in_memory=' + ('true' if self.in_memory else 'false')
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
# Test file_max configuration and reconfiguration for the history store table.
#
import wiredtiger, wttest
from wtscenario import make_scenarios
# Taken from src/include/misc.h.
WT_MB = 1048576
Reported by Pylint.
Line: 39
Column: 1
# Taken from src/include/misc.h.
WT_MB = 1048576
class test_hs04(wttest.WiredTigerTestCase):
uri = 'table:hs_04'
in_memory_values = [
('false', dict(in_memory=False)),
('none', dict(in_memory=None)),
('true', dict(in_memory=True))
Reported by Pylint.
Line: 39
Column: 1
# Taken from src/include/misc.h.
WT_MB = 1048576
class test_hs04(wttest.WiredTigerTestCase):
uri = 'table:hs_04'
in_memory_values = [
('false', dict(in_memory=False)),
('none', dict(in_memory=None)),
('true', dict(in_memory=True))
Reported by Pylint.
Line: 60
Column: 5
scenarios = make_scenarios(init_file_max_values, reconfig_file_max_values,
in_memory_values)
def conn_config(self):
config = 'statistics=(fast)'
if self.init_file_max is not None:
config += ',history_store=(file_max={})'.format(self.init_file_max)
if self.in_memory is not None:
config += ',in_memory=' + ('true' if self.in_memory else 'false')
Reported by Pylint.
Line: 68
Column: 5
config += ',in_memory=' + ('true' if self.in_memory else 'false')
return config
def get_stat(self, stat):
stat_cursor = self.session.open_cursor('statistics:')
val = stat_cursor[stat][2]
stat_cursor.close()
return val
Reported by Pylint.
Line: 74
Column: 5
stat_cursor.close()
return val
def test_hs(self):
self.session.create(self.uri, 'key_format=S,value_format=S')
if self.in_memory:
# For in-memory configurations, we simply ignore any history store
# related configuration.
Reported by Pylint.
src/third_party/abseil-cpp-master/abseil-cpp/absl/time/internal/cctz/src/tzfile.h
9 issues
Line: 45
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
#define TZ_MAGIC "TZif"
struct tzhead {
char tzh_magic[4]; /* TZ_MAGIC */
char tzh_version[1]; /* '\0' or '2' or '3' as of 2013 */
char tzh_reserved[15]; /* reserved; must be zero */
char tzh_ttisutcnt[4]; /* coded number of trans. time flags */
char tzh_ttisstdcnt[4]; /* coded number of trans. time flags */
char tzh_leapcnt[4]; /* coded number of leap seconds */
Reported by FlawFinder.
Line: 46
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
struct tzhead {
char tzh_magic[4]; /* TZ_MAGIC */
char tzh_version[1]; /* '\0' or '2' or '3' as of 2013 */
char tzh_reserved[15]; /* reserved; must be zero */
char tzh_ttisutcnt[4]; /* coded number of trans. time flags */
char tzh_ttisstdcnt[4]; /* coded number of trans. time flags */
char tzh_leapcnt[4]; /* coded number of leap seconds */
char tzh_timecnt[4]; /* coded number of transition times */
Reported by FlawFinder.
Line: 47
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
struct tzhead {
char tzh_magic[4]; /* TZ_MAGIC */
char tzh_version[1]; /* '\0' or '2' or '3' as of 2013 */
char tzh_reserved[15]; /* reserved; must be zero */
char tzh_ttisutcnt[4]; /* coded number of trans. time flags */
char tzh_ttisstdcnt[4]; /* coded number of trans. time flags */
char tzh_leapcnt[4]; /* coded number of leap seconds */
char tzh_timecnt[4]; /* coded number of transition times */
char tzh_typecnt[4]; /* coded number of local time types */
Reported by FlawFinder.
Line: 48
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
char tzh_magic[4]; /* TZ_MAGIC */
char tzh_version[1]; /* '\0' or '2' or '3' as of 2013 */
char tzh_reserved[15]; /* reserved; must be zero */
char tzh_ttisutcnt[4]; /* coded number of trans. time flags */
char tzh_ttisstdcnt[4]; /* coded number of trans. time flags */
char tzh_leapcnt[4]; /* coded number of leap seconds */
char tzh_timecnt[4]; /* coded number of transition times */
char tzh_typecnt[4]; /* coded number of local time types */
char tzh_charcnt[4]; /* coded number of abbr. chars */
Reported by FlawFinder.
Line: 49
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
char tzh_version[1]; /* '\0' or '2' or '3' as of 2013 */
char tzh_reserved[15]; /* reserved; must be zero */
char tzh_ttisutcnt[4]; /* coded number of trans. time flags */
char tzh_ttisstdcnt[4]; /* coded number of trans. time flags */
char tzh_leapcnt[4]; /* coded number of leap seconds */
char tzh_timecnt[4]; /* coded number of transition times */
char tzh_typecnt[4]; /* coded number of local time types */
char tzh_charcnt[4]; /* coded number of abbr. chars */
};
Reported by FlawFinder.
Line: 50
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
char tzh_reserved[15]; /* reserved; must be zero */
char tzh_ttisutcnt[4]; /* coded number of trans. time flags */
char tzh_ttisstdcnt[4]; /* coded number of trans. time flags */
char tzh_leapcnt[4]; /* coded number of leap seconds */
char tzh_timecnt[4]; /* coded number of transition times */
char tzh_typecnt[4]; /* coded number of local time types */
char tzh_charcnt[4]; /* coded number of abbr. chars */
};
Reported by FlawFinder.
Line: 51
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
char tzh_ttisutcnt[4]; /* coded number of trans. time flags */
char tzh_ttisstdcnt[4]; /* coded number of trans. time flags */
char tzh_leapcnt[4]; /* coded number of leap seconds */
char tzh_timecnt[4]; /* coded number of transition times */
char tzh_typecnt[4]; /* coded number of local time types */
char tzh_charcnt[4]; /* coded number of abbr. chars */
};
/*
Reported by FlawFinder.
Line: 52
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
char tzh_ttisstdcnt[4]; /* coded number of trans. time flags */
char tzh_leapcnt[4]; /* coded number of leap seconds */
char tzh_timecnt[4]; /* coded number of transition times */
char tzh_typecnt[4]; /* coded number of local time types */
char tzh_charcnt[4]; /* coded number of abbr. chars */
};
/*
** . . .followed by. . .
Reported by FlawFinder.
Line: 53
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
char tzh_leapcnt[4]; /* coded number of leap seconds */
char tzh_timecnt[4]; /* coded number of transition times */
char tzh_typecnt[4]; /* coded number of local time types */
char tzh_charcnt[4]; /* coded number of abbr. chars */
};
/*
** . . .followed by. . .
**
Reported by FlawFinder.
src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/sunlink.py
9 issues
Line: 40
Column: 1
import SCons.Util
from . import link
ccLinker = None
# search for the acc compiler and linker front end
Reported by Pylint.
Line: 70
Column: 5
env['_RPATH'] = '${_concat(RPATHPREFIX, RPATH, RPATHSUFFIX, __env__)}'
# Support for versioned libraries
link._setup_versioned_lib_variables(env, tool = 'sunlink', use_soname = True)
env['LINKCALLBACKS'] = link._versioned_lib_callbacks()
def exists(env):
return ccLinker
Reported by Pylint.
Line: 71
Column: 28
# Support for versioned libraries
link._setup_versioned_lib_variables(env, tool = 'sunlink', use_soname = True)
env['LINKCALLBACKS'] = link._versioned_lib_callbacks()
def exists(env):
return ccLinker
# Local Variables:
Reported by Pylint.
Line: 73
Column: 12
link._setup_versioned_lib_variables(env, tool = 'sunlink', use_soname = True)
env['LINKCALLBACKS'] = link._versioned_lib_callbacks()
def exists(env):
return ccLinker
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
Reported by Pylint.
Line: 33
Column: 1
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/Tool/sunlink.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan"
import os
import os.path
import SCons.Util
Reported by Pylint.
Line: 42
Column: 1
from . import link
ccLinker = None
# search for the acc compiler and linker front end
try:
dirs = os.listdir('/opt')
Reported by Pylint.
Line: 62
Column: 1
def generate(env):
"""Add Builders and construction variables for Forte to an Environment."""
link.generate(env)
env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -G')
env['RPATHPREFIX'] = '-R'
env['RPATHSUFFIX'] = ''
env['_RPATH'] = '${_concat(RPATHPREFIX, RPATH, RPATHSUFFIX, __env__)}'
Reported by Pylint.
Line: 70
Column: 82
env['_RPATH'] = '${_concat(RPATHPREFIX, RPATH, RPATHSUFFIX, __env__)}'
# Support for versioned libraries
link._setup_versioned_lib_variables(env, tool = 'sunlink', use_soname = True)
env['LINKCALLBACKS'] = link._versioned_lib_callbacks()
def exists(env):
return ccLinker
Reported by Pylint.
Line: 73
Column: 1
link._setup_versioned_lib_variables(env, tool = 'sunlink', use_soname = True)
env['LINKCALLBACKS'] = link._versioned_lib_callbacks()
def exists(env):
return ccLinker
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
Reported by Pylint.
src/third_party/mozjs-60/extract/js/src/jit/arm64/vixl/Debugger-vixl.cpp
9 issues
Line: 233
Column: 5
CWE codes:
134
Suggestion:
Use a constant for the format specification
virtual void PrintData(void* data, FILE* out = stdout) const override {
T value;
memcpy(&value, data, sizeof(value));
fprintf(out, fmt_, value);
}
virtual void Print(FILE* out = stdout) const override;
private:
const char* fmt_;
Reported by FlawFinder.
Line: 729
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
PrintInstructions(pc());
bool done = false;
while (!done) {
char buffer[kMaxDebugShellLine];
char* line = ReadCommandLine("vixl> ", buffer, kMaxDebugShellLine);
if (line == NULL) continue; // An error occurred.
DebugCommand* command = DebugCommand::Parse(line);
Reported by FlawFinder.
Line: 138
Column: 19
CWE codes:
126
class IdentifierToken : public ValueToken<char*> {
public:
explicit IdentifierToken(const char* name) {
size_t size = strlen(name) + 1;
value_ = (char*)js_malloc(size);
strncpy(value_, name, size);
}
virtual ~IdentifierToken() { js_free(value_); }
Reported by FlawFinder.
Line: 140
Column: 5
CWE codes:
120
explicit IdentifierToken(const char* name) {
size_t size = strlen(name) + 1;
value_ = (char*)js_malloc(size);
strncpy(value_, name, size);
}
virtual ~IdentifierToken() { js_free(value_); }
virtual bool IsIdentifier() const override { return true; }
virtual bool CanAddressMemory() const override { return strcmp(value(), "pc") == 0; }
Reported by FlawFinder.
Line: 246
Column: 19
CWE codes:
126
class UnknownToken : public Token {
public:
explicit UnknownToken(const char* arg) {
size_t size = strlen(arg) + 1;
unknown_ = (char*)js_malloc(size);
strncpy(unknown_, arg, size);
}
virtual ~UnknownToken() { js_free(unknown_); }
virtual uint8_t* ToAddress(Debugger* debugger) const override {
Reported by FlawFinder.
Line: 248
Column: 5
CWE codes:
120
explicit UnknownToken(const char* arg) {
size_t size = strlen(arg) + 1;
unknown_ = (char*)js_malloc(size);
strncpy(unknown_, arg, size);
}
virtual ~UnknownToken() { js_free(unknown_); }
virtual uint8_t* ToAddress(Debugger* debugger) const override {
USE(debugger);
VIXL_ABORT();
Reported by FlawFinder.
Line: 905
Column: 7
CWE codes:
126
Token* FPRegisterToken::Tokenize(const char* arg) {
if (strlen(arg) < 2) {
return NULL;
}
switch (*arg) {
case 's':
Reported by FlawFinder.
Line: 983
Column: 8
CWE codes:
126
Token* AddressToken::Tokenize(const char* arg) {
if ((strlen(arg) < 3) || (arg[0] != '0') || (arg[1] != 'x')) {
return NULL;
}
uint64_t ptr = 0;
if (!StringToUInt64(&ptr, arg, 16)) {
Reported by FlawFinder.
Line: 1013
Column: 19
CWE codes:
126
Token* FormatToken::Tokenize(const char* arg) {
size_t length = strlen(arg);
switch (arg[0]) {
case 'x':
case 's':
case 'u':
case 'f':
Reported by FlawFinder.
src/third_party/abseil-cpp-master/abseil-cpp/absl/strings/internal/str_format/float_conversion.cc
9 issues
Line: 961
Column: 13
CWE codes:
134
Suggestion:
Use a constant for the format specification
std::string space(512, '\0');
absl::string_view result;
while (true) {
int n = snprintf(&space[0], space.size(), fmt, w, p, v);
if (n < 0) return false;
if (static_cast<size_t>(n) < space.size()) {
result = absl::string_view(space.data(), n);
break;
}
Reported by FlawFinder.
Line: 233
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
int decimal_start_;
int decimal_end_;
char digits_[kDigitsPerChunk];
int size_ = 0;
absl::Span<uint32_t> data_;
};
Reported by FlawFinder.
Line: 516
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
static constexpr size_t integral_size =
/* in case we need to round up an extra digit */ 1 +
/* decimal digits for uint128 */ 40 + 1;
char buffer[integral_size + /* . */ 1 + /* max digits uint128 */ 128];
buffer[integral_size] = '.';
char *const integral_digits_end = buffer + integral_size;
char *integral_digits_start;
char *const fractional_digits_start = buffer + integral_size + 1;
char *fractional_digits_end = fractional_digits_start;
Reported by FlawFinder.
Line: 884
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
+ std::numeric_limits<MaxFloatType>::digits / 4 // number of hex digits
+ 1 // round up
+ 1; // "." (dot)
char digits_buffer[kBufSizeForHexFloatRepr];
char *digits_iter = digits_buffer;
const char *const digits =
static_cast<const char *>("0123456789ABCDEF0123456789abcdef") +
(uppercase ? 0 : 16);
Reported by FlawFinder.
Line: 922
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
numbers_internal::kFastToBufferSize // requred for FastIntToBuffer
+ 1 // 'p' or 'P'
+ 1; // '+' or '-'
char exp_buffer[kBufSizeForExpDecRepr];
exp_buffer[0] = uppercase ? 'P' : 'p';
exp_buffer[1] = exp >= 0 ? '+' : '-';
numbers_internal::FastIntToBuffer(exp < 0 ? -exp : exp, exp_buffer + 2);
// ============ Assemble Result ==============
Reported by FlawFinder.
Line: 936
Column: 8
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
}
char *CopyStringTo(absl::string_view v, char *out) {
std::memcpy(out, v.data(), v.size());
return out + v.size();
}
template <typename Float>
bool FallbackToSnprintf(const Float v, const FormatConversionSpecImpl &conv,
Reported by FlawFinder.
Line: 945
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
FormatSinkImpl *sink) {
int w = conv.width() >= 0 ? conv.width() : 0;
int p = conv.precision() >= 0 ? conv.precision() : -1;
char fmt[32];
{
char *fp = fmt;
*fp++ = '%';
fp = CopyStringTo(FormatConversionSpecImplFriend::FlagsToString(conv), fp);
fp = CopyStringTo("*.*", fp);
Reported by FlawFinder.
Line: 1006
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
int size() const { return static_cast<int>(end - begin); }
char data[kBufferLength];
char *begin;
char *end;
};
enum class FormatStyle { Fixed, Precision };
Reported by FlawFinder.
Line: 1019
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
bool ConvertNonNumericFloats(char sign_char, Float v,
const FormatConversionSpecImpl &conv,
FormatSinkImpl *sink) {
char text[4], *ptr = text;
if (sign_char != '\0') *ptr++ = sign_char;
if (std::isnan(v)) {
ptr = std::copy_n(
FormatConversionCharIsUpper(conv.conversion_char()) ? "NAN" : "nan", 3,
ptr);
Reported by FlawFinder.
src/third_party/wiredtiger/test/suite/test_prepare_conflict.py
9 issues
Line: 33
Column: 1
# Evict a page while in the fast-truncate state.
#
import wiredtiger, wttest
from wtdataset import simple_key, simple_value
from wtscenario import make_scenarios
class test_prepare_conflict(wttest.WiredTigerTestCase):
key_format_values = [
Reported by Pylint.
Line: 33
Column: 1
# Evict a page while in the fast-truncate state.
#
import wiredtiger, wttest
from wtdataset import simple_key, simple_value
from wtscenario import make_scenarios
class test_prepare_conflict(wttest.WiredTigerTestCase):
key_format_values = [
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
# Evict a page while in the fast-truncate state.
#
import wiredtiger, wttest
from wtdataset import simple_key, simple_value
from wtscenario import make_scenarios
class test_prepare_conflict(wttest.WiredTigerTestCase):
key_format_values = [
Reported by Pylint.
Line: 37
Column: 1
from wtdataset import simple_key, simple_value
from wtscenario import make_scenarios
class test_prepare_conflict(wttest.WiredTigerTestCase):
key_format_values = [
('column', dict(key_format='r')),
('integer_row', dict(key_format='i')),
]
Reported by Pylint.
Line: 37
Column: 1
from wtdataset import simple_key, simple_value
from wtscenario import make_scenarios
class test_prepare_conflict(wttest.WiredTigerTestCase):
key_format_values = [
('column', dict(key_format='r')),
('integer_row', dict(key_format='i')),
]
Reported by Pylint.
Line: 45
Column: 5
scenarios = make_scenarios(key_format_values)
def test_prepare(self):
# Create a large table with lots of pages.
uri = "table:test_prepare_conflict"
key_format = 'key_format=' + self.key_format
config = 'allocation_size=512,leaf_page_max=512,{},value_format=S'.format(key_format)
self.session.create(uri, config)
Reported by Pylint.
Line: 63
Column: 9
self.session.begin_transaction('isolation=snapshot')
# Truncate the middle chunk.
c1 = self.session.open_cursor(uri, None)
c1.set_key(simple_key(c1, 10000))
c2 = self.session.open_cursor(uri, None)
c2.set_key(simple_key(c1, 70000))
self.session.truncate(None, c1, c2, None)
c1.close()
Reported by Pylint.
Line: 65
Column: 9
# Truncate the middle chunk.
c1 = self.session.open_cursor(uri, None)
c1.set_key(simple_key(c1, 10000))
c2 = self.session.open_cursor(uri, None)
c2.set_key(simple_key(c1, 70000))
self.session.truncate(None, c1, c2, None)
c1.close()
c2.close()
Reported by Pylint.
src/third_party/wiredtiger/test/suite/test_timestamp16.py
9 issues
Line: 36
Column: 1
import random
from suite_subprocess import suite_subprocess
import wiredtiger, wttest
class test_timestamp16(wttest.WiredTigerTestCase, suite_subprocess):
tablename = 'test_timestamp16'
uri = 'table:' + tablename
session_config = 'isolation=snapshot'
Reported by Pylint.
Line: 34
Column: 1
# end of a txn.
#
import random
from suite_subprocess import suite_subprocess
import wiredtiger, wttest
class test_timestamp16(wttest.WiredTigerTestCase, suite_subprocess):
tablename = 'test_timestamp16'
Reported by Pylint.
Line: 36
Column: 1
import random
from suite_subprocess import suite_subprocess
import wiredtiger, wttest
class test_timestamp16(wttest.WiredTigerTestCase, suite_subprocess):
tablename = 'test_timestamp16'
uri = 'table:' + tablename
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: 36
Column: 1
import random
from suite_subprocess import suite_subprocess
import wiredtiger, wttest
class test_timestamp16(wttest.WiredTigerTestCase, suite_subprocess):
tablename = 'test_timestamp16'
uri = 'table:' + tablename
session_config = 'isolation=snapshot'
Reported by Pylint.
Line: 36
Column: 1
import random
from suite_subprocess import suite_subprocess
import wiredtiger, wttest
class test_timestamp16(wttest.WiredTigerTestCase, suite_subprocess):
tablename = 'test_timestamp16'
uri = 'table:' + tablename
session_config = 'isolation=snapshot'
Reported by Pylint.
Line: 38
Column: 1
from suite_subprocess import suite_subprocess
import wiredtiger, wttest
class test_timestamp16(wttest.WiredTigerTestCase, suite_subprocess):
tablename = 'test_timestamp16'
uri = 'table:' + tablename
session_config = 'isolation=snapshot'
def test_read_timestamp_cleared(self):
Reported by Pylint.
Line: 38
Column: 1
from suite_subprocess import suite_subprocess
import wiredtiger, wttest
class test_timestamp16(wttest.WiredTigerTestCase, suite_subprocess):
tablename = 'test_timestamp16'
uri = 'table:' + tablename
session_config = 'isolation=snapshot'
def test_read_timestamp_cleared(self):
Reported by Pylint.
Line: 43
Column: 5
uri = 'table:' + tablename
session_config = 'isolation=snapshot'
def test_read_timestamp_cleared(self):
# Ensure that the read timestamp doesn't move our checkpoint.
self.session.create(self.uri, 'key_format=i,value_format=i')
self.session.begin_transaction('read_timestamp=100')
self.session.rollback_transaction()
self.session.checkpoint('use_timestamp=true')
Reported by Pylint.
src/third_party/wiredtiger/test/3rdparty/python-subunit-0.0.16/python/subunit/tests/test_subunit_tags.py
9 issues
Line: 21
Column: 1
from io import BytesIO
import testtools
from testtools.matchers import Contains
import subunit
import subunit.test_results
Reported by Pylint.
Line: 22
Column: 1
from io import BytesIO
import testtools
from testtools.matchers import Contains
import subunit
import subunit.test_results
Reported by Pylint.
Line: 9
Column: 2
# license at the users choice. A copy of both licenses are available in the
# project source as Apache-2.0 and BSD. You may not use this file except in
# compliance with one of these two licences.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under these licenses is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# license you chose for the specific language governing permissions and
# limitations under that license.
Reported by Pylint.
Line: 28
Column: 1
import subunit.test_results
class TestSubUnitTags(testtools.TestCase):
def setUp(self):
super(TestSubUnitTags, self).setUp()
self.original = BytesIO()
self.filtered = BytesIO()
Reported by Pylint.
Line: 30
Column: 5
class TestSubUnitTags(testtools.TestCase):
def setUp(self):
super(TestSubUnitTags, self).setUp()
self.original = BytesIO()
self.filtered = BytesIO()
def test_add_tag(self):
Reported by Pylint.
Line: 30
Column: 5
class TestSubUnitTags(testtools.TestCase):
def setUp(self):
super(TestSubUnitTags, self).setUp()
self.original = BytesIO()
self.filtered = BytesIO()
def test_add_tag(self):
Reported by Pylint.
Line: 31
Column: 9
class TestSubUnitTags(testtools.TestCase):
def setUp(self):
super(TestSubUnitTags, self).setUp()
self.original = BytesIO()
self.filtered = BytesIO()
def test_add_tag(self):
# Literal values to avoid set sort-order dependencies. Python code show
Reported by Pylint.
Line: 35
Column: 5
self.original = BytesIO()
self.filtered = BytesIO()
def test_add_tag(self):
# Literal values to avoid set sort-order dependencies. Python code show
# derivation.
# reference = BytesIO()
# stream = subunit.StreamResultToBytes(reference)
# stream.status(
Reported by Pylint.
Line: 70
Column: 5
0, subunit.tag_stream(self.original, self.filtered, ["quux"]))
self.assertThat(reference, Contains(self.filtered.getvalue()))
def test_remove_tag(self):
reference = BytesIO()
stream = subunit.StreamResultToBytes(reference)
stream.status(
test_id='test', test_status='inprogress', test_tags=set(['foo']))
stream.status(
Reported by Pylint.
src/third_party/abseil-cpp-master/abseil-cpp/absl/strings/cord.h
9 issues
Line: 747
Column: 7
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
// to 15 bytes does not cause a memory allocation.
absl::strings_internal::STLStringResizeUninitialized(dst,
sizeof(data_) - 1);
memcpy(&(*dst)[0], &data_, sizeof(data_) - 1);
// erase is faster than resize because the logic for memory allocation is
// not needed.
dst->erase(inline_size());
}
Reported by FlawFinder.
Line: 866
Column: 5
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
assert(n <= 16);
uint64_t buf1;
uint64_t buf2;
memcpy(&buf1, src, 8);
memcpy(&buf2, src + n - 8, 8);
if (nullify_tail) {
memset(dst + 8, 0, 8);
}
memcpy(dst, &buf1, 8);
Reported by FlawFinder.
Line: 867
Column: 5
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
uint64_t buf1;
uint64_t buf2;
memcpy(&buf1, src, 8);
memcpy(&buf2, src + n - 8, 8);
if (nullify_tail) {
memset(dst + 8, 0, 8);
}
memcpy(dst, &buf1, 8);
memcpy(dst + n - 8, &buf2, 8);
Reported by FlawFinder.
Line: 871
Column: 5
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
if (nullify_tail) {
memset(dst + 8, 0, 8);
}
memcpy(dst, &buf1, 8);
memcpy(dst + n - 8, &buf2, 8);
} else if (n >= 4) {
uint32_t buf1;
uint32_t buf2;
memcpy(&buf1, src, 4);
Reported by FlawFinder.
Line: 872
Column: 5
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
memset(dst + 8, 0, 8);
}
memcpy(dst, &buf1, 8);
memcpy(dst + n - 8, &buf2, 8);
} else if (n >= 4) {
uint32_t buf1;
uint32_t buf2;
memcpy(&buf1, src, 4);
memcpy(&buf2, src + n - 4, 4);
Reported by FlawFinder.
Line: 876
Column: 5
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
} else if (n >= 4) {
uint32_t buf1;
uint32_t buf2;
memcpy(&buf1, src, 4);
memcpy(&buf2, src + n - 4, 4);
if (nullify_tail) {
memset(dst + 4, 0, 4);
memset(dst + 8, 0, 8);
}
Reported by FlawFinder.
Line: 877
Column: 5
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
uint32_t buf1;
uint32_t buf2;
memcpy(&buf1, src, 4);
memcpy(&buf2, src + n - 4, 4);
if (nullify_tail) {
memset(dst + 4, 0, 4);
memset(dst + 8, 0, 8);
}
memcpy(dst, &buf1, 4);
Reported by FlawFinder.
Line: 882
Column: 5
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
memset(dst + 4, 0, 4);
memset(dst + 8, 0, 8);
}
memcpy(dst, &buf1, 4);
memcpy(dst + n - 4, &buf2, 4);
} else {
if (n != 0) {
dst[0] = src[0];
dst[n / 2] = src[n / 2];
Reported by FlawFinder.
Line: 883
Column: 5
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
memset(dst + 8, 0, 8);
}
memcpy(dst, &buf1, 4);
memcpy(dst + n - 4, &buf2, 4);
} else {
if (n != 0) {
dst[0] = src[0];
dst[n / 2] = src[n / 2];
dst[n - 1] = src[n - 1];
Reported by FlawFinder.