]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Coverity 1038106: fix FP out-of-bond access
authorEric Leblond <eric@regit.org>
Wed, 26 Jun 2013 07:56:11 +0000 (09:56 +0200)
committerVictor Julien <victor@inliniac.net>
Wed, 26 Jun 2013 08:18:29 +0000 (10:18 +0200)
A cast during the reading of a configuration variable was invalid
because a 16 bit integer was cast to a 32 bit integer. The called
function is only setting the pointer value to 1 or 0 so there is
no real issue there.

src/runmode-af-packet.c

index bfaf832c1c84c771510f5506b21864f2e8c7e01c..1c9d2ad3da1f836e2d33f166fecc0a7d8dfd21a0 100644 (file)
@@ -252,10 +252,11 @@ void *ParseAFPConfig(const char *iface)
         /* In hash mode, we also ask for defragmentation needed to
          * compute the hash */
         uint16_t defrag = 0;
+        int conf_val = 0;
         SCLogInfo("Using flow cluster mode for AF_PACKET (iface %s)",
                 aconf->iface);
-        ConfGetChildValueBoolWithDefault(if_root, if_default, "defrag", (int *)&defrag);
-        if (defrag) {
+        ConfGetChildValueBoolWithDefault(if_root, if_default, "defrag", &conf_val);
+        if (conf_val) {
             SCLogInfo("Using defrag kernel functionality for AF_PACKET (iface %s)",
                     aconf->iface);
             defrag = PACKET_FANOUT_FLAG_DEFRAG;