if (sz <= internal_arraysz)
p = internal_array;
- else if ((p = realloc(internal_array, sz * sizeof(char*))) != NULL) {
+ else if ((p = reallocarray(internal_array, sz, sizeof(char*))) != NULL) {
internal_arraysz = sz;
internal_array = p;
}
break; /* Don't retry default on 'me' */
if (i == 0)
r = -1;
- else if ((r = open(login_dbarray[0], O_RDONLY)) >= 0)
+ else if ((r = open(login_dbarray[0], O_RDONLY | O_CLOEXEC)) >= 0)
close(r);
/*
* If there's at least one login class database,
/*
* login_getcapbool()
- * From the login_cap_t <lc>, check for the existance of the capability
+ * From the login_cap_t <lc>, check for the existence of the capability
* of <cap>. Return <def> if <lc>->lc_cap is NULL, otherwise return
* the whether or not <cap> exists there.
*/