]> git.ipfire.org Git - thirdparty/ulogd2.git/commit
filter: PWSNIFF: replace malloc+strncpy with strndup
authorJeremy Sowden <jeremy@azazel.net>
Tue, 30 Nov 2021 10:55:35 +0000 (10:55 +0000)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 30 Nov 2021 19:55:17 +0000 (20:55 +0100)
commitae3d0f59e2d1962d2a8f97dfb3e05b32ca11ea82
tree718068595e681e0aced7fb6182ea8b054e4e600c
parent721aa6f74f17f56dd82873aefffb2d6683918b79
filter: PWSNIFF: replace malloc+strncpy with strndup

There are a couple of instances of allocating memory with `malloc`,
followed by copying a string to it with `strncpy` and adding an explicit
assignment of `\0` to terminate the string.  Replace them with
`strndup`.

Add an enum to name indices of output keys.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
filter/ulogd_filter_PWSNIFF.c