(Franck Joncourt) patch to address sprintf() warnings for issue #60
This commit is contained in:
parent
5804e15859
commit
3c3283992c
@ -249,7 +249,7 @@ parse_url(char *res_url, struct url* url)
|
|||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(url->port, "%u", port);
|
snprintf(url->port, sizeof(url->port)-1, "%u", port);
|
||||||
|
|
||||||
/* Get the offset we need to skip the port portion when we
|
/* Get the offset we need to skip the port portion when we
|
||||||
* extract the hostname part.
|
* extract the hostname part.
|
||||||
@ -308,6 +308,8 @@ resolve_ip_http(fko_cli_options_t *options)
|
|||||||
int res;
|
int res;
|
||||||
struct url url;
|
struct url url;
|
||||||
|
|
||||||
|
memset(&url, 0, sizeof(url));
|
||||||
|
|
||||||
if(options->resolve_url != NULL)
|
if(options->resolve_url != NULL)
|
||||||
{
|
{
|
||||||
if(parse_url(options->resolve_url, &url) < 0)
|
if(parse_url(options->resolve_url, &url) < 0)
|
||||||
|
|||||||
@ -185,7 +185,7 @@ jump_rule_exists(const int chain_num)
|
|||||||
char line_buf[CMD_BUFSIZE] = {0};
|
char line_buf[CMD_BUFSIZE] = {0};
|
||||||
FILE *ipt;
|
FILE *ipt;
|
||||||
|
|
||||||
sprintf(cmd_buf, "%s " IPT_LIST_RULES_ARGS,
|
snprintf(cmd_buf, CMD_BUFSIZE-1, "%s " IPT_LIST_RULES_ARGS,
|
||||||
fwc.fw_command,
|
fwc.fw_command,
|
||||||
fwc.chain[chain_num].table,
|
fwc.chain[chain_num].table,
|
||||||
fwc.chain[chain_num].from_chain
|
fwc.chain[chain_num].from_chain
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user