The following issues were found
src/third_party/mozjs-60/extract/js/src/jit/mips-shared/MacroAssembler-mips-shared.cpp
44 issues
Line: 555
Column: 75
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
}
void
MacroAssemblerMIPSShared::ma_load_unaligned(const wasm::MemoryAccessDesc& access, Register dest, const BaseIndex& src, Register temp,
LoadStoreSize size, LoadStoreExtension extension)
{
MOZ_ASSERT(MOZ_LITTLE_ENDIAN, "Wasm-only; wasm is disabled on big-endian.");
int16_t lowOffset, hiOffset;
Register base;
Reported by FlawFinder.
Line: 604
Column: 12
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
MOZ_CRASH("Invalid argument for ma_load");
}
append(access, load.getOffset(), asMasm().framePushed());
}
void
MacroAssemblerMIPSShared::ma_store(Register data, const BaseIndex& dest,
LoadStoreSize size, LoadStoreExtension extension)
Reported by FlawFinder.
Line: 708
Column: 76
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
}
void
MacroAssemblerMIPSShared::ma_store_unaligned(const wasm::MemoryAccessDesc& access, Register data,
const BaseIndex& dest, Register temp,
LoadStoreSize size, LoadStoreExtension extension)
{
MOZ_ASSERT(MOZ_LITTLE_ENDIAN, "Wasm-only; wasm is disabled on big-endian.");
int16_t lowOffset, hiOffset;
Reported by FlawFinder.
Line: 750
Column: 12
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
default:
MOZ_CRASH("Invalid argument for ma_store");
}
append(access, store.getOffset(), asMasm().framePushed());
}
// Branches when done from within mips-specific code.
void
MacroAssemblerMIPSShared::ma_b(Register lhs, Register rhs, Label* label, Condition c, JumpKind jumpKind)
Reported by FlawFinder.
Line: 2033
Column: 56
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
}
void
MacroAssembler::wasmLoad(const wasm::MemoryAccessDesc& access, Register memoryBase, Register ptr,
Register ptrScratch, AnyRegister output)
{
wasmLoadImpl(access, memoryBase, ptr, ptrScratch, output, InvalidReg);
}
Reported by FlawFinder.
Line: 2036
Column: 18
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
MacroAssembler::wasmLoad(const wasm::MemoryAccessDesc& access, Register memoryBase, Register ptr,
Register ptrScratch, AnyRegister output)
{
wasmLoadImpl(access, memoryBase, ptr, ptrScratch, output, InvalidReg);
}
void
MacroAssembler::wasmUnalignedLoad(const wasm::MemoryAccessDesc& access, Register memoryBase,
Register ptr, Register ptrScratch, Register output, Register tmp)
Reported by FlawFinder.
Line: 2040
Column: 65
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
}
void
MacroAssembler::wasmUnalignedLoad(const wasm::MemoryAccessDesc& access, Register memoryBase,
Register ptr, Register ptrScratch, Register output, Register tmp)
{
wasmLoadImpl(access, memoryBase, ptr, ptrScratch, AnyRegister(output), tmp);
}
Reported by FlawFinder.
Line: 2043
Column: 18
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
MacroAssembler::wasmUnalignedLoad(const wasm::MemoryAccessDesc& access, Register memoryBase,
Register ptr, Register ptrScratch, Register output, Register tmp)
{
wasmLoadImpl(access, memoryBase, ptr, ptrScratch, AnyRegister(output), tmp);
}
void
MacroAssembler::wasmUnalignedLoadFP(const wasm::MemoryAccessDesc& access, Register memoryBase,
Register ptr, Register ptrScratch, FloatRegister output,
Reported by FlawFinder.
Line: 2047
Column: 67
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
}
void
MacroAssembler::wasmUnalignedLoadFP(const wasm::MemoryAccessDesc& access, Register memoryBase,
Register ptr, Register ptrScratch, FloatRegister output,
Register tmp1, Register tmp2, Register tmp3)
{
MOZ_ASSERT(tmp2 == InvalidReg);
MOZ_ASSERT(tmp3 == InvalidReg);
Reported by FlawFinder.
Line: 2053
Column: 18
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
{
MOZ_ASSERT(tmp2 == InvalidReg);
MOZ_ASSERT(tmp3 == InvalidReg);
wasmLoadImpl(access, memoryBase, ptr, ptrScratch, AnyRegister(output), tmp1);
}
void
MacroAssembler::wasmStore(const wasm::MemoryAccessDesc& access, AnyRegister value,
Register memoryBase, Register ptr, Register ptrScratch)
Reported by FlawFinder.
src/mongo/shell/linenoise.cpp
44 issues
Line: 1261
Column: 21
CWE codes:
120
Suggestion:
Use sprintf_s, snprintf, or vsnprintf
if ( rec.EventType == KEY_EVENT ) {
//if ( rec.Event.KeyEvent.uChar.UnicodeChar ) {
char buf[1024];
sprintf(
buf,
"Unicode character 0x%04X, repeat count %d, virtual keycode 0x%04X, "
"virtual scancode 0x%04X, key %s%s%s%s%s\n",
rec.Event.KeyEvent.uChar.UnicodeChar,
rec.Event.KeyEvent.wRepeatCount,
Reported by FlawFinder.
Line: 499
Column: 18
CWE codes:
807
20
Suggestion:
Check environment variables carefully before using them
static void linenoiseAtExit(void);
static bool isUnsupportedTerm(void) {
char* term = getenv("TERM");
if (term == nullptr)
return false;
for (int j = 0; unsupported_term[j]; ++j)
if (!strcasecmp(term, unsupported_term[j])) {
return true;
Reported by FlawFinder.
Line: 299
Column: 9
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
promptChars; // TODO fix this, we are asssuming that the history prompt won't wrap (!)
promptPreviousLen = promptChars;
Utf32String tempUnicode(promptChars + 1);
memcpy(tempUnicode.get(), basePrompt->get(), sizeof(UChar32) * promptStartLength);
memcpy(&tempUnicode[promptStartLength],
endSearchBasePrompt.get(),
sizeof(UChar32) * (endSearchBasePrompt.length() + 1));
tempUnicode.initFromBuffer();
promptText = tempUnicode;
Reported by FlawFinder.
Line: 300
Column: 9
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
promptPreviousLen = promptChars;
Utf32String tempUnicode(promptChars + 1);
memcpy(tempUnicode.get(), basePrompt->get(), sizeof(UChar32) * promptStartLength);
memcpy(&tempUnicode[promptStartLength],
endSearchBasePrompt.get(),
sizeof(UChar32) * (endSearchBasePrompt.length() + 1));
tempUnicode.initFromBuffer();
promptText = tempUnicode;
calculateScreenPosition(
Reported by FlawFinder.
Line: 315
Column: 9
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
size_t promptStartLength = basePrompt->length();
promptChars = promptStartLength + searchTextLen + endSearchBasePrompt.length();
Utf32String tempUnicode(promptChars + 1);
memcpy(tempUnicode.get(), basePrompt->get(), sizeof(UChar32) * promptStartLength);
memcpy(&tempUnicode[promptStartLength], searchText.get(), sizeof(UChar32) * searchTextLen);
size_t endIndex = promptStartLength + searchTextLen;
memcpy(&tempUnicode[endIndex],
endSearchBasePrompt.get(),
sizeof(UChar32) * (endSearchBasePrompt.length() + 1));
Reported by FlawFinder.
Line: 316
Column: 9
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
promptChars = promptStartLength + searchTextLen + endSearchBasePrompt.length();
Utf32String tempUnicode(promptChars + 1);
memcpy(tempUnicode.get(), basePrompt->get(), sizeof(UChar32) * promptStartLength);
memcpy(&tempUnicode[promptStartLength], searchText.get(), sizeof(UChar32) * searchTextLen);
size_t endIndex = promptStartLength + searchTextLen;
memcpy(&tempUnicode[endIndex],
endSearchBasePrompt.get(),
sizeof(UChar32) * (endSearchBasePrompt.length() + 1));
tempUnicode.initFromBuffer();
Reported by FlawFinder.
Line: 318
Column: 9
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
memcpy(tempUnicode.get(), basePrompt->get(), sizeof(UChar32) * promptStartLength);
memcpy(&tempUnicode[promptStartLength], searchText.get(), sizeof(UChar32) * searchTextLen);
size_t endIndex = promptStartLength + searchTextLen;
memcpy(&tempUnicode[endIndex],
endSearchBasePrompt.get(),
sizeof(UChar32) * (endSearchBasePrompt.length() + 1));
tempUnicode.initFromBuffer();
promptText = tempUnicode;
}
Reported by FlawFinder.
Line: 337
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
static const int capacity = 10;
int size;
int index;
char indexToSlot[10];
vector<Utf32String> theRing;
public:
enum action { actionOther, actionKill, actionYank };
action lastAction;
Reported by FlawFinder.
Line: 360
Column: 17
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
int resultLen = currentLen + textLen;
Utf32String temp(resultLen + 1);
if (forward) {
memcpy(temp.get(), theRing[slot].get(), currentLen * sizeof(UChar32));
memcpy(&temp[currentLen], killedText.get(), textLen * sizeof(UChar32));
} else {
memcpy(temp.get(), killedText.get(), textLen * sizeof(UChar32));
memcpy(&temp[textLen], theRing[slot].get(), currentLen * sizeof(UChar32));
}
Reported by FlawFinder.
Line: 361
Column: 17
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
Utf32String temp(resultLen + 1);
if (forward) {
memcpy(temp.get(), theRing[slot].get(), currentLen * sizeof(UChar32));
memcpy(&temp[currentLen], killedText.get(), textLen * sizeof(UChar32));
} else {
memcpy(temp.get(), killedText.get(), textLen * sizeof(UChar32));
memcpy(&temp[textLen], theRing[slot].get(), currentLen * sizeof(UChar32));
}
temp[resultLen] = 0;
Reported by FlawFinder.
src/third_party/mozjs-60/extract/js/src/jit/mips32/MacroAssembler-mips32.cpp
44 issues
Line: 1127
Column: 77
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
}
void
MacroAssemblerMIPSCompat::loadUnalignedDouble(const wasm::MemoryAccessDesc& access,
const BaseIndex& src, Register temp, FloatRegister dest)
{
MOZ_ASSERT(MOZ_LITTLE_ENDIAN, "Wasm-only; wasm is disabled on big-endian.");
computeScaledAddress(src, SecondScratchReg);
Reported by FlawFinder.
Line: 1138
Column: 16
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
if (Imm16::IsInSignedRange(src.offset) && Imm16::IsInSignedRange(src.offset + 7)) {
load = as_lwl(temp, SecondScratchReg, src.offset + INT64LOW_OFFSET + 3);
as_lwr(temp, SecondScratchReg, src.offset + INT64LOW_OFFSET);
append(access, load.getOffset(), framePushed);
moveToDoubleLo(temp, dest);
load = as_lwl(temp, SecondScratchReg, src.offset + INT64HIGH_OFFSET + 3);
as_lwr(temp, SecondScratchReg, src.offset + INT64HIGH_OFFSET);
append(access, load.getOffset(), framePushed);
moveToDoubleHi(temp, dest);
Reported by FlawFinder.
Line: 1142
Column: 16
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
moveToDoubleLo(temp, dest);
load = as_lwl(temp, SecondScratchReg, src.offset + INT64HIGH_OFFSET + 3);
as_lwr(temp, SecondScratchReg, src.offset + INT64HIGH_OFFSET);
append(access, load.getOffset(), framePushed);
moveToDoubleHi(temp, dest);
} else {
ma_li(ScratchRegister, Imm32(src.offset));
as_daddu(ScratchRegister, SecondScratchReg, ScratchRegister);
load = as_lwl(temp, ScratchRegister, INT64LOW_OFFSET + 3);
Reported by FlawFinder.
Line: 1149
Column: 16
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
as_daddu(ScratchRegister, SecondScratchReg, ScratchRegister);
load = as_lwl(temp, ScratchRegister, INT64LOW_OFFSET + 3);
as_lwr(temp, ScratchRegister, INT64LOW_OFFSET);
append(access, load.getOffset(), framePushed);
moveToDoubleLo(temp, dest);
load = as_lwl(temp, ScratchRegister, INT64HIGH_OFFSET + 3);
as_lwr(temp, ScratchRegister, INT64HIGH_OFFSET);
append(access, load.getOffset(), framePushed);
moveToDoubleHi(temp, dest);
Reported by FlawFinder.
Line: 1153
Column: 16
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
moveToDoubleLo(temp, dest);
load = as_lwl(temp, ScratchRegister, INT64HIGH_OFFSET + 3);
as_lwr(temp, ScratchRegister, INT64HIGH_OFFSET);
append(access, load.getOffset(), framePushed);
moveToDoubleHi(temp, dest);
}
}
void
Reported by FlawFinder.
Line: 1159
Column: 78
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
}
void
MacroAssemblerMIPSCompat::loadUnalignedFloat32(const wasm::MemoryAccessDesc& access,
const BaseIndex& src, Register temp, FloatRegister dest)
{
MOZ_ASSERT(MOZ_LITTLE_ENDIAN, "Wasm-only; wasm is disabled on big-endian.");
computeScaledAddress(src, SecondScratchReg);
BufferOffset load;
Reported by FlawFinder.
Line: 1174
Column: 12
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
load = as_lwl(temp, ScratchRegister, 3);
as_lwr(temp, ScratchRegister, 0);
}
append(access, load.getOffset(), asMasm().framePushed());
moveToFloat32(temp, dest);
}
void
MacroAssemblerMIPSCompat::store8(Imm32 imm, const Address& address)
Reported by FlawFinder.
Line: 1312
Column: 79
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
}
void
MacroAssemblerMIPSCompat::storeUnalignedFloat32(const wasm::MemoryAccessDesc& access,
FloatRegister src, Register temp, const BaseIndex& dest)
{
MOZ_ASSERT(MOZ_LITTLE_ENDIAN, "Wasm-only; wasm is disabled on big-endian.");
computeScaledAddress(dest, SecondScratchReg);
moveFromFloat32(src, temp);
Reported by FlawFinder.
Line: 1329
Column: 12
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
store = as_swl(temp, ScratchRegister, 3);
as_swr(temp, ScratchRegister, 0);
}
append(access, store.getOffset(), asMasm().framePushed());
}
void
MacroAssemblerMIPSCompat::storeUnalignedDouble(const wasm::MemoryAccessDesc& access,
FloatRegister src, Register temp, const BaseIndex& dest)
Reported by FlawFinder.
Line: 1333
Column: 78
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
}
void
MacroAssemblerMIPSCompat::storeUnalignedDouble(const wasm::MemoryAccessDesc& access,
FloatRegister src, Register temp, const BaseIndex& dest)
{
MOZ_ASSERT(MOZ_LITTLE_ENDIAN, "Wasm-only; wasm is disabled on big-endian.");
computeScaledAddress(dest, SecondScratchReg);
Reported by FlawFinder.
src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/cyglink.py
44 issues
Line: 21
Column: 1
import SCons.Tool
#MAYBE: from . import gnulink
from . import gnulink
from . import link
def _lib_generator(target, source, env, for_signature, **kw):
try: cmd = kw['cmd']
except KeyError: cmd = SCons.Util.CLVar(['$SHLINK'])
Reported by Pylint.
Line: 22
Column: 1
#MAYBE: from . import gnulink
from . import gnulink
from . import link
def _lib_generator(target, source, env, for_signature, **kw):
try: cmd = kw['cmd']
except KeyError: cmd = SCons.Util.CLVar(['$SHLINK'])
Reported by Pylint.
Line: 24
Column: 28
from . import gnulink
from . import link
def _lib_generator(target, source, env, for_signature, **kw):
try: cmd = kw['cmd']
except KeyError: cmd = SCons.Util.CLVar(['$SHLINK'])
try: vp = kw['varprefix']
except KeyError: vp = 'SHLIB'
Reported by Pylint.
Line: 129
Column: 27
def ldmod_emitter(target, source, env):
return _lib_emitter(target, source, env, varprefix='LDMODULE', libtype='LdMod')
def _versioned_lib_suffix(env, suffix, version):
"""Generate versioned shared library suffix from a unversioned one.
If suffix='.dll', and version='0.1.2', then it returns '-0-1-2.dll'"""
Verbose = False
if Verbose:
print("_versioned_lib_suffix: suffix= ", suffix)
Reported by Pylint.
Line: 144
Column: 12
return suffix
def _versioned_implib_name(env, libnode, version, prefix, suffix, **kw):
return link._versioned_lib_name(env, libnode, version, prefix, suffix,
SCons.Tool.ImpLibPrefixGenerator,
SCons.Tool.ImpLibSuffixGenerator,
implib_libtype=kw['libtype'])
def _versioned_implib_symlinks(env, libnode, version, prefix, suffix, **kw):
Reported by Pylint.
Line: 149
Column: 55
SCons.Tool.ImpLibSuffixGenerator,
implib_libtype=kw['libtype'])
def _versioned_implib_symlinks(env, libnode, version, prefix, suffix, **kw):
"""Generate link names that should be created for a versioned shared library.
Returns a list in the form [ (link, linktarget), ... ]
"""
Verbose = False
Reported by Pylint.
Line: 149
Column: 63
SCons.Tool.ImpLibSuffixGenerator,
implib_libtype=kw['libtype'])
def _versioned_implib_symlinks(env, libnode, version, prefix, suffix, **kw):
"""Generate link names that should be created for a versioned shared library.
Returns a list in the form [ (link, linktarget), ... ]
"""
Verbose = False
Reported by Pylint.
Line: 173
Column: 5
if Verbose:
print("_versioned_implib_symlinks: name=%r" % name)
major = version.split('.')[0]
link0 = env.fs.File(os.path.join(linkdir, name))
symlinks = [(link0, libnode)]
if Verbose:
Reported by Pylint.
Line: 214
Column: 43
'VersionedShLibSuffix' : _versioned_lib_suffix,
'VersionedLdModSuffix' : _versioned_lib_suffix,
'VersionedImpLibSuffix' : _versioned_lib_suffix,
'VersionedShLibName' : link._versioned_shlib_name,
'VersionedLdModName' : link._versioned_ldmod_name,
'VersionedShLibImpLibName' : lambda *args: _versioned_implib_name(*args, libtype='ShLib'),
'VersionedLdModImpLibName' : lambda *args: _versioned_implib_name(*args, libtype='LdMod'),
'VersionedShLibImpLibSymlinks' : lambda *args: _versioned_implib_symlinks(*args, libtype='ShLib'),
'VersionedLdModImpLibSymlinks' : lambda *args: _versioned_implib_symlinks(*args, libtype='LdMod'),
Reported by Pylint.
Line: 215
Column: 43
'VersionedLdModSuffix' : _versioned_lib_suffix,
'VersionedImpLibSuffix' : _versioned_lib_suffix,
'VersionedShLibName' : link._versioned_shlib_name,
'VersionedLdModName' : link._versioned_ldmod_name,
'VersionedShLibImpLibName' : lambda *args: _versioned_implib_name(*args, libtype='ShLib'),
'VersionedLdModImpLibName' : lambda *args: _versioned_implib_name(*args, libtype='LdMod'),
'VersionedShLibImpLibSymlinks' : lambda *args: _versioned_implib_symlinks(*args, libtype='ShLib'),
'VersionedLdModImpLibSymlinks' : lambda *args: _versioned_implib_symlinks(*args, libtype='LdMod'),
}
Reported by Pylint.
src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/qt.py
43 issues
Line: 40
Column: 1
import os.path
import re
import glob
import SCons.Action
import SCons.Builder
import SCons.Defaults
import SCons.Scanner
Reported by Pylint.
Line: 92
Column: 3
# Centos installs QT under /usr/{lib,lib64}/qt{4,5,-3.3}/bin
# so we need to handle this differently
# qt_bin_dirs = glob.glob('/usr/lib64/qt*/bin')
# TODO: all current Fedoras do the same, need to look deeper here.
qt_bin_dir = '/usr/lib64/qt-3.3/bin'
return qt_bin_dir
Reported by Pylint.
Line: 114
Column: 9
(str(moc), str(cpp)))
def find_file(filename, paths, node_factory):
for dir in paths:
node = node_factory(filename, dir)
if node.rexists():
return node
return None
Reported by Pylint.
Line: 257
Column: 31
env.subst('$QT_MOCHSUFFIX')))
return target, source
def uicScannerFunc(node, env, path):
lookout = []
lookout.extend(env['CPPPATH'])
lookout.append(str(node.rfile().dir))
includes = re.findall("<include.*?>(.*?)</include>", node.get_text_contents())
result = []
Reported by Pylint.
Line: 36
Column: 1
#
from __future__ import print_function
__revision__ = "src/engine/SCons/Tool/qt.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan"
import os.path
import re
import glob
Reported by Pylint.
Line: 51
Column: 1
import SCons.Tool.cxx
cplusplus = SCons.Tool.cxx
class ToolQtWarning(SCons.Warnings.Warning):
pass
class GeneratedMocFileNotIncluded(ToolQtWarning):
pass
Reported by Pylint.
Line: 54
Column: 1
class ToolQtWarning(SCons.Warnings.Warning):
pass
class GeneratedMocFileNotIncluded(ToolQtWarning):
pass
class QtdirNotFound(ToolQtWarning):
pass
Reported by Pylint.
Line: 57
Column: 1
class GeneratedMocFileNotIncluded(ToolQtWarning):
pass
class QtdirNotFound(ToolQtWarning):
pass
SCons.Warnings.enableWarningClass(ToolQtWarning)
header_extensions = [".h", ".hxx", ".hpp", ".hh"]
Reported by Pylint.
Line: 85
Column: 49
# qt_bin_dirs = []
qt_bin_dir = None
if os.path.isfile('/etc/redhat-release'):
with open('/etc/redhat-release','r') as rr:
lines = rr.readlines()
distro = lines[0].split()[0]
if distro == 'CentOS':
# Centos installs QT under /usr/{lib,lib64}/qt{4,5,-3.3}/bin
# so we need to handle this differently
Reported by Pylint.
Line: 100
Column: 1
QT_BIN_DIR = find_platform_specific_qt_paths()
def checkMocIncluded(target, source, env):
moc = target[0]
cpp = source[0]
# looks like cpp.includes is cleared before the build stage :-(
# not really sure about the path transformations (moc.cwd? cpp.cwd?) :-/
path = SCons.Defaults.CScan.path(env, moc.cwd)
Reported by Pylint.
src/third_party/IntelRDFPMathLib20U1/LIBRARY/float128/dpml_ux_radian_reduce.c
43 issues
Line: 983
CWE codes:
758
** The extended-precision multiply: w = F*g.
*/
MULTIPLY_F_AND_G_DIGITS( /* F_DIGITS, G_DIGITS, T_DIGITS, */ CARRY_DIGIT );
/*
** Add in the variable octant.
*/
Reported by Cppcheck.
Line: 983
CWE codes:
758
** The extended-precision multiply: w = F*g.
*/
MULTIPLY_F_AND_G_DIGITS( /* F_DIGITS, G_DIGITS, T_DIGITS, */ CARRY_DIGIT );
/*
** Add in the variable octant.
*/
Reported by Cppcheck.
Line: 1008
CWE codes:
758
next_g_digit = *p++;
if (offset)
TMP_DIGIT = (TMP_DIGIT << offset) | (next_g_digit >> j);
GET_NEXT_PRODUCT(TMP_DIGIT, EXTRA_W_DIGIT, CARRY_DIGIT);
/*
** We're done if the there are fewer than L bits of 0's or 1's.
*/
Reported by Cppcheck.
Line: 1008
CWE codes:
758
next_g_digit = *p++;
if (offset)
TMP_DIGIT = (TMP_DIGIT << offset) | (next_g_digit >> j);
GET_NEXT_PRODUCT(TMP_DIGIT, EXTRA_W_DIGIT, CARRY_DIGIT);
/*
** We're done if the there are fewer than L bits of 0's or 1's.
*/
Reported by Cppcheck.
Line: 633
Column: 9
CWE codes:
134
Suggestion:
Use a constant for the format specification
printf("#define GET_F_DIGITS(x)" );
for (i = 0; i < num_f_digits; i++)
printf( sMAC2 "F%i = G_UX_FRACTION_DIGIT(x, %i)",
NUM_UX_FRACTION_DIGITS - 1 - i, i);
printf(MAC3);
printf("#define PUT_W_DIGITS(x)" );
for (i = 0; i < num_f_digits; i++)
Reported by FlawFinder.
Line: 635
Column: 5
CWE codes:
134
Suggestion:
Use a constant for the format specification
for (i = 0; i < num_f_digits; i++)
printf( sMAC2 "F%i = G_UX_FRACTION_DIGIT(x, %i)",
NUM_UX_FRACTION_DIGITS - 1 - i, i);
printf(MAC3);
printf("#define PUT_W_DIGITS(x)" );
for (i = 0; i < num_f_digits; i++)
printf( sMAC2 "P_UX_FRACTION_DIGIT(x, %i, g%i)",
i, num_g_digits - 1 - i);
Reported by FlawFinder.
Line: 639
Column: 9
CWE codes:
134
Suggestion:
Use a constant for the format specification
printf("#define PUT_W_DIGITS(x)" );
for (i = 0; i < num_f_digits; i++)
printf( sMAC2 "P_UX_FRACTION_DIGIT(x, %i, g%i)",
i, num_g_digits - 1 - i);
printf(MAC3);
/*
** NEGATE_W negates the high num_f_digits + 1 digits of w
Reported by FlawFinder.
Line: 641
Column: 5
CWE codes:
134
Suggestion:
Use a constant for the format specification
for (i = 0; i < num_f_digits; i++)
printf( sMAC2 "P_UX_FRACTION_DIGIT(x, %i, g%i)",
i, num_g_digits - 1 - i);
printf(MAC3);
/*
** NEGATE_W negates the high num_f_digits + 1 digits of w
*/
Reported by FlawFinder.
Line: 669
Column: 9
CWE codes:
134
Suggestion:
Use a constant for the format specification
/* Better performance with DEC C -- don't auto-increment! */
for (i = num_g_digits - 1; i >= 0; i--)
printf(MAC2 "g%i = p[%i]; ", i, num_g_digits - 1 - i);
printf(MAC2 "extra_digit = p[%i]; ", num_g_digits);
printf(MAC2 "p += %i", num_g_digits + 1);
printf(MAC3);
/*
Reported by FlawFinder.
Line: 670
Column: 5
CWE codes:
134
Suggestion:
Use a constant for the format specification
/* Better performance with DEC C -- don't auto-increment! */
for (i = num_g_digits - 1; i >= 0; i--)
printf(MAC2 "g%i = p[%i]; ", i, num_g_digits - 1 - i);
printf(MAC2 "extra_digit = p[%i]; ", num_g_digits);
printf(MAC2 "p += %i", num_g_digits + 1);
printf(MAC3);
/*
** Generate macro that aligns g bits
Reported by FlawFinder.
src/third_party/wiredtiger/test/suite/test_util01.py
43 issues
Line: 31
Column: 1
import string, os, sys, random
from suite_subprocess import suite_subprocess
import wiredtiger, wttest
# test_util01.py
# Utilities: wt dump, as well as the dump cursor
class test_util01(wttest.WiredTigerTestCase, suite_subprocess):
"""
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 string, os, sys, random
from suite_subprocess import suite_subprocess
import wiredtiger, wttest
# test_util01.py
# Utilities: wt dump, as well as the dump cursor
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 string, os, sys, random
from suite_subprocess import suite_subprocess
import wiredtiger, wttest
# test_util01.py
# Utilities: wt dump, as well as the dump cursor
Reported by Pylint.
Line: 76
Column: 28
inheader = isconfig = False
return True
def get_bytes(self, i, len):
"""
Return a pseudo-random, but predictable string that uses
all characters. As a special case, key 0 returns all characters
1-255 repeated
"""
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 string, os, sys, random
from suite_subprocess import suite_subprocess
import wiredtiger, wttest
# test_util01.py
# Utilities: wt dump, as well as the dump cursor
Reported by Pylint.
Line: 31
Column: 1
import string, os, sys, random
from suite_subprocess import suite_subprocess
import wiredtiger, wttest
# test_util01.py
# Utilities: wt dump, as well as the dump cursor
class test_util01(wttest.WiredTigerTestCase, suite_subprocess):
"""
Reported by Pylint.
Line: 31
Column: 1
import string, os, sys, random
from suite_subprocess import suite_subprocess
import wiredtiger, wttest
# test_util01.py
# Utilities: wt dump, as well as the dump cursor
class test_util01(wttest.WiredTigerTestCase, suite_subprocess):
"""
Reported by Pylint.
Line: 35
Column: 1
# test_util01.py
# Utilities: wt dump, as well as the dump cursor
class test_util01(wttest.WiredTigerTestCase, suite_subprocess):
"""
Test wt dump. We check for specific output.
Note that we don't test dumping {key,value}_format that are integer
here. That's because the integer values are encoded and we don't
want to duplicate the encoding/decoding algorithms. Integer dump
Reported by Pylint.
Line: 50
Column: 5
session_config = 'isolation=snapshot'
stringclass = ''.__class__
def compare_config(self, expected_cfg, actual_cfg):
# Replace '(' characters so configuration groups don't break parsing.
# If we ever want to look for config groups this will need to change.
da = dict(kv.split('=') for kv in
actual_cfg.strip().replace('(',',').split(','))
de = da.copy()
Reported by Pylint.
src/third_party/wiredtiger/test/3rdparty/testscenarios-0.4/lib/testscenarios/tests/test_testcase.py
43 issues
Line: 20
Column: 1
import unittest
import testscenarios
import testtools
from testtools.tests.helpers import LoggingResult
class TestTestWithScenarios(testtools.TestCase):
Reported by Pylint.
Line: 21
Column: 1
import testscenarios
import testtools
from testtools.tests.helpers import LoggingResult
class TestTestWithScenarios(testtools.TestCase):
scenarios = testscenarios.scenarios.per_module_scenarios(
Reported by Pylint.
Line: 1
Column: 1
# testscenarios: extensions to python unittest to allow declarative
# dependency injection ('scenarios') by tests.
#
# Copyright (c) 2009, Robert Collins <robertc@robertcollins.net>
#
# Licensed under either the Apache License, Version 2.0 or the BSD 3-clause
# license at the users choice. A copy of both licenses are available in the
# project source as Apache-2.0 and BSD. You may not use this file except in
# compliance with one of these two licences.
Reported by Pylint.
Line: 5
Column: 2
# dependency injection ('scenarios') by tests.
#
# Copyright (c) 2009, Robert Collins <robertc@robertcollins.net>
#
# Licensed under either the Apache License, Version 2.0 or the BSD 3-clause
# license at the users choice. A copy of both licenses are available in the
# project source as Apache-2.0 and BSD. You may not use this file except in
# compliance with one of these two licences.
#
Reported by Pylint.
Line: 10
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: 24
Column: 1
from testtools.tests.helpers import LoggingResult
class TestTestWithScenarios(testtools.TestCase):
scenarios = testscenarios.scenarios.per_module_scenarios(
'impl', (('unittest', 'unittest'), ('unittest2', 'unittest2')))
@property
Reported by Pylint.
Line: 30
Column: 5
'impl', (('unittest', 'unittest'), ('unittest2', 'unittest2')))
@property
def Implementation(self):
if isinstance(self.impl, tuple):
self.skipTest('import failed - module not installed?')
class Implementation(testscenarios.WithScenarios, self.impl.TestCase):
pass
return Implementation
Reported by Pylint.
Line: 30
Column: 5
'impl', (('unittest', 'unittest'), ('unittest2', 'unittest2')))
@property
def Implementation(self):
if isinstance(self.impl, tuple):
self.skipTest('import failed - module not installed?')
class Implementation(testscenarios.WithScenarios, self.impl.TestCase):
pass
return Implementation
Reported by Pylint.
Line: 33
Column: 9
def Implementation(self):
if isinstance(self.impl, tuple):
self.skipTest('import failed - module not installed?')
class Implementation(testscenarios.WithScenarios, self.impl.TestCase):
pass
return Implementation
def test_no_scenarios_no_error(self):
class ReferenceTest(self.Implementation):
Reported by Pylint.
Line: 37
Column: 5
pass
return Implementation
def test_no_scenarios_no_error(self):
class ReferenceTest(self.Implementation):
def test_pass(self):
pass
test = ReferenceTest("test_pass")
result = unittest.TestResult()
Reported by Pylint.
src/third_party/wiredtiger/test/suite/test_prepare10.py
43 issues
Line: 31
Column: 1
import fnmatch, os, shutil, time
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
# test_prepare10.py
# Test to ensure prepared tombstones are properly aborted even when they are written
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 fnmatch, os, shutil, time
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
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 fnmatch, os, shutil, time
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
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 fnmatch, os, shutil, time
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
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 fnmatch, os, shutil, time
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
Reported by Pylint.
Line: 30
Column: 1
# OTHER DEALINGS IN THE SOFTWARE.
import fnmatch, os, shutil, time
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
# test_prepare10.py
Reported by Pylint.
Line: 56
Column: 13
for i in range(1, nrows):
cursor.set_key(ds.key(i))
cursor.set_value(value)
self.assertEquals(cursor.insert(), 0)
self.session.commit_transaction('commit_timestamp=' + self.timestamp_str(ts))
cursor.close()
def removes(self, ds, uri, nrows, ts):
cursor = self.session.open_cursor(uri)
Reported by Pylint.
Line: 65
Column: 13
self.session.begin_transaction()
for i in range(1, nrows):
cursor.set_key(ds.key(i))
self.assertEquals(cursor.remove(), 0)
self.session.commit_transaction('commit_timestamp=' + self.timestamp_str(ts))
cursor.close()
def check(self, ds, uri, nrows, value, ts):
cursor = self.session.open_cursor(uri)
Reported by Pylint.
Line: 74
Column: 13
self.session.begin_transaction('ignore_prepare=true,read_timestamp=' + self.timestamp_str(ts))
for i in range(1, nrows):
cursor.set_key(ds.key(i))
self.assertEquals(cursor.search(), 0)
self.assertEquals(cursor.get_value(),value)
self.session.commit_transaction()
cursor.close()
def check_not_found(self, ds, uri, nrows, ts):
Reported by Pylint.
Line: 75
Column: 13
for i in range(1, nrows):
cursor.set_key(ds.key(i))
self.assertEquals(cursor.search(), 0)
self.assertEquals(cursor.get_value(),value)
self.session.commit_transaction()
cursor.close()
def check_not_found(self, ds, uri, nrows, ts):
cursor = self.session.open_cursor(uri)
Reported by Pylint.
src/third_party/wiredtiger/test/suite/test_hs21.py
43 issues
Line: 30
Column: 1
# OTHER DEALINGS IN THE SOFTWARE.
import time, re
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wiredtiger import stat
from wtscenario import make_scenarios
# test_hs21.py
Reported by Pylint.
Line: 32
Column: 1
import time, re
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wiredtiger import stat
from wtscenario import make_scenarios
# test_hs21.py
# Test we don't lose any data when idle files with an active history are closed/sweeped.
# Files with active history, ie content newer than the oldest timestamp can be closed when idle.
Reported by Pylint.
Line: 30
Column: 1
# OTHER DEALINGS IN THE SOFTWARE.
import time, re
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wiredtiger import stat
from wtscenario import make_scenarios
# test_hs21.py
Reported by Pylint.
Line: 73
Column: 13
session.begin_transaction('read_timestamp=' + self.timestamp_str(read_ts))
cursor = session.open_cursor(uri)
count = 0
for k, v in cursor:
self.assertEqual(v, check_value)
count += 1
if read_ts != -1:
session.rollback_transaction()
if count != nrows:
Reported by Pylint.
Line: 93
Column: 46
meta_cursor.close()
# The search string will look like: 'run_write_gen=<num>'.
# Just reverse the string and take the digits from the back until we hit '='.
write_gen = re.search('run_write_gen=\d+', config)
self.assertTrue(write_gen is not None)
write_gen_str = str()
for c in reversed(write_gen.group(0)):
if not c.isdigit():
self.assertEqual(c, '=')
Reported by Pylint.
Line: 154
Column: 9
# Our sweep scan interval is every 1 second and the amount of idle time needed for a handle to be closed is 2 seconds.
# It should take roughly 3 seconds for the sweep server to close our file handles. Lets wait at least double
# that to be safe.
max = 6
sleep = 0
# After waiting for the sweep server to remove our idle handles, the only open
# handles that should be the metadata file, history store file and lock file.
final_numfiles = 3
# Open the stats cursor to collect the dhandle sweep status.
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 time, re
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wiredtiger import stat
from wtscenario import make_scenarios
Reported by Pylint.
Line: 30
Column: 1
# OTHER DEALINGS IN THE SOFTWARE.
import time, re
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wiredtiger import stat
from wtscenario import make_scenarios
# test_hs21.py
Reported by Pylint.
Line: 32
Column: 1
import time, re
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wiredtiger import stat
from wtscenario import make_scenarios
# test_hs21.py
# Test we don't lose any data when idle files with an active history are closed/sweeped.
# Files with active history, ie content newer than the oldest timestamp can be closed when idle.
Reported by Pylint.