src/daemon/utils_subst.c: Sanitize buffer offsets better.
authorFlorian Forster <octo@collectd.org>
Mon, 29 Jun 2015 15:32:44 +0000 (17:32 +0200)
committerFlorian Forster <octo@collectd.org>
Mon, 29 Jun 2015 15:32:44 +0000 (17:32 +0200)
commite1b93f596067106e7c29c263b8bb4d0b51718d9d
treedd1a53e7577a64d65508101997f02b5f59385a07
parentcf8bb3fbdadcdd4ed021377a01da8fb6459b7e7e
src/daemon/utils_subst.c: Sanitize buffer offsets better.

The previous implementation broke when off1 / off2 were outside of "string"
but within "buflen". It also had problems if the replacement string was
too long. This new implementation truncates the buffer as expected and
is properly tested.
src/daemon/Makefile.am
src/daemon/utils_subst.c
src/target_replace.c