]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib,ripd: resolve clang SA warnings 17915/head
authorMark Stapp <mjs@cisco.com>
Thu, 27 Mar 2025 19:16:05 +0000 (15:16 -0400)
committerMark Stapp <mjs@cisco.com>
Tue, 8 Apr 2025 18:41:27 +0000 (14:41 -0400)
Looks like there were a couple of SA warnings lurking; fix
them.

Signed-off-by: Mark Stapp <mjs@cisco.com>
lib/northbound_oper.c
ripd/ripd.c

index 626c37082eefc7936870cb49be82caff8c928b38..d9ad9b1701619e22a990d215ff7d589f06b9cda2 100644 (file)
@@ -157,7 +157,8 @@ nb_op_create_yield_state(const char *xpath, struct yang_translator *translator,
        /* remove trailing '/'s */
        while (darr_len(ys->xpath) > 1 && ys->xpath[darr_len(ys->xpath) - 2] == '/') {
                darr_setlen(ys->xpath, darr_len(ys->xpath) - 1);
-               *darr_last(ys->xpath) = 0;
+               if (darr_last(ys->xpath))
+                       *darr_last(ys->xpath) = 0;
        }
        ys->xpath_orig = darr_strdup(xpath);
        ys->translator = translator;
index 2d038507ab3a7ebbc84bbf9c75c78430d165e009..c850df52ec2f5618e266ae49e4f7a1dd7f7a991c 100644 (file)
@@ -282,8 +282,14 @@ struct rip_info *rip_ecmp_replace(struct rip *rip, struct rip_info *rinfo_new)
  */
 struct rip_info *rip_ecmp_delete(struct rip *rip, struct rip_info *rinfo)
 {
-       struct route_node *rp = rinfo->rp;
-       struct list *list = (struct list *)rp->info;
+       struct route_node *rp;
+       struct list *list;
+
+       if (rinfo == NULL)
+               return NULL;
+
+       rp = rinfo->rp;
+       list = (struct list *)rp->info;
 
        EVENT_OFF(rinfo->t_timeout);