Diff between 0d989313b39e52eff0b4ad6d4adf0b3dfbaf1179 and 870fe03a79fa990c40f37f037e9236dba11811e2

Changed Files

File Additions Deletions Status
lib/sdp.c +11 -0 modified

Full Patch

diff --git a/lib/sdp.c b/lib/sdp.c
index b87f392..7ab7379 100644
--- a/lib/sdp.c
+++ b/lib/sdp.c
@@ -4189,6 +4189,17 @@ int sdp_process(sdp_session_t *session)
 		goto end;
 	}
 
+	/* Out of bound check before using rsp_count as offset for
+	 * continuation state, which has at least a one byte size
+	 * field.
+	 */
+	if ((n - (int) sizeof(sdp_pdu_hdr_t)) < plen + 1) {
+		t->err = EPROTO;
+		SDPERR("Protocol error: invalid PDU size");
+		status = SDP_INVALID_PDU_SIZE;
+		goto end;
+	}
+
 	pcstate = (sdp_cstate_t *) (pdata + rsp_count);
 
 	SDPDBG("Cstate length : %d\n", pcstate->length);