summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2021-10-06 01:24:34 +0200
committerGitHub <noreply@github.com>2021-10-06 01:24:34 +0200
commita3232e63e642742cef4f2c3cb6fd15f6500004bb (patch)
treec2ea9d1a2be4dcac988ff4f0d2e03d2330e9b8c6
parentMerge pull request #9743 from pguibert6WIND/largecomm (diff)
parentlib: prevent gRPC assert on missing YANG node (diff)
downloadfrr-8.2-dev.tar.xz
frr-8.2-dev.zip
Merge pull request #9733 from opensourcerouting/grpc-fix-missingfrr-8.2-dev
lib: fix gRPC crash on missing YANG node
-rw-r--r--lib/northbound_grpc.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/northbound_grpc.cpp b/lib/northbound_grpc.cpp
index 71f07dfe8..e227d0385 100644
--- a/lib/northbound_grpc.cpp
+++ b/lib/northbound_grpc.cpp
@@ -344,6 +344,10 @@ static struct lyd_node *get_dnode_config(const std::string &path)
{
struct lyd_node *dnode;
+ if (!yang_dnode_exists(running_config->dnode,
+ path.empty() ? NULL : path.c_str()))
+ return NULL;
+
dnode = yang_dnode_get(running_config->dnode,
path.empty() ? NULL : path.c_str());
if (dnode)