mirror of
https://github.com/mpv-player/mpv
synced 2024-12-19 13:21:13 +00:00
Fix possible integer overflow in malloc by using calloc instead.
Should fix CVE-2008-0073 as far as MPlayer is affected by this problem. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26299 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
33dc71664e
commit
54c48f18a1
@ -330,7 +330,8 @@ sdpplin_t *sdpplin_parse(char *data) {
|
|||||||
|
|
||||||
if(filter(data,"a=StreamCount:integer;",&buf)) {
|
if(filter(data,"a=StreamCount:integer;",&buf)) {
|
||||||
desc->stream_count=(unsigned int)atoi(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;
|
handled=1;
|
||||||
data=nl(data);
|
data=nl(data);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user