From 0362eddd18de722470244ea406a33d29d92cb3e4 Mon Sep 17 00:00:00 2001 From: maxbachmann Date: Tue, 31 Aug 2021 23:04:01 +0200 Subject: [PATCH] Fix out of bounds access in levenshtein_editops --- src/rapidfuzz-cpp | 2 +- tests/test_string_metric.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rapidfuzz-cpp b/src/rapidfuzz-cpp index 47df6f7..f26ee0e 160000 --- a/src/rapidfuzz-cpp +++ b/src/rapidfuzz-cpp @@ -1 +1 @@ -Subproject commit 47df6f75a1e8c01554440017259a64f75a93a375 +Subproject commit f26ee0e935d28fe86b4fdadb357a0e642b281299 diff --git a/tests/test_string_metric.py b/tests/test_string_metric.py index 81d8f55..9753a3a 100644 --- a/tests/test_string_metric.py +++ b/tests/test_string_metric.py @@ -55,6 +55,8 @@ def test_levenshtein_editops(): """ basic test for levenshtein_editops """ + assert string_metric.levenshtein_editops("0", "") == [("delete", 1, 0)] + assert string_metric.levenshtein_editops("", "0") == [("insert", 0, 1)] assert string_metric.levenshtein_editops("qabxcd", "abycdf") == [ ("delete", 1, 0), ("replace", 4, 3), ("insert", 6, 6) ]