[libbluray-devel] Added limit for metadata xml file size

hpi1 git at videolan.org
Mon Jan 21 13:02:35 CET 2013


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Mon Jan 21 13:27:31 2013 +0200| [b89260404c7eaa242a978456730560df2ae2408f] | committer: hpi1

Added limit for metadata xml file size

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

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

diff --git a/src/libbluray/bdnav/meta_parse.c b/src/libbluray/bdnav/meta_parse.c
index a2b09d7..1a088c8 100644
--- a/src/libbluray/bdnav/meta_parse.c
+++ b/src/libbluray/bdnav/meta_parse.c
@@ -45,6 +45,7 @@
 
 #define BAD_CAST_CONST (const xmlChar *)
 
+#define MAX_META_FILE_SIZE  0xfffff
 
 #ifdef HAVE_LIBXML2
 static void _parseManifestNode(xmlNode * a_node, META_DL *disclib)
@@ -158,7 +159,7 @@ META_ROOT *meta_parse(const char *device_path)
         file_seek(handle, 0, SEEK_END);
         int64_t length = file_tell(handle);
 
-        if (length > 0) {
+        if (length > 0 && length < MAX_META_FILE_SIZE) {
             file_seek(handle, 0, SEEK_SET);
             uint8_t *data = malloc(length);
             int64_t size_read = file_read(handle, data, length);



More information about the libbluray-devel mailing list