summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
authorobscurestar <none@none>2014-01-26 02:56:23 -0800
committerobscurestar <none@none>2014-01-26 02:56:23 -0800
commit262f8b84737587fd5c2de38c34ff7a5594cca174 (patch)
treef29dde4cf5ad996bcacb0b16b5852bba02704daa /indra/llcommon
parent33b0ae6ebf8a085a8795a9e5b02455fb7ebf0e6f (diff)
Was not using correct name for results of file search.
Diffstat (limited to 'indra/llcommon')
-rwxr-xr-xindra/llcommon/llapp.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp
index 7ef4e7fb92..2c5da5d2a7 100755
--- a/indra/llcommon/llapp.cpp
+++ b/indra/llcommon/llapp.cpp
@@ -900,21 +900,26 @@ bool unix_minidump_callback(const google_breakpad::MinidumpDescriptor& minidump_
// heap allocations in a crash handler.
// path format: <dump_dir>/<minidump_id>.dmp
- int dirPathLength = strlen(minidump_desc.path());
+
+ //HACK: *path points to the buffer in getMiniDumpFilename which has already allocated space
+ //to avoid doing allocation during crash.
+ char * path = LLApp::instance()->getMiniDumpFilename();
+ int dir_path_len = strlen(path);
// The path must not be truncated.
- llassert((dirPathLength + 5) <= LLApp::MAX_MINDUMP_PATH_LENGTH);
+ S32 remaining = LLApp::MAX_MINDUMP_PATH_LENGTH - dir_path_len;
+
+ llassert( (remaining - strlen(minidump_desc.path())) > 5);
- char * path = LLApp::instance()->getMiniDumpFilename();
- S32 remaining = LLApp::MAX_MINDUMP_PATH_LENGTH;
- strncpy(path, minidump_desc.path(), remaining);
- remaining -= dirPathLength;
- path += dirPathLength;
- if (remaining > 0 && dirPathLength > 0 && path[-1] != '/')
+ path += dir_path_len;
+
+ if (dir_path_len > 0 && path[-1] != '/')
{
*path++ = '/';
--remaining;
}
+
+ strncpy(path, minidump_desc.path(), remaining);
llinfos << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << llendl;
LLApp::runErrorHandler();