Changeset 593 for trunk/server/source3/lib/util_sock.c
- Timestamp:
- Jul 1, 2011, 10:18:23 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/source3/lib/util_sock.c
r454 r593 496 496 497 497 for (nread=0; nread < mincnt; ) { 498 if (fd < 0 || fd >= FD_SETSIZE) { 499 errno = EBADF; 500 return map_nt_error_from_unix(EBADF); 501 } 502 498 503 FD_ZERO(&fds); 499 504 FD_SET(fd,&fds); … … 1236 1241 for (i=0; i<num_addrs; i++) { 1237 1242 sockets[i] = socket(addrs[i].ss_family, SOCK_STREAM, 0); 1238 if (sockets[i] < 0 )1243 if (sockets[i] < 0 || sockets[i] >= FD_SETSIZE) 1239 1244 goto done; 1240 1245 set_blocking(sockets[i], false); … … 1285 1290 1286 1291 for (i=0; i<num_addrs; i++) { 1287 if (sockets[i] == -1) 1292 if (sockets[i] < 0 || sockets[i] >= FD_SETSIZE) { 1293 /* This cannot happen - ignore if so. */ 1288 1294 continue; 1295 } 1289 1296 FD_SET(sockets[i], &wr_fds); 1290 1297 FD_SET(sockets[i], &r_fds); … … 1306 1313 for (i=0; i<num_addrs; i++) { 1307 1314 1308 if (sockets[i] == -1) 1315 if (sockets[i] < 0 || sockets[i] >= FD_SETSIZE) { 1316 /* This cannot happen - ignore if so. */ 1309 1317 continue; 1318 } 1310 1319 1311 1320 /* Stevens, Network Programming says that if there's a
Note:
See TracChangeset
for help on using the changeset viewer.