Merge pull request #84 from 008agent/yand_order_null_stmt

Add yang_stmt NULL check in yang_order to prevent SEGFAULT
This commit is contained in:
Olof Hagsand 2019-04-25 12:40:22 +02:00 committed by GitHub
commit 99c0108d4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -850,6 +850,10 @@ yang_order(yang_stmt *y)
* if so, the real parent (from an xml point of view) is the parents
* parent.
*/
if (y == NULL){
return -1;
}
yp = y->ys_parent;
while (yp->ys_keyword == Y_CASE || yp->ys_keyword == Y_CHOICE)
yp = yp->ys_parent;