From 8bcf9a95ebe77628b137c5f4d781f87b7c1b8a84 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Mon, 25 Nov 2013 13:17:57 +0100 Subject: [PATCH] Fix wrong memory access. --- src/VfsNs.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/VfsNs.h b/src/VfsNs.h index 07610de..33f9558 100644 --- a/src/VfsNs.h +++ b/src/VfsNs.h @@ -9,6 +9,12 @@ #include #include +#if PATH_MAX >= 1024 +#define VFS_BUFSIZE PATH_MAX +#else +#define VFS_BUFSIZE 1024 +#endif + namespace dmlite { @@ -121,7 +127,7 @@ namespace dmlite { bool allowCurrent, allowWriteCurrent; std::string clientName; - char buffer[PATH_MAX > 1024 ? PATH_MAX : 1024], xattrValue[1024]; + char buffer[VFS_BUFSIZE], xattrValue[1024]; }; }; -- 1.8.2.3