diff options
author | Russ White <russ@riw.us> | 2021-10-06 01:24:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-06 01:24:34 +0200 |
commit | a3232e63e642742cef4f2c3cb6fd15f6500004bb (patch) | |
tree | c2ea9d1a2be4dcac988ff4f0d2e03d2330e9b8c6 | |
parent | Merge pull request #9743 from pguibert6WIND/largecomm (diff) | |
parent | lib: prevent gRPC assert on missing YANG node (diff) | |
download | frr-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.cpp | 4 |
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) |