[MPlayer-cvslog] CVS: main/libmpdemux asf_mmst_streaming.c, 1.28, 1.29
Dominik 'Rathann' Mierzejewski
dominik at rangers.eu.org
Sat Apr 16 02:40:35 CEST 2005
On Saturday, 16 April 2005 at 01:32, Roberto Togni CVS wrote:
> CVS change done by Roberto Togni CVS
>
> Update of /cvsroot/mplayer/main/libmpdemux
> In directory mail:/var2/tmp/cvs-serv27493
>
> Modified Files:
> asf_mmst_streaming.c
> Log Message:
> Fix potential buffer overflow for urls with more than 20 streams
>
>
> Index: asf_mmst_streaming.c
> ===================================================================
> RCS file: /cvsroot/mplayer/main/libmpdemux/asf_mmst_streaming.c,v
> retrieving revision 1.28
> retrieving revision 1.29
> diff -u -r1.28 -r1.29
> --- asf_mmst_streaming.c 13 Apr 2005 19:21:05 -0000 1.28
> +++ asf_mmst_streaming.c 15 Apr 2005 23:31:57 -0000 1.29
> @@ -334,8 +334,12 @@
>
> printf ("stream object, stream id: %d\n", stream_id);
>
> + if (num_stream_ids < 20) {
> stream_ids[num_stream_ids] = stream_id;
> num_stream_ids++;
> + } else {
> + printf ("too many id, stream skipped");
> + }
>
> } else {
> printf ("unknown object\n");
>
Hmm... what about the attached patch (untested) to make increasing
the number easier in the future?
R.
--
MPlayer RPMs maintainer: http://rpm.greysector.net/mplayer/
"I am Grey. I stand between the candle and the star. We are Grey.
We stand between the darkness ... and the light."
-- Delenn in Grey Council in Babylon 5:"Babylon Squared"
-------------- next part --------------
Index: asf_mmst_streaming.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/asf_mmst_streaming.c,v
retrieving revision 1.29
diff -u -r1.29 asf_mmst_streaming.c
--- asf_mmst_streaming.c 15 Apr 2005 23:31:57 -0000 1.29
+++ asf_mmst_streaming.c 16 Apr 2005 00:39:08 -0000
@@ -42,6 +42,7 @@
#define BUF_SIZE 102400
#define HDR_BUF_SIZE 8192
+#define MAX_STREAMS
typedef struct
{
@@ -52,7 +53,7 @@
static int seq_num;
static int num_stream_ids;
-static int stream_ids[20];
+static int stream_ids[MAX_STREAMS];
static int get_data (int s, char *buf, size_t count);
@@ -334,7 +335,7 @@
printf ("stream object, stream id: %d\n", stream_id);
- if (num_stream_ids < 20) {
+ if (num_stream_ids < MAX_STREAMS) {
stream_ids[num_stream_ids] = stream_id;
num_stream_ids++;
} else {
More information about the MPlayer-cvslog
mailing list