uf->names = calloc(uf->Alloc, sizeof(*uf->names));
} else if (uf->Inuse == uf->Alloc) {
uf->Alloc = uf->Alloc << 1;
- uf->names = realloc(uf->names, uf->Alloc);
+ uf->names = realloc(uf->names, uf->Alloc * sizeof(*uf->names));
/* zero out the newly allocated memory */
- memset(uf->names[uf->Alloc >> 1],
+ memset(&uf->names[uf->Alloc >> 1],
'\0',
(uf->Alloc >> 1) * sizeof(*uf->names));
}
/* Stat the allowed users file. If it cannot be accessed, return. */
+ if (uf->path == NULL)
+ return;
+
if (stat(uf->path, &ChkBuf) < 0) {
if (errno == ENOENT) {
uf->LMT = 0;
/*
* The file changed, so re-read it.
*/
- syslog(LOG_INFO, "Check_forchange: Reloading user list.");
+ syslog(LOG_INFO, "Check_forfilechange: Reloading user list '%s'.", uf->path);
Read_usersfile(NULL, uf);
}