MCPcopy Create free account
hub / github.com/HexHive/NASS / LooseMemeq

Function LooseMemeq

fuzz/libfuzzer/FuzzerLoop.cpp:594–601  ·  view source on GitHub ↗

Compare two arrays, but not all bytes if the arrays are large.

Source from the content-addressed store, hash-verified

592
593// Compare two arrays, but not all bytes if the arrays are large.
594static bool LooseMemeq(const uint8_t *A, const uint8_t *B, size_t Size) {
595 const size_t Limit = 64;
596 if (Size <= 64)
597 return !memcmp(A, B, Size);
598 // Compare first and last Limit/2 bytes.
599 return !memcmp(A, B, Limit / 2) &&
600 !memcmp(A + Size - Limit / 2, B + Size - Limit / 2, Limit / 2);
601}
602
603// This method is not inlined because it would cause a test to fail where it
604// is part of the stack unwinding. See D97975 for details.

Callers 1

ExecuteCallbackMethod · 0.85

Calls 1

memcmpFunction · 0.85

Tested by

no test coverage detected