pynetwork / pypcap

pypcap - python libpcap module, forked from code.google.com/p/pypcap
Other
299 stars 75 forks source link

Segmentation fault if operating on a closed sniffer #90

Open dainok opened 5 years ago

dainok commented 5 years ago

Tested on:

Steps to reproduce:

import pcap
a = pcap.pcap()
a.close()
a.close()
Segmentation fault: 11

I think that pypcap should raise an exception, avoiding a segmentation fault.

hellais commented 5 years ago

Yes this seems like a bug. We should at least raise an exception and keep track of the opened state in python or ideally fix it in the underlying c code.