From f1014c20bdc0aa2395bcc05371c859bfce30361d Mon Sep 17 00:00:00 2001 From: Mike Melanson Date: Sat, 16 Apr 2005 07:10:51 +0000 Subject: address buffer overflow condition CVS patchset: 7458 CVS date: 2005/04/16 07:10:51 --- src/input/librtsp/rtsp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/input/librtsp/rtsp.c b/src/input/librtsp/rtsp.c index 89ab63c80..d3221c463 100644 --- a/src/input/librtsp/rtsp.c +++ b/src/input/librtsp/rtsp.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: rtsp.c,v 1.18 2004/07/25 17:13:54 mroi Exp $ + * $Id: rtsp.c,v 1.19 2005/04/16 07:10:51 tmmm Exp $ * * a minimalistic implementation of rtsp protocol, * *not* RFC 2326 compilant yet. @@ -218,6 +218,7 @@ static int rtsp_get_answers(rtsp_t *s) { unsigned int answer_seq; char **answer_ptr=s->answers; int code; + int ans_count = 0; answer=rtsp_get(s); if (!answer) @@ -268,7 +269,7 @@ static int rtsp_get_answers(rtsp_t *s) { } *answer_ptr=answer; answer_ptr++; - } while (strlen(answer)!=0); + } while ((strlen(answer)!=0) && (++ans_count < MAX_FIELDS)); s->cseq++; -- cgit v1.2.3