[libbluray-devel] cs0 string length can't be < 1

Petri Hintukainen git at videolan.org
Sun Jun 11 16:42:32 CEST 2017


libudfread | branch: master | Petri Hintukainen <phintuka at gmail.com> | Sun Jun 11 17:24:27 2017 +0300| [4159111ed2b120375f02ade45158432ef6696ea4] | committer: Petri Hintukainen

cs0 string length can't be < 1

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

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

diff --git a/src/udfread.c b/src/udfread.c
index 816caeb..0e450f3 100644
--- a/src/udfread.c
+++ b/src/udfread.c
@@ -182,6 +182,10 @@ static char *_cs0_to_utf8(const uint8_t *cs0, size_t size)
         udf_error("out of memory\n");
         return NULL;
     }
+    if (size < 1) {
+        udf_error("too short cs0 string\n");
+        return NULL;
+    }
 
     switch (cs0[0]) {
     case 8:



More information about the libbluray-devel mailing list