]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Minor fixes for coverity issues.
authorVictor Julien <victor@inliniac.net>
Tue, 3 Jul 2012 12:23:56 +0000 (14:23 +0200)
committerVictor Julien <victor@inliniac.net>
Tue, 3 Jul 2012 12:23:56 +0000 (14:23 +0200)
src/runmode-af-packet.c
src/runmode-pcap.c
src/util-magic.c
src/util-reference-config.c

index 871269fd8f4543786998e47b15bc9a564336dfaa..d599033c1a0f8d502c087c13967887fa1b54fb17 100644 (file)
@@ -223,13 +223,13 @@ void *ParseAFPConfig(const char *iface)
         aconf->buffer_size = 0;
     }
 
-    ConfGetChildValueBool(if_root, "disable-promisc", (int *)&boolval);
+    (void)ConfGetChildValueBool(if_root, "disable-promisc", (int *)&boolval);
     if (boolval) {
         SCLogInfo("Disabling promiscuous mode on iface %s",
                 aconf->iface);
         aconf->promisc = 0;
     }
-    ConfGetChildValueBool(if_root, "use-mmap", (int *)&boolval);
+    (void)ConfGetChildValueBool(if_root, "use-mmap", (int *)&boolval);
     if (boolval) {
         SCLogInfo("Enabling mmaped capture on iface %s",
                 aconf->iface);
@@ -290,7 +290,7 @@ int RunModeIdsAFPAuto(DetectEngineCtx *de_ctx)
 
     TimeModeSetLive();
 
-    ConfGet("af-packet.live-interface", &live_dev);
+    (void)ConfGet("af-packet.live-interface", &live_dev);
 
     ret = RunModeSetLiveCaptureAuto(de_ctx,
                                     ParseAFPConfig,
@@ -321,7 +321,7 @@ int RunModeIdsAFPAutoFp(DetectEngineCtx *de_ctx)
 
     TimeModeSetLive();
 
-    ConfGet("af-packet.live-interface", &live_dev);
+    (void)ConfGet("af-packet.live-interface", &live_dev);
 
     SCLogDebug("live_dev %s", live_dev);
 
@@ -358,7 +358,7 @@ int RunModeIdsAFPSingle(DetectEngineCtx *de_ctx)
     RunModeInitialize();
     TimeModeSetLive();
 
-    ConfGet("af-packet.live-interface", &live_dev);
+    (void)ConfGet("af-packet.live-interface", &live_dev);
 
     ret = RunModeSetLiveCaptureSingle(de_ctx,
                                     ParseAFPConfig,
@@ -395,7 +395,7 @@ int RunModeIdsAFPWorkers(DetectEngineCtx *de_ctx)
     RunModeInitialize();
     TimeModeSetLive();
 
-    ConfGet("af-packet.live-interface", &live_dev);
+    (void)ConfGet("af-packet.live-interface", &live_dev);
 
     ret = RunModeSetLiveCaptureWorkers(de_ctx,
                                     ParseAFPConfig,
index 29c8e74df6b817653896f0692d80409c69d02f2e..3281fdeee1fa4100d28df2daed37d53bd76b5829 100644 (file)
@@ -218,7 +218,7 @@ int RunModeIdsPcapSingle(DetectEngineCtx *de_ctx)
     RunModeInitialize();
     TimeModeSetLive();
 
-    ConfGet("pcap.single-pcap-dev", &live_dev);
+    (void)ConfGet("pcap.single-pcap-dev", &live_dev);
 
     ret = RunModeSetLiveCaptureSingle(de_ctx,
                                     ParsePcapConfig,
@@ -266,7 +266,7 @@ int RunModeIdsPcapAuto(DetectEngineCtx *de_ctx)
     RunModeInitialize();
     TimeModeSetLive();
 
-    ConfGet("pcap.single-pcap-dev", &live_dev);
+    (void) ConfGet("pcap.single-pcap-dev", &live_dev);
 
     ret = RunModeSetLiveCaptureAuto(de_ctx,
                                     ParsePcapConfig,
@@ -310,7 +310,7 @@ int RunModeIdsPcapAutoFp(DetectEngineCtx *de_ctx)
     RunModeInitialize();
     TimeModeSetLive();
 
-    ConfGet("pcap.single-pcap-dev", &live_dev);
+    (void) ConfGet("pcap.single-pcap-dev", &live_dev);
 
     ret = RunModeSetLiveCaptureAutoFp(de_ctx,
                               ParsePcapConfig,
@@ -343,7 +343,7 @@ int RunModeIdsPcapWorkers(DetectEngineCtx *de_ctx)
     RunModeInitialize();
     TimeModeSetLive();
 
-    ConfGet("pcap.single-pcap-dev", &live_dev);
+    (void) ConfGet("pcap.single-pcap-dev", &live_dev);
 
     ret = RunModeSetLiveCaptureWorkers(de_ctx,
                                     ParsePcapConfig,
index dfdaa5b59b0d531bccc78bb3c9b8f34c6c014d99..f018882166995ae4fdec8bc594aa70bfda2533d9 100644 (file)
@@ -57,7 +57,7 @@ int MagicInit(void) {
         goto error;
     }
 
-    ConfGet("magic-file", &filename);
+    (void)ConfGet("magic-file", &filename);
     if (filename != NULL) {
         SCLogInfo("using magic-file %s", filename);
 
index 94a8db8c994a033c2ffce7c492f8567eadd3888e..8212c3b522765200afd8d9d17a989a4d7a286271 100644 (file)
@@ -148,8 +148,10 @@ static int SCRConfInitContextAndLocalResources(DetectEngineCtx *de_ctx)
  */
 static char *SCRConfGetConfFilename(void)
 {
-    char *path = (char *)file_path;
-    ConfGet("reference-config-file", &path);
+    char *path = NULL;
+    if (ConfGet("reference-config-file", &path) != 1) {
+        return (char *)file_path;
+    }
     return path;
 }