Add yang_stmt NULL check in yang_order to prevent SEGFAULT
This commit is contained in:
parent
16de5f47ba
commit
2f997b169a
1 changed files with 4 additions and 0 deletions
|
|
@ -850,6 +850,10 @@ yang_order(yang_stmt *y)
|
||||||
* if so, the real parent (from an xml point of view) is the parents
|
* if so, the real parent (from an xml point of view) is the parents
|
||||||
* parent.
|
* parent.
|
||||||
*/
|
*/
|
||||||
|
if (y == NULL){
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
yp = y->ys_parent;
|
yp = y->ys_parent;
|
||||||
while (yp->ys_keyword == Y_CASE || yp->ys_keyword == Y_CHOICE)
|
while (yp->ys_keyword == Y_CASE || yp->ys_keyword == Y_CHOICE)
|
||||||
yp = yp->ys_parent;
|
yp = yp->ys_parent;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue