Skip to content
Snippets Groups Projects
Commit 70fbcb6e authored by Guido Günther's avatar Guido Günther
Browse files

New patch 0007-nwfilter-Don-t-crash-if-driverState-NULL.patch

nwfilter: Don't crash if driverState == NULL

Closes: #577728
parent 9201ff6a
No related branches found
No related tags found
No related merge requests found
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org>
Date: Mon, 19 Apr 2010 18:06:05 +0200
Subject: [PATCH] nwfilter: Don't crash if driverState == NULL
Origin: Upstream
Closes: #577728
---
src/nwfilter/nwfilter_driver.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c
index f237b7c..9fbfaa7 100644
--- a/src/nwfilter/nwfilter_driver.c
+++ b/src/nwfilter/nwfilter_driver.c
@@ -161,9 +161,16 @@ nwfilterDriverReload(void) {
*/
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;
}
/**
--
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment