[asterisk-commits] russell: branch 1.4 r140816 - /branches/1.4/main/poll.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Sep 3 08:24:35 CDT 2008


Author: russell
Date: Wed Sep  3 08:24:35 2008
New Revision: 140816

URL: http://svn.digium.com/view/asterisk?view=rev&rev=140816
Log:
Don't freak out if the poll emulation receives NULL for the pollfds array
(closes issue #13307)
Reported by: jcovert

Modified:
    branches/1.4/main/poll.c

Modified: branches/1.4/main/poll.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/poll.c?view=diff&rev=140816&r1=140815&r2=140816
==============================================================================
--- branches/1.4/main/poll.c (original)
+++ branches/1.4/main/poll.c Wed Sep  3 08:24:35 2008
@@ -273,19 +273,19 @@
     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. */
 




More information about the asterisk-commits mailing list