[libbluray-devel] meta_parse: initialize allocated memory.

hpi1 git at videolan.org
Wed Jan 22 12:49:41 CET 2014


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Tue Jan 21 09:11:32 2014 +0200| [ca049c3221ca828aadcf90d43214bc0dc84cf339] | committer: hpi1

meta_parse: initialize allocated memory.

 Fixes crash after parsing invalid meta data file.

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=ca049c3221ca828aadcf90d43214bc0dc84cf339
---

 src/libbluray/bdnav/meta_parse.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/libbluray/bdnav/meta_parse.c b/src/libbluray/bdnav/meta_parse.c
index dd3fc48..063c488 100644
--- a/src/libbluray/bdnav/meta_parse.c
+++ b/src/libbluray/bdnav/meta_parse.c
@@ -124,6 +124,8 @@ static void _findMetaXMLfiles(META_ROOT *meta, const char *device_path)
             uint8_t i = meta->dl_count;
             meta->dl_count++;
             meta->dl_entries = realloc(meta->dl_entries, (meta->dl_count*sizeof(META_DL)));
+            memset(&meta->dl_entries[i], 0, sizeof(meta->dl_entries[i]));
+
             meta->dl_entries[i].filename = str_dup(ent.d_name);
             strncpy(meta->dl_entries[i].language_code, ent.d_name+5,3);
             meta->dl_entries[i].language_code[3] = '\0';



More information about the libbluray-devel mailing list