changeset 15172:56541efe420b

Fix potential buffer overflow if server answers with too many lines
author rtognimp
date Fri, 15 Apr 2005 23:30:44 +0000
parents c047b2d7f7ce
children 424386614ad5
files libmpdemux/realrtsp/rtsp.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/realrtsp/rtsp.c	Fri Apr 15 23:23:43 2005 +0000
+++ b/libmpdemux/realrtsp/rtsp.c	Fri Apr 15 23:30:44 2005 +0000
@@ -397,6 +397,7 @@
   unsigned int answer_seq;
   char **answer_ptr=s->answers;
   int code;
+  int ans_count = 0;
   
   answer=rtsp_get(s);
   if (!answer)
@@ -448,7 +449,7 @@
     }
     *answer_ptr=answer;
     answer_ptr++;
-  } while (strlen(answer)!=0);
+  } while ((strlen(answer)!=0) && (++ans_count < MAX_FIELDS));
   
   s->cseq++;