The following issues were found
src/third_party/mozjs-60/extract/js/src/gc/Heap.h
1 issues
Line: 534
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
* Calculating sizes and offsets is simpler if sizeof(ChunkInfo) is
* architecture-independent.
*/
char padding[24];
#endif
/*
* Decommitted arenas are tracked by a bitmap in the chunk header. We use
* this offset to start our search iteration close to a decommitted arena
Reported by FlawFinder.
src/third_party/mozjs-60/extract/js/src/gc/Marking.cpp
1 issues
Line: 574
template void js::TraceNullableRoot<type>(JSTracer*, ReadBarriered<type>*, const char*); \
template void js::TraceRange<type>(JSTracer*, size_t, WriteBarrieredBase<type>*, const char*); \
template void js::TraceRootRange<type>(JSTracer*, size_t, type*, const char*);
FOR_EACH_GC_POINTER_TYPE(INSTANTIATE_ALL_VALID_TRACE_FUNCTIONS)
#undef INSTANTIATE_ALL_VALID_TRACE_FUNCTIONS
#define INSTANTIATE_PUBLIC_TRACE_FUNCTIONS(type) \
template JS_PUBLIC_API(void) JS::UnsafeTraceRoot<type>(JSTracer*, type*, const char*); \
template JS_PUBLIC_API(void) js::UnsafeTraceManuallyBarrieredEdge<type>(JSTracer*, type*, \
Reported by Cppcheck.
src/third_party/mozjs-60/extract/js/src/gc/NurseryAwareHashMap.h
1 issues
Line: 46
Column: 15
CWE codes:
120
20
const T get() const {
if (!InternalBarrierMethods<T>::isMarkable(this->value))
return JS::GCPolicy<T>::initial();
this->read();
return this->value;
}
explicit operator bool() const {
return bool(this->value);
Reported by FlawFinder.
src/third_party/mozjs-60/extract/js/src/gc/PublicIterators.cpp
1 issues
Line: 132
::IterateGrayObjects(zone, cellCallback, data);
}
JS_PUBLIC_API(void)
JS_IterateCompartments(JSContext* cx, void* data,
JSIterateCompartmentCallback compartmentCallback)
{
AutoTraceSession session(cx->runtime());
Reported by Cppcheck.
src/third_party/mozjs-60/extract/js/src/gc/RootMarking.cpp
1 issues
Line: 568
zone->gcGrayRoots().clearAndFree();
}
JS_PUBLIC_API(void)
JS::AddPersistentRoot(JS::RootingContext* cx, RootKind kind, PersistentRooted<void*>* root)
{
static_cast<JSContext*>(cx)->runtime()->heapRoots.ref()[kind].insertBack(root);
}
Reported by Cppcheck.
src/third_party/boost/boost/mpl/aux_/yes_no.hpp
1 issues
Line: 44
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
#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
typedef char (&type)[n];
#else
char buf[n];
typedef weighted_tag type;
#endif
};
#if defined(BOOST_MPL_CFG_NO_DEPENDENT_ARRAY_TYPES)
Reported by FlawFinder.
src/third_party/mozjs-60/extract/js/src/gc/WeakMapPtr.cpp
1 issues
Line: 125
// Supported specializations of JS::WeakMap:
//
template class JS_PUBLIC_API(JS::WeakMapPtr)<JSObject*, JSObject*>;
#ifdef DEBUG
// Nobody's using this at the moment, but we want to make sure it compiles.
template class JS_PUBLIC_API(JS::WeakMapPtr)<JSObject*, JS::Value>;
#endif
Reported by Cppcheck.
src/third_party/mozjs-60/extract/js/src/gc/Zone.cpp
1 issues
Line: 496
removeFront();
}
JS_PUBLIC_API(void)
JS::shadow::RegisterWeakCache(JS::Zone* zone, detail::WeakCacheBase* cachep)
{
zone->registerWeakCache(cachep);
}
Reported by Cppcheck.
src/third_party/mozjs-60/extract/js/src/irregexp/RegExpAST.cpp
1 issues
Line: 40
void* RegExp##Name::Accept(RegExpVisitor* visitor, void* data) { \
return visitor->Visit##Name(this, data); \
}
FOR_EACH_REG_EXP_TREE_TYPE(MAKE_ACCEPT)
#undef MAKE_ACCEPT
#define MAKE_TYPE_CASE(Name) \
RegExp##Name* RegExpTree::As##Name() { \
return nullptr; \
Reported by Cppcheck.
src/third_party/mozjs-60/extract/js/src/irregexp/RegExpInterpreter.cpp
1 issues
Line: 208
Column: 17
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
return RegExpRunStatus_Success_NotFound;
BYTECODE(SUCCEED)
if (matches)
memcpy(matches->pairsRaw(), registers.begin(), matches->length() * 2 * sizeof(int32_t));
else if (endIndex)
*endIndex = registers[1];
return RegExpRunStatus_Success;
BYTECODE(ADVANCE_CP)
current += insn >> BYTECODE_SHIFT;
Reported by FlawFinder.