]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: bump filter CLI XPath buffers size
authorRafael Zalamena <rzalamena@opensourcerouting.org>
Thu, 30 Apr 2020 21:21:12 +0000 (18:21 -0300)
committerRafael Zalamena <rzalamena@opensourcerouting.org>
Fri, 5 Jun 2020 17:36:53 +0000 (14:36 -0300)
Bump the size of the buffers so the new compilers don't complain about
possible truncation:
```
lib/filter_cli.c: In function ‘ipv6_prefix_list_magic.isra.0’:
lib/filter_cli.c:1336:5: error: ‘%lld’ directive output may be truncated writing between 1 and 20 bytes into a region of size between 16 and 527 [-Werror=format-truncation=]
 1336 |     "%s/entry[sequence='%" PRId64 "']", xpath, sseq);
      |     ^~~~~~~~~~~~~~~~~~~~~~
lib/filter_cli.c:1336:25: note: format string is defined here
 1336 |     "%s/entry[sequence='%" PRId64 "']", xpath, sseq);
lib/filter_cli.c:1336:5: note: directive argument in the range [-92233720368547758039223372036854775807]
 1336 |     "%s/entry[sequence='%" PRId64 "']", xpath, sseq);
      |     ^~~~~~~~~~~~~~~~~~~~~~
```

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
lib/filter_cli.c

index fd68bb59ec289666d1846f64847faf877581ab5f..860c155afe5bafecf6fff1e53e52614b465ab24b 100644 (file)
@@ -186,8 +186,8 @@ DEFPY(
        int64_t sseq;
        char ipmask[64];
        char xpath[XPATH_MAXLEN];
-       char xpath_entry[XPATH_MAXLEN + 32];
-       char xpath_value[XPATH_MAXLEN + 64];
+       char xpath_entry[XPATH_MAXLEN + 128];
+       char xpath_value[XPATH_MAXLEN + 256];
 
        /*
         * Create the access-list first, so we can generate sequence if
@@ -315,8 +315,8 @@ DEFPY(
        int64_t sseq;
        char ipmask[64];
        char xpath[XPATH_MAXLEN];
-       char xpath_entry[XPATH_MAXLEN + 32];
-       char xpath_value[XPATH_MAXLEN + 64];
+       char xpath_entry[XPATH_MAXLEN + 128];
+       char xpath_value[XPATH_MAXLEN + 256];
 
        /*
         * Create the access-list first, so we can generate sequence if
@@ -588,8 +588,8 @@ DEFPY(
        int rv;
        int64_t sseq;
        char xpath[XPATH_MAXLEN];
-       char xpath_entry[XPATH_MAXLEN + 32];
-       char xpath_value[XPATH_MAXLEN + 64];
+       char xpath_entry[XPATH_MAXLEN + 128];
+       char xpath_value[XPATH_MAXLEN + 256];
 
        /*
         * Create the access-list first, so we can generate sequence if
@@ -767,8 +767,8 @@ DEFPY(
        int rv;
        int64_t sseq;
        char xpath[XPATH_MAXLEN];
-       char xpath_entry[XPATH_MAXLEN + 32];
-       char xpath_value[XPATH_MAXLEN + 64];
+       char xpath_entry[XPATH_MAXLEN + 128];
+       char xpath_value[XPATH_MAXLEN + 256];
 
        /*
         * Create the access-list first, so we can generate sequence if
@@ -949,8 +949,8 @@ DEFPY(
        int rv;
        int64_t sseq;
        char xpath[XPATH_MAXLEN];
-       char xpath_entry[XPATH_MAXLEN + 32];
-       char xpath_value[XPATH_MAXLEN + 64];
+       char xpath_entry[XPATH_MAXLEN + 128];
+       char xpath_value[XPATH_MAXLEN + 256];
 
        /*
         * Create the access-list first, so we can generate sequence if
@@ -1258,8 +1258,8 @@ DEFPY(
        int rv;
        int64_t sseq;
        char xpath[XPATH_MAXLEN];
-       char xpath_entry[XPATH_MAXLEN + 32];
-       char xpath_value[XPATH_MAXLEN + 128];
+       char xpath_entry[XPATH_MAXLEN + 128];
+       char xpath_value[XPATH_MAXLEN + 256];
 
        /*
         * Create the prefix-list first, so we can generate sequence if
@@ -1438,8 +1438,8 @@ DEFPY(
        int rv;
        int64_t sseq;
        char xpath[XPATH_MAXLEN];
-       char xpath_entry[XPATH_MAXLEN + 32];
-       char xpath_value[XPATH_MAXLEN + 128];
+       char xpath_entry[XPATH_MAXLEN + 128];
+       char xpath_value[XPATH_MAXLEN + 256];
 
        /*
         * Create the prefix-list first, so we can generate sequence if