Skip to content
Snippets Groups Projects
Commit b72f28ea authored by Mark Michelson's avatar Mark Michelson
Browse files

Fix off-by-one error when reading SDP sent over TCP.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@218499 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent b64beef2
No related branches found
No related tags found
No related merge requests found
......@@ -2963,7 +2963,7 @@ static void *_sip_tcp_helper_thread(struct sip_pvt *pvt, struct ast_tcptls_sessi
if (sscanf(get_header(&reqcpy, "Content-Length"), "%30d", &cl)) {
while (cl > 0) {
ast_mutex_lock(&tcptls_session->lock);
if (!fread(buf, (cl < sizeof(buf)) ? cl : sizeof(buf), 1, tcptls_session->f)) {
if (!fread(buf, MIN(sizeof(buf) - 1, cl), 1, tcptls_session->f)) {
ast_mutex_unlock(&tcptls_session->lock);
goto cleanup;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment