summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlan T. DeKok <aland@freeradius.org>2017-02-08 13:32:09 -0500
committerAlan T. DeKok <aland@freeradius.org>2017-02-08 13:32:09 -0500
commit083214c90d93768e4628d7e0e4d56c54908aa49a (patch)
tree832feab6f3d8f5838109907ce8293e7e18624c19 /src
parent9cb756993d5fc84319e5533d8147478976158329 (diff)
downloadlibpam-radius-auth-083214c90d93768e4628d7e0e4d56c54908aa49a.tar.gz
libpam-radius-auth-083214c90d93768e4628d7e0e4d56c54908aa49a.zip
Check conf->sockfd against FD_SETSIZE. Fixes #24
Diffstat (limited to 'src')
-rw-r--r--src/pam_radius_auth.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/pam_radius_auth.c b/src/pam_radius_auth.c
index 0db57d5..f3a4326 100644
--- a/src/pam_radius_auth.c
+++ b/src/pam_radius_auth.c
@@ -618,6 +618,14 @@ static int initialize(radius_conf_t *conf, int accounting)
return PAM_AUTHINFO_UNAVAIL;
}
+#ifndef HAVE_POLL_H
+ if (conf->sockfd >= FD_SETSIZE) {
+ _pam_log(LOG_ERR, "Unusable socket, FD is larger than %d\n", FD_SETSIZE);
+ close(conf->sockfd);
+ return PAM_AUTHINFO_UNAVAIL;
+ }
+#endif
+
/* set up the local end of the socket communications */
s_in = (struct sockaddr_in *) &salocal;
memset ((char *) s_in, '\0', sizeof(struct sockaddr));