[libbluray-devel] MAke sure directory entry name is always null-terminated
hpi1
git at videolan.org
Thu Aug 21 11:31:24 CEST 2014
libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Thu Aug 21 12:25:30 2014 +0300| [1e879e9719e77a999e8a0d3b99fdb874b5a4cb9a] | committer: hpi1
MAke sure directory entry name is always null-terminated
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=1e879e9719e77a999e8a0d3b99fdb874b5a4cb9a
---
src/file/dir_posix.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/file/dir_posix.c b/src/file/dir_posix.c
index 973f8dc..ea63581 100644
--- a/src/file/dir_posix.c
+++ b/src/file/dir_posix.c
@@ -55,6 +55,7 @@ static int _dir_read_posix(BD_DIR_H *dir, BD_DIRENT *entry)
return 1;
}
strncpy(entry->d_name, e.d_name, 256);
+ entry->d_name[sizeof(entry->d_name) - 1] = 0;
return 0;
}
More information about the libbluray-devel
mailing list