summaryrefslogtreecommitdiff
path: root/indra/llvfs
diff options
context:
space:
mode:
authorDave SIMmONs <simon@lindenlab.com>2011-05-12 13:42:51 -0700
committerDave SIMmONs <simon@lindenlab.com>2011-05-12 13:42:51 -0700
commit00c5628074dff2a687d737bc30e9dbe2a1ccfbf8 (patch)
treead6819435b956dee23c6463d69fe26caa89d912d /indra/llvfs
parent11f988cd09daa8f33a21b7f82201e4b59e8a04ad (diff)
parent6fcf9e4817a5c245f7779dd030b0ba75dab10e5e (diff)
Merge lindenlab/viewer-development
Diffstat (limited to 'indra/llvfs')
-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)
{