summaryrefslogtreecommitdiff
path: root/indra/llvfs/llvfs.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2011-05-04 19:09:49 -0400
committerOz Linden <oz@lindenlab.com>2011-05-04 19:09:49 -0400
commit30cd9f7d475f67a65490774ab6d5a932c380494c (patch)
tree52a1e9e91253e401a049cfc485af10d1d14fffb4 /indra/llvfs/llvfs.cpp
parent1aee76cf57de2a206bfa464257b1af44acc3fc9c (diff)
parent032e5d30c07b77402c9f38365a5b2d424ae25271 (diff)
merge changes for storm-1141
Diffstat (limited to 'indra/llvfs/llvfs.cpp')
-rw-r--r--indra/llvfs/llvfs.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/indra/llvfs/llvfs.cpp b/indra/llvfs/llvfs.cpp
index c1fe21c57d..78b67e9b68 100644
--- a/indra/llvfs/llvfs.cpp
+++ b/indra/llvfs/llvfs.cpp
@@ -26,6 +26,8 @@
#include "linden_common.h"
+#include "llvfs.h"
+
#include <sys/stat.h>
#include <set>
#include <map>
@@ -39,8 +41,6 @@
#include <sys/file.h>
#endif
-#include "llvfs.h"
-
#include "llstl.h"
#include "lltimer.h"
@@ -1711,7 +1711,8 @@ void LLVFS::audit()
BOOL vfs_corrupt = FALSE;
- std::vector<U8> buffer(index_size);
+ // since we take the address of element 0, we need to have at least one element.
+ std::vector<U8> buffer(llmax<size_t>(index_size,1U));
if (fread(&buffer[0], 1, index_size, mIndexFP) != index_size)
{