diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 2fe41608c..1a3011367 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -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 diff --git a/arch/sdl/jukebox.c b/arch/sdl/jukebox.c index 3d39f1188..b45aeecd0 100644 --- a/arch/sdl/jukebox.c +++ b/arch/sdl/jukebox.c @@ -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++;