Don't panic when enumerating SYSCTL_NODE() nodes without any children

nodes.

Submitted by:	green, Hiten Pandya <hiten@unixdaemons.com>
This commit is contained in:
Robert Watson 2003-02-22 17:58:06 +00:00
parent fd18f292bd
commit 90623e1a9e

View File

@ -557,7 +557,7 @@ sysctl_sysctl_next_ls(struct sysctl_oid_list *lsp, int *name, u_int namelen,
if (!sysctl_sysctl_next_ls(lsp, 0, 0, next+1,
len, level+1, oidpp))
return 0;
goto next;
goto emptynode;
}
if (oidp->oid_number < *name)
@ -586,6 +586,7 @@ sysctl_sysctl_next_ls(struct sysctl_oid_list *lsp, int *name, u_int namelen,
return (0);
next:
namelen = 1;
emptynode:
*len = level;
}
return 1;