[libbluray-devel] Fix alloc size

hpi1 git at videolan.org
Tue Oct 28 14:26:01 CET 2014


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Fri Oct 17 20:13:31 2014 +0300| [a92853c8f5021e53b33f9cbf7c74fc14dd1d5e56] | committer: hpi1

Fix alloc size

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

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

diff --git a/src/examples/mpls_dump.c b/src/examples/mpls_dump.c
index 523e444..f95dd09 100644
--- a/src/examples/mpls_dump.c
+++ b/src/examples/mpls_dump.c
@@ -158,7 +158,7 @@ _mk_path(const char *base, const char *sub)
 {
     size_t n1 = strlen(base);
     size_t n2 = strlen(sub);
-    char *result = malloc(n1 + n2 + 1);
+    char *result = malloc(n1 + n2 + strlen(DIR_SEP) + 1);
     strcpy(result, base);
     strcat(result, DIR_SEP);
     strcat(result, sub);



More information about the libbluray-devel mailing list