The following issues were found
src/third_party/icu4c-57.1/source/common/ucnvhz.c
2 issues
Line: 156
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 void
UConverter_toUnicode_HZ_OFFSETS_LOGIC(UConverterToUnicodeArgs *args,
UErrorCode* err){
char tempBuf[2];
const char *mySource = ( char *) args->source;
UChar *myTarget = args->target;
const char *mySourceLimit = args->sourceLimit;
UChar32 targetUniChar = 0x0000;
int32_t mySourceChar = 0x0000;
Reported by FlawFinder.
Line: 502
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
UConverter *cnv = args->converter;
UConverterDataHZ *convData=(UConverterDataHZ *) cnv->extraInfo;
char *p;
char buffer[4];
p = buffer;
if( convData->isTargetUCharDBCS){
*p++= UCNV_TILDE;
*p++= UCNV_CLOSE_BRACE;
Reported by FlawFinder.
src/third_party/icu4c-57.1/source/common/ucnvmbcs.cpp
2 issues
Line: 1134
Column: 17
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(range[0]<=(uint32_t)cp && (uint32_t)cp<=range[1]) {
/* found the Unicode code point, output the four-byte sequence for it */
uint32_t linear;
char bytes[4];
/* get the linear value of the first GB 18030 code in this range */
linear=range[2]-LINEAR_18030_BASE;
/* add the offset from the beginning of the range */
Reported by FlawFinder.
Line: 5662
Column: 5
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
UErrorCode *pErrorCode) {
UConverter *cnv=pArgs->converter;
char *p, *subchar;
char buffer[4];
int32_t length;
/* first, select between subChar and subChar1 */
if( cnv->subChar1!=0 &&
(cnv->sharedData->mbcs.extIndexes!=NULL ?
Reported by FlawFinder.
src/third_party/mozjs-60/extract/js/src/jit/Disassembler.h
2 issues
Line: 258
Column: 67
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
#endif
};
MOZ_COLD uint8_t* DisassembleHeapAccess(uint8_t* ptr, HeapAccess* access);
#ifdef DEBUG
void DumpHeapAccess(const HeapAccess& access);
inline void
Reported by FlawFinder.
Line: 261
Column: 39
CWE codes:
362/367!
Suggestion:
Set up the correct permissions (e.g., using setuid()) and try to open the file directly
MOZ_COLD uint8_t* DisassembleHeapAccess(uint8_t* ptr, HeapAccess* access);
#ifdef DEBUG
void DumpHeapAccess(const HeapAccess& access);
inline void
VerifyHeapAccess(uint8_t* begin, uint8_t* end, const HeapAccess& expected)
{
HeapAccess disassembled;
Reported by FlawFinder.
src/third_party/boost/boost/move/unique_ptr.hpp
2 issues
Line: 60
Column: 20
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
class is_noncopyable
{
typedef char true_t;
class false_t { char dummy[2]; };
template<class U> static false_t dispatch(...);
template<class U> static true_t dispatch(typename U::boost_move_no_copy_constructor_or_assign*);
public:
static const bool value = sizeof(dispatch<T>(0)) == sizeof(true_t);
};
Reported by FlawFinder.
Line: 266
Column: 20
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
#endif
typedef char true_t;
class false_t { char dummy[2]; };
static false_t dispatch(...);
static true_t dispatch(U);
static t_from trigger();
public:
static const bool value = sizeof(dispatch(trigger())) == sizeof(true_t);
Reported by FlawFinder.
src/third_party/icu4c-57.1/source/common/ucnvsel.cpp
2 issues
Line: 550
Column: 6
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
// create and populate the selector object
UConverterSelector* sel = (UConverterSelector*)uprv_malloc(sizeof(UConverterSelector));
char **encodings =
(char **)uprv_malloc(
indexes[UCNVSEL_INDEX_NAMES_COUNT] * sizeof(char *));
if (sel == NULL || encodings == NULL) {
uprv_free(swapped);
uprv_free(sel);
uprv_free(encodings);
Reported by FlawFinder.
Line: 712
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
*status = U_MEMORY_ALLOCATION_ERROR;
return NULL;
}
memcpy(en, &defaultEncodings, sizeof(UEnumeration));
en->context = result;
int32_t columns = (sel->encodingsCount+31)/32;
int16_t numOnes = countOnes(mask, columns);
// now, we know the exact space we need for index
Reported by FlawFinder.
src/third_party/mozjs-60/extract/js/src/jit/IonCode.h
2 issues
Line: 678
Column: 13
CWE codes:
120
Suggestion:
Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused)
void setCode(const char* code) {
char* ncode = js_pod_malloc<char>(strlen(code) + 1);
if (ncode) {
strcpy(ncode, code);
code_ = ncode;
}
}
const char* code() const {
Reported by FlawFinder.
Line: 676
Column: 43
CWE codes:
126
}
void setCode(const char* code) {
char* ncode = js_pod_malloc<char>(strlen(code) + 1);
if (ncode) {
strcpy(ncode, code);
code_ = ncode;
}
}
Reported by FlawFinder.
src/third_party/mozjs-60/extract/js/src/jit/JitFrames.cpp
2 issues
Line: 132
Column: 38
CWE codes:
120
20
RootedObject iterObject(cx, &v.toObject());
if (isDestructuring) {
RootedValue doneValue(cx, si.read());
bool done = ToBoolean(doneValue);
// Do not call IteratorClose if the destructuring iterator is already
// done.
if (done)
return;
Reported by FlawFinder.
Line: 845
Column: 37
CWE codes:
120
20
{
if (a->isGeneralReg()) {
Register reg = a->toGeneralReg()->reg();
return frame.machineState().read(reg);
}
return *frame.jsFrame()->slotRef(SafepointSlotEntry(a));
}
#endif
Reported by FlawFinder.
src/third_party/boost/boost/move/detail/unique_ptr_meta_utils.hpp
2 issues
Line: 382
Column: 17
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
template <class T>
struct has_pointer_type
{
struct two { char c[2]; };
template <class U> static two test(...);
template <class U> static char test(typename U::pointer* = 0);
static const bool value = sizeof(test<T>(0)) == 1;
};
Reported by FlawFinder.
Line: 430
Column: 20
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
{
typedef typename add_lvalue_reference<T>::type t_reference;
typedef char true_t;
class false_t { char dummy[2]; };
static false_t dispatch(...);
static true_t dispatch(U);
static t_reference trigger();
public:
static const bool value = sizeof(dispatch(trigger())) == sizeof(true_t);
Reported by FlawFinder.
src/third_party/boost/boost/random/exponential_distribution.hpp
2 issues
Line: 31
Column: 11
CWE codes:
327
Suggestion:
Use a more secure technique for acquiring random values
#include <boost/random/uniform_01.hpp>
namespace boost {
namespace random {
namespace detail {
// tables for the ziggurat algorithm
template<class RealType>
Reported by FlawFinder.
Line: 382
Column: 7
CWE codes:
327
Suggestion:
Use a more secure technique for acquiring random values
} // namespace random
using random::exponential_distribution;
} // namespace boost
#endif // BOOST_RANDOM_EXPONENTIAL_DISTRIBUTION_HPP
Reported by FlawFinder.
src/third_party/mozjs-60/extract/js/src/jit/MCallOptimize.cpp
2 issues
Line: 2430
CWE codes:
908
pushConstant(BooleanValue(false));
} else {
bool emitted = false;
if (strictEq) {
// Specialize |Object.is(lhs, rhs)| as |lhs === rhs|.
MOZ_TRY(compareTrySpecialized(&emitted, JSOP_STRICTEQ, left, right, false));
}
if (!emitted) {
Reported by Cppcheck.
Line: 3791
Column: 66
CWE codes:
126
Suggestion:
This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it
case SimdOperation::Fn_lessThanOrEqual:
return inlineSimdComp(callInfo, native, MSimdBinaryComp::lessThanOrEqual, type);
case SimdOperation::Fn_equal:
return inlineSimdComp(callInfo, native, MSimdBinaryComp::equal, type);
case SimdOperation::Fn_notEqual:
return inlineSimdComp(callInfo, native, MSimdBinaryComp::notEqual, type);
case SimdOperation::Fn_greaterThan:
return inlineSimdComp(callInfo, native, MSimdBinaryComp::greaterThan, type);
case SimdOperation::Fn_greaterThanOrEqual:
Reported by FlawFinder.