The nwfilterDriverActive() could de-reference a NULL pointer
if it hadn't be started at the point it was called. It was
also not thread safe, since it lacked locking around data
accesses.
* src/nwfilter/nwfilter_driver.c: Fix locking & NULL checks
in nwfilterDriverActive()
*/
static int
nwfilterDriverActive(void) {
- if (!driverState->pools.count)
+ int ret;
+
+ if (!driverState)
return 0;
- return 1;
+
+ nwfilterDriverLock(driverState);
+ ret = driverState->pools.count ? 1 : 0;
+ nwfilterDriverUnlock(driverState);
+
+ return ret;
}
/**