summaryrefslogtreecommitdiff
path: root/indra/llvfs
diff options
context:
space:
mode:
authorbrad kittenbrink <brad@lindenlab.com>2011-04-26 14:58:58 -0700
committerbrad kittenbrink <brad@lindenlab.com>2011-04-26 14:58:58 -0700
commit4bc90f24b3ced350ed44ca782f876af19af83c41 (patch)
tree8de69c03c3f24d00f1b353ad5b05a80a5973a187 /indra/llvfs
parentb87cb90a55ed74d51587eec581fb57e29f510c41 (diff)
FIX VWR-25608 error on shutdow due to buffer overflow in LLVFS::audit
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..82166d3e56 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(index_size,1U));
if (fread(&buffer[0], 1, index_size, mIndexFP) != index_size)
{