Make sure read_m3u won't read past the end of the buffer, causing a crash
This commit is contained in:
commit
cfae937bda
|
@ -1,5 +1,9 @@
|
|||
D1X-Rebirth Changelog
|
||||
|
||||
20101122
|
||||
--------
|
||||
arch/sdl/jukebox.c: Make sure read_m3u won't read past the end of the buffer, causing a crash
|
||||
|
||||
20101121
|
||||
--------
|
||||
arch/sdl/jukebox.c, include/physfsx.h, main/menu.c, misc/physfsx.c: Created function PHYSFSX_isNewPath to check wether given path has already been added to Searchpath or not; Used PHYSFSX_isNewPath for menu browsing code instead it's own implementation; Using PHYSFSX_isNewPath for Jukebox directory, too to make sure Jukebox will not accidentially remove Game content depending on user selection; Also only keep Jukebox directory added until files are stored to prevent any other file present in this path can override or add anything to the game
|
||||
|
|
|
@ -101,7 +101,7 @@ void read_m3u(void)
|
|||
JukeboxSongs.max_buf = length + 1;
|
||||
buf = JukeboxSongs.list_buf;
|
||||
|
||||
while (buf < JukeboxSongs.list_buf + length)
|
||||
while (buf < JukeboxSongs.list_buf + length - 1)
|
||||
{
|
||||
while (*buf == 0 || *buf == 10 || *buf == 13) // find new line - support DOS, Unix and Mac line endings
|
||||
buf++;
|
||||
|
|
Loading…
Reference in a new issue