mirror of
https://github.com/FRRouting/frr.git
synced 2025-04-30 13:37:17 +02:00
lib: Fix Null pointer derenference that happened to not crash
lib/yang.c:248:3: runtime error: member access within null pointer of type 'struct lysc_node_action' lib/yang.c:254:3: runtime error: member access within null pointer of type 'struct lysc_node_notif' If this data structure happens to ever be moved around we'll start crashing. Let's just fix it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
b4c884b9ae
commit
2d0ddde65c
28
lib/yang.c
28
lib/yang.c
|
@ -251,17 +251,25 @@ int yang_snodes_iterate(const struct lys_module *module, yang_iterate_cb cb,
|
|||
if (ret == YANG_ITER_STOP)
|
||||
return ret;
|
||||
}
|
||||
LY_LIST_FOR (&module_iter->compiled->rpcs->node, snode) {
|
||||
ret = yang_snodes_iterate_subtree(snode, module, cb,
|
||||
flags, arg);
|
||||
if (ret == YANG_ITER_STOP)
|
||||
return ret;
|
||||
if (module_iter->compiled->rpcs) {
|
||||
LY_LIST_FOR (&module_iter->compiled->rpcs->node, snode) {
|
||||
ret = yang_snodes_iterate_subtree(snode, module,
|
||||
cb, flags,
|
||||
arg);
|
||||
if (ret == YANG_ITER_STOP)
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
LY_LIST_FOR (&module_iter->compiled->notifs->node, snode) {
|
||||
ret = yang_snodes_iterate_subtree(snode, module, cb,
|
||||
flags, arg);
|
||||
if (ret == YANG_ITER_STOP)
|
||||
return ret;
|
||||
|
||||
if (module_iter->compiled->notifs) {
|
||||
LY_LIST_FOR (&module_iter->compiled->notifs->node,
|
||||
snode) {
|
||||
ret = yang_snodes_iterate_subtree(snode, module,
|
||||
cb, flags,
|
||||
arg);
|
||||
if (ret == YANG_ITER_STOP)
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue