Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix levensthein segmentation fault in invalid name picking #1021

Merged
merged 1 commit into from
Feb 27, 2023

Conversation

simonwoerpel
Copy link
Contributor

when the pick function for registry.name receives only "non-name" values, like "-", "(" (which can happen in dirty real world data), the normalized values list is empty which creates (at least on linux, python 3.11) a segmentation fault:

Python 3.11.2 (main, Feb 12 2023, 00:48:52) [GCC 12.2.0]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.10.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from Levenshtein import setmedian

In [2]: setmedian([])
[1]    307409 segmentation fault  ipython

In this fix we would return None for this case (as seen for other cases in the same function.)

@pudo pudo merged commit 58ba901 into alephdata:main Feb 27, 2023
@simonwoerpel simonwoerpel deleted the fix/levensthein-segfault branch June 8, 2023 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants