diff --git a/lib/krb5/changepw.c b/lib/krb5/changepw.c index 0c146edc9..5d0081db2 100644 --- a/lib/krb5/changepw.c +++ b/lib/krb5/changepw.c @@ -299,6 +299,12 @@ krb5_change_password (krb5_context context, } } + if (sock >= FD_SETSIZE) { + ret = ERANGE; + close (sock); + goto out; + } + FD_ZERO(&fdset); FD_SET(sock, &fdset); tv.tv_usec = 0;