Werk #8573: Handle large regular expressions more gracefully

TitleHandle large regular expressions more gracefully
Date2016-10-14 10:05:53
Checkmk EditionCheckmk Enterprise Edition (CEE)
Checkmk Version1.4.0i2
LevelTrivial Change
ClassBug Fix
CompatibilityCompatible - no manual interaction needed

Livestatus queries with large regular expressions in their filters could lead to a stack overflow and consequently to a termination of the micro core. To handle this in a more robust way, we set a limit on the size and complexity of a regular expression, and bump the stack sizes of the Livestatus threads from 64kB to 256kB. The net result is that we can correctly handle regular expression patters of up to roughly 2k characters, the exact value depends on the regex features used. For larger expressions we return a failure status in a clean way.