summaryrefslogtreecommitdiffstats
path: root/nhrpd/nhrp_main.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2021-02-14 22:04:16 +0100
committerDonald Sharp <sharpd@nvidia.com>2021-02-14 22:04:16 +0100
commit8ca7a3ed38ae84d0f8d4870f789362522544542e (patch)
tree29640e3913d7578ee3ce4dd190bce267e2fab7ae /nhrpd/nhrp_main.c
parentMerge pull request #8080 from opensourcerouting/log-whitespace (diff)
downloadfrr-8ca7a3ed38ae84d0f8d4870f789362522544542e.tar.xz
frr-8ca7a3ed38ae84d0f8d4870f789362522544542e.zip
nhrpd: Fix clang SA about null deref
Clang was complaining when running SA that the nhrpd_privs.change function was null. It just does not fully understand how things are setup. Add a assert to make it happy. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to '')
-rw-r--r--nhrpd/nhrp_main.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/nhrpd/nhrp_main.c b/nhrpd/nhrp_main.c
index 9fc13761c..49a4900bf 100644
--- a/nhrpd/nhrp_main.c
+++ b/nhrpd/nhrp_main.c
@@ -144,8 +144,13 @@ int main(int argc, char **argv)
nhrp_interface_init();
resolver_init(master);
- /* Run with elevated capabilities, as for all netlink activity
- * we need privileges anyway. */
+ /*
+ * Run with elevated capabilities, as for all netlink activity
+ * we need privileges anyway.
+ * The assert is for clang SA code where it does
+ * not see the change function being set in lib
+ */
+ assert(nhrpd_privs.change);
nhrpd_privs.change(ZPRIVS_RAISE);
netlink_init();