Mercurial > mplayer.hg
comparison libmpdemux/realrtsp/rtsp.c @ 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 | 2e8b1e13b8c3 |
children | 281d155fb37f |
comparison
equal
deleted
inserted
replaced
15171:c047b2d7f7ce | 15172:56541efe420b |
---|---|
395 | 395 |
396 char *answer=NULL; | 396 char *answer=NULL; |
397 unsigned int answer_seq; | 397 unsigned int answer_seq; |
398 char **answer_ptr=s->answers; | 398 char **answer_ptr=s->answers; |
399 int code; | 399 int code; |
400 int ans_count = 0; | |
400 | 401 |
401 answer=rtsp_get(s); | 402 answer=rtsp_get(s); |
402 if (!answer) | 403 if (!answer) |
403 return 0; | 404 return 0; |
404 code=rtsp_get_code(answer); | 405 code=rtsp_get_code(answer); |
446 } | 447 } |
447 free(buf); | 448 free(buf); |
448 } | 449 } |
449 *answer_ptr=answer; | 450 *answer_ptr=answer; |
450 answer_ptr++; | 451 answer_ptr++; |
451 } while (strlen(answer)!=0); | 452 } while ((strlen(answer)!=0) && (++ans_count < MAX_FIELDS)); |
452 | 453 |
453 s->cseq++; | 454 s->cseq++; |
454 | 455 |
455 *answer_ptr=NULL; | 456 *answer_ptr=NULL; |
456 rtsp_schedule_standard(s); | 457 rtsp_schedule_standard(s); |