From feecf7c76380de3dc2056c94e935777a80199b0e Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 21 Jan 2021 18:15:02 +0100 Subject: [PATCH] added safeguard against crash in dir_hierarchy --- libretroshare/src/file_sharing/dir_hierarchy.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libretroshare/src/file_sharing/dir_hierarchy.cc b/libretroshare/src/file_sharing/dir_hierarchy.cc index 31ba93eb3..d93df1d1b 100644 --- a/libretroshare/src/file_sharing/dir_hierarchy.cc +++ b/libretroshare/src/file_sharing/dir_hierarchy.cc @@ -647,7 +647,8 @@ uint64_t InternalFileHierarchyStorage::recursUpdateCumulatedSize(const Directory uint64_t local_cumulative_size = 0; for(uint32_t i=0;i(mNodes[d.subfiles[i]])->file_size; + if(mNodes[d.subfiles[i]]) // normally not needed, but an extra-security + local_cumulative_size += static_cast(mNodes[d.subfiles[i]])->file_size; for(uint32_t i=0;i