evilsocket / opensnitch

OpenSnitch is a GNU/Linux interactive application firewall inspired by Little Snitch.
GNU General Public License v3.0
10.92k stars 509 forks source link

regex compile error when adding a rule : daemon dies #292

Closed squalou closed 4 years ago

squalou commented 4 years ago

I just faced this issue when adding a block rule :+1:

panic: regexp: Compile(`.*\.vo\.msecnd\.net)`): error parsing regexp: unexpected ): `.*\.vo\.msecnd\.net)`

goroutine 73 [running]:
regexp.MustCompile(0xc001fce980, 0x14, 0xc00006dda0)
    /usr/lib/go/src/regexp/regexp.go:311 +0x154
opensnitch/daemon/vendor/github.com/gustavo-iniguez-goya/opensnitch/daemon/rule.(*Operator).Compile(0xc00006dda0)
    /home/myuser/go/src/opensnitch/daemon/vendor/github.com/gustavo-iniguez-goya/opensnitch/daemon/rule/operator.go:65 +0xf4

From a forked repo, sure, will post there too.

PRobably a try / catch around regex would be a quick dirty fix ? (I don't know how to make sure the entering string is sane, and in this case it was just a regular usage)

squalou commented 4 years ago

I've seen the extra parenthesis this time in the dropdown.... :)

squalou commented 4 years ago

Closing : issue dealt with on forked repo