diff -Nurp -x .svn a/channels/chan_sip.c b/channels/chan_sip.c --- a/channels/chan_sip.c 2009-09-16 14:32:54.185509968 -0400 +++ b/channels/chan_sip.c 2009-09-16 14:34:15.944581908 -0400 @@ -2964,7 +2964,7 @@ static void *_sip_tcp_helper_thread(stru while (cl > 0) { size_t bytes_read; ast_mutex_lock(&tcptls_session->lock); - if (!(bytes_read = fread(buf, MIN(sizeof(buf) - 1, cl), 1, tcptls_session->f))) { + if (!(bytes_read = fread(buf, 1, MIN(sizeof(buf) - 1, cl), tcptls_session->f))) { ast_mutex_unlock(&tcptls_session->lock); goto cleanup; }