aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2020-01-30 04:25:11 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2020-01-30 04:25:11 +0000
commit55b98937a2de723b7a0e5f9be0c2e6ab15acb204 (patch)
tree5ad69daca15388c75bcc409e46bd0805395e529b
parent0e031c9e04becd022b993486feff9f4945264834 (diff)
parent14b799ecf5bbec3b947bb04938f6de65f01ad437 (diff)
downloadplatform_external_iptables-android-r-preview-3.tar.gz
platform_external_iptables-android-r-preview-3.tar.bz2
platform_external_iptables-android-r-preview-3.zip
Snap for 6170127 from 14b799ecf5bbec3b947bb04938f6de65f01ad437 to rvc-releaseandroid-r-preview-4android-r-preview-3android-r-preview-2
Change-Id: If04b5bed635f24913259f6f79533d1b45e78c04f
-rw-r--r--extensions/libxt_comment.c7
-rw-r--r--extensions/libxt_hashlimit.c1
-rw-r--r--iptables/nft-ipv4.c2
-rw-r--r--iptables/nft-ipv6.c2
4 files changed, 6 insertions, 6 deletions
diff --git a/extensions/libxt_comment.c b/extensions/libxt_comment.c
index b635d16c..69795b6c 100644
--- a/extensions/libxt_comment.c
+++ b/extensions/libxt_comment.c
@@ -52,17 +52,16 @@ static int comment_xlate(struct xt_xlate *xl,
const struct xt_xlate_mt_params *params)
{
struct xt_comment_info *commentinfo = (void *)params->match->data;
- char comment[XT_MAX_COMMENT_LEN];
+ char comment[XT_MAX_COMMENT_LEN + sizeof("\\\"\\\"")];
commentinfo->comment[XT_MAX_COMMENT_LEN - 1] = '\0';
if (params->escape_quotes)
- snprintf(comment, XT_MAX_COMMENT_LEN, "\\\"%s\\\"",
+ snprintf(comment, sizeof(comment), "\\\"%s\\\"",
commentinfo->comment);
else
- snprintf(comment, XT_MAX_COMMENT_LEN, "\"%s\"",
+ snprintf(comment, sizeof(comment), "\"%s\"",
commentinfo->comment);
- comment[XT_MAX_COMMENT_LEN - 1] = '\0';
xt_xlate_add_comment(xl, comment);
return 1;
diff --git a/extensions/libxt_hashlimit.c b/extensions/libxt_hashlimit.c
index 70bc615b..7d78d852 100644
--- a/extensions/libxt_hashlimit.c
+++ b/extensions/libxt_hashlimit.c
@@ -205,6 +205,7 @@ static const struct xt_option_entry hashlimit_mt_opts_v2[] = {
{.name = "hashlimit-mode", .id = O_MODE, .type = XTTYPE_STRING},
{.name = "hashlimit-name", .id = O_NAME, .type = XTTYPE_STRING,
.flags = XTOPT_MAND | XTOPT_PUT, XTOPT_POINTER(s, name), .min = 1},
+ XTOPT_TABLEEND,
};
#undef s
diff --git a/iptables/nft-ipv4.c b/iptables/nft-ipv4.c
index 00dd3e93..b779aef5 100644
--- a/iptables/nft-ipv4.c
+++ b/iptables/nft-ipv4.c
@@ -459,7 +459,7 @@ static int nft_ipv4_xlate(const void *data, struct xt_xlate *xl)
if (cs->fw.ip.proto != 0) {
const struct protoent *pent =
getprotobynumber(cs->fw.ip.proto);
- char protonum[strlen("255") + 1];
+ char protonum[sizeof("65535")];
if (!xlate_find_match(cs, pent->p_name)) {
snprintf(protonum, sizeof(protonum), "%u",
diff --git a/iptables/nft-ipv6.c b/iptables/nft-ipv6.c
index 9867d1ee..1be49dd3 100644
--- a/iptables/nft-ipv6.c
+++ b/iptables/nft-ipv6.c
@@ -416,7 +416,7 @@ static int nft_ipv6_xlate(const void *data, struct xt_xlate *xl)
if (cs->fw6.ipv6.proto != 0) {
const struct protoent *pent =
getprotobynumber(cs->fw6.ipv6.proto);
- char protonum[strlen("255") + 1];
+ char protonum[sizeof("65535")];
if (!xlate_find_match(cs, pent->p_name)) {
snprintf(protonum, sizeof(protonum), "%u",