Reverse order of args to fread.
This way, we don't always write a null byte into byte 1 of the buffer (closes issue #15905) Reported by: ebroad Patches: freadfix.patch uploaded by ebroad (license 878) Tested by: ebroad git-svn-id: http://svn.digium.com/svn/asterisk/trunk@218933 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
parent
bfbc078467
commit
bdc586caee
|
@ -2964,7 +2964,7 @@ static void *_sip_tcp_helper_thread(struct sip_pvt *pvt, struct ast_tcptls_sessi
|
|||
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;
|
||||
}
|
||||
|
|
Reference in New Issue