]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: Make coverity SA happy with zebra_routemap.c 4337/head
authorDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 11 May 2019 17:18:29 +0000 (13:18 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 11 May 2019 17:20:23 +0000 (13:20 -0400)
The CLI code ensures that the clippy code produces
valid input for the zebra_routemap.c functions, but
coverity SA does not understand this fact.  So add
some asserts to make the coverity SA happy.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
zebra/zebra_routemap.c

index 5355fa062e9c127c60f8d2dc195259730550d3f8..f48bf3b0338999fd4fbe9b6329bc4c613cc3957a 100644 (file)
@@ -705,6 +705,9 @@ DEFPY (ip_protocol,
 {
        int ret, rtype;
 
+       assert(proto);
+       assert(rmap);
+
        ZEBRA_DECLVAR_CONTEXT(vrf, zvrf);
 
        if (!zvrf)
@@ -737,6 +740,8 @@ DEFPY (no_ip_protocol,
 {
        int ret, rtype;
 
+       assert(proto);
+
        ZEBRA_DECLVAR_CONTEXT(vrf, zvrf);
 
        if (!zvrf)
@@ -781,6 +786,9 @@ DEFPY (ipv6_protocol,
 {
        int ret, rtype;
 
+       assert(rmap);
+       assert(proto);
+
        ZEBRA_DECLVAR_CONTEXT(vrf, zvrf);
 
        if (!zvrf)
@@ -813,6 +821,8 @@ DEFPY (no_ipv6_protocol,
 {
        int ret, rtype;
 
+       assert(proto);
+
        ZEBRA_DECLVAR_CONTEXT(vrf, zvrf);
 
        if (!zvrf)
@@ -858,6 +868,9 @@ DEFPY (ip_protocol_nht_rmap,
 
        int ret, rtype;
 
+       assert(proto);
+       assert(rmap);
+
        ZEBRA_DECLVAR_CONTEXT(vrf, zvrf);
 
        if (!zvrf)
@@ -890,6 +903,8 @@ DEFPY (no_ip_protocol_nht_rmap,
 {
        int ret, rtype;
 
+       assert(proto);
+
        ZEBRA_DECLVAR_CONTEXT(vrf, zvrf);
 
        if (!zvrf)
@@ -935,6 +950,9 @@ DEFPY (ipv6_protocol_nht_rmap,
 {
        int ret, rtype;
 
+       assert(rmap);
+       assert(proto);
+
        ZEBRA_DECLVAR_CONTEXT(vrf, zvrf);
 
        if (!zvrf)
@@ -967,6 +985,8 @@ DEFPY (no_ipv6_protocol_nht_rmap,
 {
        int ret, rtype;
 
+       assert(proto);
+
        ZEBRA_DECLVAR_CONTEXT(vrf, zvrf);
 
        if (!zvrf)