[asterisk-commits] file: trunk r79379 - /trunk/main/channel.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Aug 14 09:17:43 CDT 2007


Author: file
Date: Tue Aug 14 09:17:43 2007
New Revision: 79379

URL: http://svn.digium.com/view/asterisk?view=rev&rev=79379
Log:
(closes issue #10427)
Reported by: pj
Two of the three places ast_waitfor_nandfds could branch off to did not clear outfd and exception. If the calling function did not clear these there was a chance they could get a false positive on testing to see whether they were set.

Modified:
    trunk/main/channel.c

Modified: trunk/main/channel.c
URL: http://svn.digium.com/view/asterisk/trunk/main/channel.c?view=diff&rev=79379&r1=79378&r2=79379
==============================================================================
--- trunk/main/channel.c (original)
+++ trunk/main/channel.c Tue Aug 14 09:17:43 2007
@@ -1934,6 +1934,12 @@
 struct ast_channel *ast_waitfor_nandfds(struct ast_channel **c, int n, int *fds, int nfds,
 					int *exception, int *outfd, int *ms)
 {
+	/* Clear all provided values in one place. */
+	if (outfd)
+		*outfd = -99999;
+	if (exception)
+		*exception = 0;
+
 	/* If no epoll file descriptor is available resort to classic nandfds */
 	if (!n || nfds || c[0]->epfd == -1)
 		return ast_waitfor_nandfds_classic(c, n, fds, nfds, exception, outfd, ms);




More information about the asterisk-commits mailing list