From: František Dvořák Date: Mon, 25 Nov 2013 12:17:57 +0000 (+0100) Subject: Fix wrong memory access. X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=8bcf9a95ebe77628b137c5f4d781f87b7c1b8a84;p=dmlite-plugins-vfs.git Fix wrong memory access. --- 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]; }; };