[libbluray-devel] mpls_dump: fix out of bounds write

hpi1 git at videolan.org
Sun Aug 21 15:06:49 CEST 2016


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Sun Aug 21 15:51:34 2016 +0300| [29a1c824f8b107db340b80f49bbe9c9fd16946d6] | committer: hpi1

mpls_dump: fix out of bounds write

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

 src/devtools/mpls_dump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/devtools/mpls_dump.c b/src/devtools/mpls_dump.c
index 2db25d1..147314e 100644
--- a/src/devtools/mpls_dump.c
+++ b/src/devtools/mpls_dump.c
@@ -768,7 +768,7 @@ main(int argc, char *argv[])
             }
             struct dirent *ent;
             int jj = 0;
-            for (ent = readdir(dir); ent != NULL; ent = readdir(dir)) {
+            for (ent = readdir(dir); ent != NULL && jj < 1000; ent = readdir(dir)) {
                 char *s = (char*)malloc(strlen(ent->d_name) + 1);
                 if (s) {
                     dirlist[jj++] = strcpy(s, ent->d_name);



More information about the libbluray-devel mailing list