Merge pull request #284 from DeforaNetworks/khorben/strlcat

This commit is contained in:
Michael Rash 2018-08-07 06:28:12 -04:00 committed by GitHub
commit c4f437f1dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -698,8 +698,7 @@ 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,
strlen(access_buf) + (ndx - options->access_str) + 2);
strlcat(access_buf, options->access_str, MAX_LINE_LEN);
if (strchr(ndx+1, '/') != NULL)
{
@ -711,8 +710,7 @@ 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,
strlen(access_buf)+MAX_PORT_STR_LEN+1);
strlcat(access_buf, tmp_nat_port, MAX_LINE_LEN);
}
else
{