]> git.proxmox.com Git - mirror_frr.git/commitdiff
Merge pull request #11194 from donaldsharp/untrusted
authorDonatas Abraitis <donatas@opensourcerouting.org>
Fri, 13 May 2022 11:43:11 +0000 (14:43 +0300)
committerGitHub <noreply@github.com>
Fri, 13 May 2022 11:43:11 +0000 (14:43 +0300)
Some more Coverity issues solved

babeld/message.c
bfdd/bfdd.c
bgpd/bgp_attr.c

index 559b8c4e4ac829946d91fd876a7781019a8b2f29..0ddfda8d7b551de599f97e1bfd3daee161b7d706 100644 (file)
@@ -286,7 +286,7 @@ channels_len(unsigned char *channels)
    followed by a sequence of TLVs. TLVs of known types are also checked to meet
    minimum length constraints defined for each. Return 0 for no errors. */
 static int
-babel_packet_examin(const unsigned char *packet, int packetlen)
+babel_packet_examin(const unsigned char *packet, int packetlen, int *blength)
 {
     int i = 0, bodylen;
     const unsigned char *message;
@@ -323,6 +323,8 @@ babel_packet_examin(const unsigned char *packet, int packetlen)
         }
         i += len + 2;
     }
+
+    *blength = bodylen;
     return 0;
 }
 
@@ -356,7 +358,7 @@ parse_packet(const unsigned char *from, struct interface *ifp,
         return;
     }
 
-    if (babel_packet_examin (packet, packetlen)) {
+    if (babel_packet_examin (packet, packetlen, &bodylen)) {
         flog_err(EC_BABEL_PACKET,
                  "Received malformed packet on %s from %s.",
                   ifp->name, format_address(from));
@@ -369,8 +371,6 @@ parse_packet(const unsigned char *from, struct interface *ifp,
         return;
     }
 
-    DO_NTOHS(bodylen, packet + 2);
-
     i = 0;
     while(i < bodylen) {
         message = packet + 4 + i;
index c7649415133ea10effef0fda327e10818c686259..7ef229da1bb73a6b0c593d0599bb4533bb19cd0d 100644 (file)
@@ -337,6 +337,8 @@ int main(int argc, char *argv[])
        bool ctlsockused = false;
        int opt;
 
+       bglobal.bg_use_dplane = false;
+
        /* Initialize system sockets. */
        bg_init();
 
index 6c10469da8267ca05f311a3e5d2c27ae68be19c6..d57281a70001ce4d07989b4721a7f02408cf89e5 100644 (file)
@@ -4430,7 +4430,7 @@ void bgp_packet_mpunreach_prefix(struct stream *s, const struct prefix *p,
                                 bool addpath_capable, uint32_t addpath_tx_id,
                                 struct attr *attr)
 {
-       uint8_t wlabel[3] = {0x80, 0x00, 0x00};
+       uint8_t wlabel[4] = {0x80, 0x00, 0x00};
 
        if (safi == SAFI_LABELED_UNICAST) {
                label = (mpls_label_t *)wlabel;