From 40dca168ba231f1ada4c668ad4755f471ba3e6e9 Mon Sep 17 00:00:00 2001 From: Andrew Noyes Date: Thu, 22 Feb 2024 16:07:20 -0800 Subject: [PATCH] Add precondition to longestCommonPrefixPartialKey --- ConflictSet.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/ConflictSet.cpp b/ConflictSet.cpp index 0148a6e..fa98f1c 100644 --- a/ConflictSet.cpp +++ b/ConflictSet.cpp @@ -741,6 +741,7 @@ bytes: int longestCommonPrefixPartialKey(const uint8_t *ap, const uint8_t *bp, int cl) { + assert(cl <= Node::kPartialKeyMaxLen); int i = 0; for (; i < cl; ++i) { if (*ap++ != *bp++) {