summaryrefslogtreecommitdiff
path: root/src/os/LFNIndex.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/os/LFNIndex.cc')
-rw-r--r--src/os/LFNIndex.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/os/LFNIndex.cc b/src/os/LFNIndex.cc
index 09d0f02267f..029e8ad8197 100644
--- a/src/os/LFNIndex.cc
+++ b/src/os/LFNIndex.cc
@@ -378,7 +378,7 @@ int LFNIndex::list_objects(const vector<string> &to_list, int max_objs,
long *handle, map<string, hobject_t> *out) {
string to_list_path = get_full_path_subdir(to_list);
DIR *dir = ::opendir(to_list_path.c_str());
- char buf[PATH_MAX];
+ char buf[offsetof(struct dirent, d_name) + PATH_MAX + 1];
int r;
if (!dir) {
return -errno;
@@ -438,7 +438,7 @@ int LFNIndex::list_subdirs(const vector<string> &to_list,
set<string> *out) {
string to_list_path = get_full_path_subdir(to_list);
DIR *dir = ::opendir(to_list_path.c_str());
- char buf[PATH_MAX];
+ char buf[offsetof(struct dirent, d_name) + PATH_MAX + 1];
if (!dir)
return -errno;