svec_find() returns SIZE_MAX, not 0, when the specified name cannot be
found. Don't dereference the names array in this case.
Fixes a segfault that commonly occurred when secchan was started by
vswitchd.
lookup_netdev(const struct netdev_monitor *mon, const char *name)
{
size_t idx = svec_find(&mon->netdevs, name);
- return idx ? mon->netdevs.names[idx] : NULL;
+ return idx != SIZE_MAX ? mon->netdevs.names[idx] : NULL;
}
static const char *