namespace-util: explicitly specify namespace_info[]'s size
We do this already in all string lookup tables. This way it's guaranteed that iterators which ends with _NAMESPACE_TYPE_MAX wouldn't overrun the array.
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
#include "stdio-util.h"
|
||||
#include "user-util.h"
|
||||
|
||||
const struct namespace_info namespace_info[] = {
|
||||
const struct namespace_info namespace_info[_NAMESPACE_TYPE_MAX + 1] = {
|
||||
[NAMESPACE_CGROUP] = { "cgroup", "ns/cgroup", CLONE_NEWCGROUP, },
|
||||
[NAMESPACE_IPC] = { "ipc", "ns/ipc", CLONE_NEWIPC, },
|
||||
[NAMESPACE_NET] = { "net", "ns/net", CLONE_NEWNET, },
|
||||
|
||||
Reference in New Issue
Block a user