-
lxc-ls: try to protect stack in recursive function · f4336974Christian Brauner authored
As ls_get() is non-tail recursive we face the inherent danger of blowing up the stack at some level of nesting. To have at least some security we define MAX_NESTLVL to be 5. That should be sufficient for most users. The argument lvl to ls_get() can be used to keep track of the level of nesting we are at. If lvl is greater than the allowed default level return (without error) and unwind the stack. --nesting gains an optional numeric argument. This allows the user to specify the maximum level of nesting she/he wants to see. Fair warning: If your nesting level is really deep and/or you have a lot of containers your might run into trouble. Signed-off-by:
Christian Brauner <christian.brauner@mailbox.org> Acked-by:
Serge E. Hallyn <serge.hallyn@ubuntu.com>
f4336974
| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| include | Loading commit data... | |
| lua-lxc | Loading commit data... | |
| lxc | Loading commit data... | |
| python-lxc | Loading commit data... | |
| tests | Loading commit data... | |
| Makefile.am | Loading commit data... |