Fix wrong memory access.
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Mon, 25 Nov 2013 12:17:57 +0000 (13:17 +0100)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Mon, 10 Feb 2014 14:08:02 +0000 (15:08 +0100)
src/VfsNs.h

index 07610de..33f9558 100644 (file)
@@ -9,6 +9,12 @@
 #include <regex.h>
 #include <dmlite/cpp/catalog.h>
 
+#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];
   };
 
 };