Skip to content

Commit

Permalink
Merged PR 3897: BUG: Incorrect pointer was passed to remove the pseud…
Browse files Browse the repository at this point in the history
…o-evidence, and zero size was always allocated for the pseudo-evidence values.
  • Loading branch information
ben51degrees committed May 10, 2021
1 parent d4e21cb commit 214a766
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hash/hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -2284,7 +2284,7 @@ void fiftyoneDegreesResultsHashFromEvidence(
dataSet->b.b.uniqueHeaders->pseudoHeadersCount > 0) {
// Reset pseudo evidence
PseudoHeadersRemoveEvidence(
evidence->pseudoEvidence,
evidence,
dataSet->config.b.maxMatchedUserAgentLength);
evidence->pseudoEvidence = NULL;
}
Expand Down Expand Up @@ -2391,7 +2391,7 @@ createPseudoEvidenceKeyValueArray(
size_t maxUaLength = dataSet->config.b.maxMatchedUserAgentLength;
void* evidenceMem =
(void*)Malloc(
pseudoEvidence->count * maxUaLength);
pseudoEvidence->capacity * maxUaLength);
if (evidenceMem != NULL) {
for (uint32_t i = 0; i < pseudoEvidence->capacity; i++) {
pseudoEvidence->items[i].field = NULL;
Expand Down

0 comments on commit 214a766

Please sign in to comment.