diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-09-03 13:26:43 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-09-03 13:26:43 +0000 |
commit | 07dd40dfa949e10c11c284188651a2977452f341 (patch) | |
tree | 05d4126533d5f04bd61dbbeba5a30627b2c818bb /main | |
parent | c49e9508631a1626f84f6f478120389a105ee7a5 (diff) |
Merged revisions 140816 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r140816 | russell | 2008-09-03 08:24:35 -0500 (Wed, 03 Sep 2008) | 4 lines
Don't freak out if the poll emulation receives NULL for the pollfds array
(closes issue #13307)
Reported by: jcovert
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@140817 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r-- | main/poll.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/main/poll.c b/main/poll.c index 731dbcefb..823d0cbd4 100644 --- a/main/poll.c +++ b/main/poll.c @@ -268,19 +268,19 @@ int poll fd_set except_descs; /* exception descs */ struct timeval stime; /* select() timeout value */ int ready_descriptors; /* function result */ - int max_fd; /* maximum fd value */ + int max_fd = 0; /* maximum fd value */ struct timeval *pTimeout; /* actually passed */ FD_ZERO (&read_descs); FD_ZERO (&write_descs); FD_ZERO (&except_descs); - assert(pArray != (struct pollfd *) NULL); - /* Map the poll() file descriptor list in the select() data structures. */ - max_fd = map_poll_spec(pArray, n_fds, - &read_descs, &write_descs, &except_descs); + if (pArray) { + max_fd = map_poll_spec (pArray, n_fds, + &read_descs, &write_descs, &except_descs); + } /* Map the poll() timeout value in the select() timeout structure. */ pTimeout = map_timeout(timeout, &stime); |