fix pointer-to-int cast problem

This commit is contained in:
itojun 2002-11-28 09:57:16 +00:00
parent 3bfa71c0c3
commit 935a2e30db
1 changed files with 7 additions and 1 deletions

View File

@ -3974,9 +3974,15 @@ auth_server (root, lto_server, lfrom_server, verify_only, do_gssapi, hostname)
if (do_gssapi)
{
#ifdef HAVE_GSSAPI
int fd = (int) lto_server->closure;
int fd;
struct stat s;
if ((intptr_t) lto_server->closure > INT_MAX)
{
error (1, 0, "file descriptor out of range");
}
fd = (intptr_t)lto_server->closure;
if (fstat (fd, &s) < 0 || !S_ISSOCK(s.st_mode))
{
error (1, 0, "gserver currently only enabled for socket connections");