Pārlūkot izejas kodu

modules/mediaproxy: crash fix
- Fixed crash when received reply contains more streams than the
INVITE. Credits to Sa�l Ibarra Corretg�.

Juha Heinanen 15 gadi atpakaļ
vecāks
revīzija
26d735b5c8
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      modules/mediaproxy/mediaproxy.c

+ 1 - 1
modules/mediaproxy/mediaproxy.c

@@ -1533,7 +1533,7 @@ use_media_proxy(struct sip_msg *msg, char *dialog_id)
         }
         }
     }
     }
 
 
-    for (i=0, j=1; i<session.stream_count; i++) {
+    for (i=0, j=1; i<session.stream_count && j<len; i++) {
         stream = session.streams[i];
         stream = session.streams[i];
         if (stream.transport != TSupported) {
         if (stream.transport != TSupported) {
             if (!stream.local_ip && removed_session_ip) {
             if (!stream.local_ip && removed_session_ip) {