aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-14 14:17:43 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-14 14:17:43 +0000
commitd0de2c7053a1a71fb4b90f48c3a37066c1d627a9 (patch)
treefe0a60547b466d068054a8981f972463c78887c5 /main
parent3f5588297e2f5c95cf57452fe1e4836d781025bd (diff)
(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. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@79379 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/channel.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/main/channel.c b/main/channel.c
index 3ddda153c..9d2460633 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -1934,6 +1934,12 @@ static struct ast_channel *ast_waitfor_nandfds_complex(struct ast_channel **c, i
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);