userdbctl: avoid NULL pointer deref

Error from uid_range_load_userns is ignored,
so 'p' could be NULL.
This commit is contained in:
Mike Yuan
2024-04-08 20:20:26 +08:00
parent 7fe28d8386
commit f48b487ddb
+3
View File
@@ -310,6 +310,9 @@ static int table_add_uid_map(
assert(table);
assert(add_unavailable);
if (!p)
return 0;
for (size_t i = 0; p && i < p->n_entries; i++) {
UIDRangeEntry *x = p->entries + i;