mirror of
https://github.com/asterisk/asterisk.git
synced 2026-07-04 05:55:58 -07:00
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
This commit is contained in:
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user