]> git.ipfire.org Git - thirdparty/suricata.git/commit
conf: multiple NULL-pointer dereferences in StreamTcpInitConfig 3078/head
authorWolfgang Hotwagner <code@feedyourhead.at>
Mon, 11 Dec 2017 20:20:00 +0000 (20:20 +0000)
committerVictor Julien <victor@inliniac.net>
Tue, 12 Dec 2017 15:14:18 +0000 (16:14 +0100)
commit08971f1841c0204cca3ca94f905f74a7cba969d6
treeb2b6a673273321cb25b964568d778fe095f3a0bc
parent7236e65d64ee32de5a19cbff632dc4765c3e4b7a
conf: multiple NULL-pointer dereferences in StreamTcpInitConfig

There are several NULL-pointer derefs in StreamTCPInitConfig. All of them happen because ConfGet returns 1 even if the value is NULL(due to misconfiguration for example).
This commit introduces a new function "ConfGetValue". It adds return values for NULL-pointer to ConfGet and could be used as a replacement for ConfGet.

Note: Simply modify ConfGet might not be a good idea, because there are some places where ConfGet should return 1 even if "value" is NULL. For example if ConfGet should get a Config-Leave in the yaml-hierarchy.

Bug: 2354
src/conf.c
src/conf.h
src/stream-tcp.c