zeek / pysubnettree

A Python Module for CIDR Lookups
Other
50 stars 20 forks source link

Segmentation fault checking "large string" in tree #14

Closed mutax closed 5 years ago

mutax commented 5 years ago

Hi,

using python 3.7.3rc1 on debian I can trigger a Segfault:

In [1]: import SubnetTree
In [2]: s=SubnetTree.SubnetTree()
In [3]: 'x' * 1000000  in s
   ...: 
Segmentation fault

Using python 2.7.16 however it works...

In [1]: import SubnetTree

In [2]: s=SubnetTree.SubnetTree()

In [3]: 'x' * 100000  in s
Out[3]: False

I have installed pysubnettree==0.28 for python 2 and 3.

ii  python-subnettree                         0.28-1                                  amd64        Python Module for CIDR Lookups
ii  python3-subnettree                        0.28-1                                  amd64        Python 3 Module for CIDR Lookups

UPDATE: sorry, seems to be fixed in 0.29 which is available via pip.

jsiwek commented 5 years ago

Thanks for the report, I was able to still reproduce it with that example. A fix is master and also I pushed a v0.30 to PyPI.