# HG changeset patch # User reimar # Date 1206790529 0 # Node ID 430da0c9fcced3d866dbcf2a48096d727b07dd37 # Parent 9f588f9959d607768314c25040aee037d8960748 Fix possible integer overflow in malloc by using calloc instead. Should fix CVE-2008-0073 as far as MPlayer is affected by this problem. diff -r 9f588f9959d6 -r 430da0c9fcce stream/realrtsp/sdpplin.c --- a/stream/realrtsp/sdpplin.c Fri Mar 28 14:02:53 2008 +0000 +++ b/stream/realrtsp/sdpplin.c Sat Mar 29 11:35:29 2008 +0000 @@ -330,7 +330,8 @@ if(filter(data,"a=StreamCount:integer;",&buf)) { desc->stream_count=(unsigned int)atoi(buf); - desc->stream=malloc(sizeof(sdpplin_stream_t*)*desc->stream_count); + desc->stream=calloc(desc->stream_count, sizeof(sdpplin_stream_t*)); + if (!desc->stream) desc->stream_count = 0; handled=1; data=nl(data); }