From 4bc90f24b3ced350ed44ca782f876af19af83c41 Mon Sep 17 00:00:00 2001 From: brad kittenbrink Date: Tue, 26 Apr 2011 14:58:58 -0700 Subject: FIX VWR-25608 error on shutdow due to buffer overflow in LLVFS::audit --- indra/llvfs/llvfs.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'indra/llvfs') 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 #include #include @@ -39,8 +41,6 @@ #include #endif -#include "llvfs.h" - #include "llstl.h" #include "lltimer.h" @@ -1711,7 +1711,8 @@ void LLVFS::audit() BOOL vfs_corrupt = FALSE; - std::vector buffer(index_size); + // since we take the address of element 0, we need to have at least one element. + std::vector buffer(llmax(index_size,1U)); if (fread(&buffer[0], 1, index_size, mIndexFP) != index_size) { -- cgit v1.2.3 From 36986de1fc1437f509d120b79430c87575e755b1 Mon Sep 17 00:00:00 2001 From: brad kittenbrink Date: Wed, 27 Apr 2011 16:02:16 -0700 Subject: Fix for mac compile error in VWR-25608 fix. --- indra/llvfs/llvfs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llvfs') diff --git a/indra/llvfs/llvfs.cpp b/indra/llvfs/llvfs.cpp index 82166d3e56..78b67e9b68 100644 --- a/indra/llvfs/llvfs.cpp +++ b/indra/llvfs/llvfs.cpp @@ -1712,7 +1712,7 @@ void LLVFS::audit() BOOL vfs_corrupt = FALSE; // since we take the address of element 0, we need to have at least one element. - std::vector buffer(llmax(index_size,1U)); + std::vector buffer(llmax(index_size,1U)); if (fread(&buffer[0], 1, index_size, mIndexFP) != index_size) { -- cgit v1.2.3