** CID
1362789: Null pointer dereferences (FORWARD_NULL)
/src/runmode-netmap.c: 247 in ParseNetmapConfig()
________________________________________________________________________________________________________
*** CID
1362789: Null pointer dereferences (FORWARD_NULL)
/src/runmode-netmap.c: 247 in ParseNetmapConfig()
241 strlcpy(aconf->iface_name, iface_name, sizeof(aconf->iface_name));
242 SC_ATOMIC_INIT(aconf->ref);
243 (void) SC_ATOMIC_ADD(aconf->ref, 1);
244
245 /* Find initial node */
246 netmap_node = ConfGetNode("netmap");
>>> CID
1362789: Null pointer dereferences (FORWARD_NULL)
>>> Comparing "netmap_node" to null implies that "netmap_node" might be null.
247 if (netmap_node == NULL) {
248 SCLogInfo("Unable to find netmap config using default value");
249 } else {
250 if_root = ConfFindDeviceConfig(netmap_node, aconf->iface_name);
251 if_default = ConfFindDeviceConfig(netmap_node, "default");
252 }
ParseNetmapSettings(&aconf->in, aconf->iface_name, if_root, if_default);
/* if we have a copy iface, parse that as well */
- if (ConfGetChildValueWithDefault(if_root, if_default, "copy-iface", &out_iface) == 1) {
- if (strlen(out_iface) > 0) {
- if_root = ConfFindDeviceConfig(netmap_node, out_iface);
- ParseNetmapSettings(&aconf->out, out_iface, if_root, if_default);
+ if (netmap_node != NULL) {
+ if (ConfGetChildValueWithDefault(if_root, if_default, "copy-iface", &out_iface) == 1) {
+ if (strlen(out_iface) > 0) {
+ if_root = ConfFindDeviceConfig(netmap_node, out_iface);
+ ParseNetmapSettings(&aconf->out, out_iface, if_root, if_default);
+ }
}
}