Looking up a nonexistent user ID would lead to a null pointer
dereference. That's unlikely to happen here, but perhaps
not impossible.
Thinko in commit
4d5111b3f, noticed by Coverity.
DWORD namesize = sizeof(username);
#else
struct passwd pwbuf;
- struct passwd *pw;
+ struct passwd *pw = NULL;
char buf[1024];
int rc;
#endif
if (errorMessage)
libpq_append_error(errorMessage, "local user with ID %ld does not exist", (long) user_id);
}
- name = pw->pw_name;
+ else
+ name = pw->pw_name;
#endif
if (name)