fujimotos / polyleven

Fast Levenshtein Distance Library for Python 3
https://ceptord.net
MIT License
80 stars 10 forks source link

fix out of bound accesses #1

Closed maxbachmann closed 3 years ago

maxbachmann commented 3 years ago

Right now strings like

s= (chr(127)+chr(255))*33
polyleven.levenshtein(s,s);

cause out of bound access to the underlying array of the hashmap.

This PR adds a manual overflow at 128 to resolve this.

fujimotos commented 3 years ago

Right now strings like

s= (chr(127)+chr(255))*33
polyleven.levenshtein(s,s);

cause out of bound access to the underlying array of the hashmap.

@maxbachmann Ah, this indeed is my bug. Thank you for the report.

I fixed that bug in a70a9d8, with a slightly different patch than your proposal (with some acknowledgement to you in the commit msg).

The fixed version is just released as 0.6. Thank you!