diff --git a/arangod/Aql/ExecutionEngine.cpp b/arangod/Aql/ExecutionEngine.cpp index 52cb32926b..b7c10ebc9c 100644 --- a/arangod/Aql/ExecutionEngine.cpp +++ b/arangod/Aql/ExecutionEngine.cpp @@ -737,6 +737,10 @@ struct CoordinatorInstanciator : public WalkerWorker { else { THROW_ARANGO_EXCEPTION(TRI_ERROR_INTERNAL); } + + if (remoteNode == nullptr) { + THROW_ARANGO_EXCEPTION(TRI_ERROR_INTERNAL); + } auto&& shardIds = collection->shardIds(); diff --git a/arangod/GeoIndex/GeoIndex.cpp b/arangod/GeoIndex/GeoIndex.cpp index 68f591c2e0..ce59c60eaf 100644 --- a/arangod/GeoIndex/GeoIndex.cpp +++ b/arangod/GeoIndex/GeoIndex.cpp @@ -907,7 +907,7 @@ void GeoResultsInsertPoint(GeoResults * gr, int slot, double snmd) if(gr->snmd[jj1]>gr->snmd[jj2]) { temp=jj1; - jj1=jj2; + // jj1=jj2; jj2=temp; } /* so now jj2 is >= jj1 */ diff --git a/arangod/V8Server/ApplicationV8.cpp b/arangod/V8Server/ApplicationV8.cpp index d07f36e2f1..a193e94620 100644 --- a/arangod/V8Server/ApplicationV8.cpp +++ b/arangod/V8Server/ApplicationV8.cpp @@ -568,7 +568,7 @@ void ApplicationV8::collectGarbage () { // can be performed more early for all dirty contexts. The flag is set // to false again once all contexts have been cleaned up and there is nothing // more to do - bool useReducedWait = false; + volatile bool useReducedWait = false; // the time we'll wait for a signal uint64_t const regularWaitTime = (uint64_t) (_gcFrequency * 1000.0 * 1000.0); diff --git a/arangod/V8Server/V8Traverser.h b/arangod/V8Server/V8Traverser.h index ecf82aa034..b19e8779f2 100644 --- a/arangod/V8Server/V8Traverser.h +++ b/arangod/V8Server/V8Traverser.h @@ -48,7 +48,7 @@ struct VertexId { VertexId () : cid(0), - key(nullptr) { + key("") { } VertexId (TRI_voc_cid_t cid, char const* key) diff --git a/arangod/Wal/Slots.cpp b/arangod/Wal/Slots.cpp index e604bad747..8792a7ee71 100644 --- a/arangod/Wal/Slots.cpp +++ b/arangod/Wal/Slots.cpp @@ -158,7 +158,6 @@ SlotInfo Slots::nextUnused (uint32_t size) { CONDITION_LOCKER(guard, _condition); TRI_ASSERT(_waiting > 0); --_waiting; - hasWaited = false; } // cycle until we have a valid logfile @@ -286,7 +285,6 @@ SlotInfo Slots::nextUnused (uint32_t size, CONDITION_LOCKER(guard, _condition); TRI_ASSERT(_waiting > 0); --_waiting; - hasWaited = false; } // cycle until we have a valid logfile diff --git a/lib/Basics/AssocMulti.h b/lib/Basics/AssocMulti.h index 03948bcf5b..68488b12af 100644 --- a/lib/Basics/AssocMulti.h +++ b/lib/Basics/AssocMulti.h @@ -1125,6 +1125,7 @@ namespace triagens { IndexType oldAlloc = b._nrAlloc; b._nrAlloc = static_cast(TRI_NearPrime(static_cast(size))); + try { b._table = new EntryType[b._nrAlloc]; #ifdef __linux__ diff --git a/lib/Basics/AssocUnique.h b/lib/Basics/AssocUnique.h index 8a592616e4..acc2e74cb1 100644 --- a/lib/Basics/AssocUnique.h +++ b/lib/Basics/AssocUnique.h @@ -236,6 +236,8 @@ namespace triagens { // This might throw, is catched outside b._table = new Element* [targetSize]; + + b._nrAlloc = targetSize; #ifdef __linux__ if (b._nrAlloc > 1000000) { @@ -251,10 +253,9 @@ namespace triagens { b._table[i] = nullptr; } - b._nrAlloc = targetSize; - if (b._nrUsed > 0) { uint64_t const n = b._nrAlloc; + TRI_ASSERT(n > 0); for (uint64_t j = 0; j < oldAlloc; j++) { Element* element = oldTable[j]; diff --git a/lib/V8/v8-buffer.cpp b/lib/V8/v8-buffer.cpp index 5237537e0f..e5b5813494 100644 --- a/lib/V8/v8-buffer.cpp +++ b/lib/V8/v8-buffer.cpp @@ -1166,6 +1166,10 @@ static void JS_Copy (const v8::FunctionCallbackInfo& args) { TRI_V8_THROW_RANGE_ERROR("sourceEnd out of bounds"); } + if (target_data == nullptr || source == nullptr || source->_data == nullptr) { + TRI_V8_THROW_EXCEPTION_MESSAGE(TRI_ERROR_INTERNAL, "invalid pointer value"); + } + size_t to_copy = MIN(MIN(source_end - source_start, target_length - target_start), source->_length - source_start);