Don't call errx() without a format string, to protect against possible
% characters in localized error messages from ipsec_strerror(). Obtained from: OpenBSD
This commit is contained in:
parent
d94e8c62d6
commit
0af87587a7
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=64277
@ -547,9 +547,9 @@ main(argc, argv)
|
|||||||
#ifdef IPSEC_POLICY_IPSEC
|
#ifdef IPSEC_POLICY_IPSEC
|
||||||
if (options & F_POLICY) {
|
if (options & F_POLICY) {
|
||||||
if (setpolicy(s, policy_in) < 0)
|
if (setpolicy(s, policy_in) < 0)
|
||||||
errx(1, ipsec_strerror());
|
errx(1, "%s", ipsec_strerror());
|
||||||
if (setpolicy(s, policy_out) < 0)
|
if (setpolicy(s, policy_out) < 0)
|
||||||
errx(1, ipsec_strerror());
|
errx(1, "%s", ipsec_strerror());
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (options & F_AUTHHDR) {
|
if (options & F_AUTHHDR) {
|
||||||
@ -727,7 +727,7 @@ main(argc, argv)
|
|||||||
struct addrinfo *iaip;
|
struct addrinfo *iaip;
|
||||||
|
|
||||||
if ((error = getaddrinfo(argv[hops], NULL, &hints, &iaip)))
|
if ((error = getaddrinfo(argv[hops], NULL, &hints, &iaip)))
|
||||||
errx(1, gai_strerror(error));
|
errx(1, "%s", gai_strerror(error));
|
||||||
if (SIN6(res->ai_addr)->sin6_family != AF_INET6)
|
if (SIN6(res->ai_addr)->sin6_family != AF_INET6)
|
||||||
errx(1,
|
errx(1,
|
||||||
"bad addr family of an intermediate addr");
|
"bad addr family of an intermediate addr");
|
||||||
@ -1901,7 +1901,7 @@ setpolicy(so, policy)
|
|||||||
|
|
||||||
buf = ipsec_set_policy(policy, strlen(policy));
|
buf = ipsec_set_policy(policy, strlen(policy));
|
||||||
if (buf == NULL)
|
if (buf == NULL)
|
||||||
errx(1, ipsec_strerror());
|
errx(1, "%s", ipsec_strerror());
|
||||||
if (setsockopt(s, IPPROTO_IPV6, IPV6_IPSEC_POLICY,
|
if (setsockopt(s, IPPROTO_IPV6, IPV6_IPSEC_POLICY,
|
||||||
buf, ipsec_get_policylen(buf)) < 0)
|
buf, ipsec_get_policylen(buf)) < 0)
|
||||||
warnx("Unable to set IPSec policy");
|
warnx("Unable to set IPSec policy");
|
||||||
|
Loading…
Reference in New Issue
Block a user