treewide: replace unsafe string functions
authorJo-Philipp Wich <jo@mein.io>
Wed, 27 May 2020 20:23:23 +0000 (22:23 +0200)
committerJo-Philipp Wich <jo@mein.io>
Wed, 3 Jun 2020 16:52:45 +0000 (18:52 +0200)
commitf62a52b105fdd3aa12cc073b2847140d5b64261f
tree56811195367b09b63f55508e9062b316d16a5ccb
parent23cc543f4f7ca636400707161e7e8355b6ecd856
treewide: replace unsafe string functions

Replace sprintf(), strncpy() etc. with safer variants that perform bounds
checking on the target buffer. Also rework unsafe `p += sprintf(p, ....)`
code to properly handle error cases.

Ref: http://lists.infradead.org/pipermail/openwrt-devel/2020-May/023363.html
Suggested-by: Philip Prindeville <philipp@redfish-solutions.com>
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
12 files changed:
defaults.c
includes.c
iptables.c
iptables.h
options.c
redirects.c
rules.c
snats.c
utils.c
xtables-10.h
xtables-5.h
zones.c