From d59c77a20b1e8df40cf0d1d4ff267b85b2dd2afe Mon Sep 17 00:00:00 2001 From: Michael Rash Date: Tue, 7 Aug 2018 23:35:34 -0700 Subject: [PATCH] Revert "Fix two erroneous calls to strlcat()" This reverts commit c412166aaabe96d41466abb3e4b0099a837c4017. --- client/fwknop.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/fwknop.c b/client/fwknop.c index 17be334c..020c627f 100644 --- a/client/fwknop.c +++ b/client/fwknop.c @@ -698,7 +698,8 @@ set_access_buf(fko_ctx_t ctx, fko_cli_options_t *options, char *access_buf) /* This adds in the protocol + '/' char */ - strlcat(access_buf, options->access_str, MAX_LINE_LEN); + strlcat(access_buf, options->access_str, + strlen(access_buf) + (ndx - options->access_str) + 2); if (strchr(ndx+1, '/') != NULL) { @@ -710,7 +711,8 @@ set_access_buf(fko_ctx_t ctx, fko_cli_options_t *options, char *access_buf) /* Now add the NAT port */ snprintf(tmp_nat_port, MAX_PORT_STR_LEN+1, "%d", nat_port); - strlcat(access_buf, tmp_nat_port, MAX_LINE_LEN); + strlcat(access_buf, tmp_nat_port, + strlen(access_buf)+MAX_PORT_STR_LEN+1); } else {