[libbluray-devel] Check for overflow

Petri Hintukainen git at videolan.org
Sat Jun 24 14:40:18 CEST 2017


libudfread | branch: master | Petri Hintukainen <phintuka at gmail.com> | Thu Jun 22 16:17:42 2017 +0300| [0cb2105dc87fcaa6363464e4c31ccd083a3fd20d] | committer: Petri Hintukainen

Check for overflow

> http://git.videolan.org/gitweb.cgi/libudfread.git/?a=commit;h=0cb2105dc87fcaa6363464e4c31ccd083a3fd20d
---

 src/udfread.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/udfread.c b/src/udfread.c
index 3e58a45..999e140 100644
--- a/src/udfread.c
+++ b/src/udfread.c
@@ -908,6 +908,10 @@ static int _parse_dir(const uint8_t *data, uint32_t length, struct udf_dir *dir)
     while (p < end - 16) {
         size_t used;
 
+        if (dir->num_entries == UINT32_MAX) {
+            return 0;
+        }
+
         tag_id = decode_descriptor_tag(p);
         if (tag_id != ECMA_FileIdentifierDescriptor) {
             udf_error("unexpected tag %d in directory file\n", tag_id);



More information about the libbluray-devel mailing list