aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/mac_crash_logger/mac_crash_logger.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:50 -0500
committerJacek Antonelli2008-08-15 23:44:50 -0500
commit89fe5dab825a62a0e3fd8d248cbc91c65eb2a426 (patch)
treebcff14b7888d04a2fec799c59369f6095224bd08 /linden/indra/mac_crash_logger/mac_crash_logger.cpp
parentSecond Life viewer sources 1.13.3.2 (diff)
downloadmeta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.zip
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.gz
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.bz2
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.xz
Second Life viewer sources 1.14.0.0
Diffstat (limited to 'linden/indra/mac_crash_logger/mac_crash_logger.cpp')
-rw-r--r--linden/indra/mac_crash_logger/mac_crash_logger.cpp27
1 files changed, 18 insertions, 9 deletions
diff --git a/linden/indra/mac_crash_logger/mac_crash_logger.cpp b/linden/indra/mac_crash_logger/mac_crash_logger.cpp
index 372050d..4af95fe 100644
--- a/linden/indra/mac_crash_logger/mac_crash_logger.cpp
+++ b/linden/indra/mac_crash_logger/mac_crash_logger.cpp
@@ -100,7 +100,7 @@ OSStatus dialogHandler(EventHandlerCallRef handler, EventRef event, void *userda
100 { 100 {
101 case kHICommandOK: 101 case kHICommandOK:
102 { 102 {
103 char buffer[65535]; 103 char buffer[65535]; /* Flawfinder: ignore */
104 Size size = sizeof(buffer) - 1; 104 Size size = sizeof(buffer) - 1;
105 ControlRef textField = NULL; 105 ControlRef textField = NULL;
106 ControlID id; 106 ControlID id;
@@ -334,9 +334,9 @@ int main(int argc, char **argv)
334 // *NOTE: changing the size of either of these buffers will 334 // *NOTE: changing the size of either of these buffers will
335 // require changing the sscanf() format string to correctly 335 // require changing the sscanf() format string to correctly
336 // account for it. 336 // account for it.
337 char tmp_sl_name[LL_MAX_PATH]; 337 char tmp_sl_name[LL_MAX_PATH]; /* Flawfinder: ignore */
338 tmp_sl_name[0] = '\0'; 338 tmp_sl_name[0] = '\0';
339 char tmp_space[MAX_STRING]; 339 char tmp_space[MAX_STRING]; /* Flawfinder: ignore */
340 tmp_space[0] = '\0'; 340 tmp_space[0] = '\0';
341 341
342 // Look for it in the debug_info.log file 342 // Look for it in the debug_info.log file
@@ -395,7 +395,7 @@ int main(int argc, char **argv)
395 // MBW -- This needs to go find "~/Library/Logs/CrashReporter/Second Life.crash.log" on 10.3 395 // MBW -- This needs to go find "~/Library/Logs/CrashReporter/Second Life.crash.log" on 10.3
396 // or "~/Library/Logs/Second Life.crash.log" on 10.2. 396 // or "~/Library/Logs/Second Life.crash.log" on 10.2.
397 { 397 {
398 char path[MAX_PATH]; 398 char path[MAX_PATH]; /* Flawfinder: ignore */
399 FSRef folder; 399 FSRef folder;
400 400
401 if(FSFindFolder(kUserDomain, kLogsFolderType, false, &folder) == noErr) 401 if(FSFindFolder(kUserDomain, kLogsFolderType, false, &folder) == noErr)
@@ -596,7 +596,7 @@ LLFileEncoder::LLFileEncoder(const char *form_name, const char *filename, bool i
596 } 596 }
597 597
598 S32 buf_size = stat_data.st_size; 598 S32 buf_size = stat_data.st_size;
599 FILE *fp = fopen(mFilename.c_str(), "rb"); 599 FILE* fp = fopen(mFilename.c_str(), "rb"); /* Flawfinder: ignore */
600 U8 *buf = new U8[buf_size + 1]; 600 U8 *buf = new U8[buf_size + 1];
601 fread(buf, 1, buf_size, fp); 601 fread(buf, 1, buf_size, fp);
602 fclose(fp); 602 fclose(fp);
@@ -617,7 +617,7 @@ LLFileEncoder::LLFileEncoder(const char *form_name, const char *filename, bool i
617 while(temp != NULL) 617 while(temp != NULL)
618 { 618 {
619 // Skip past the marker we just found 619 // Skip past the marker we just found
620 cur = temp + strlen(sep); 620 cur = temp + strlen(sep); /* Flawfinder: ignore */
621 621
622 // and try to find another 622 // and try to find another
623 temp = strstr(cur, sep); 623 temp = strstr(cur, sep);
@@ -657,11 +657,15 @@ LLString LLFileEncoder::encodeURL(const S32 max_length)
657 S32 buf_size = mBuf.size(); 657 S32 buf_size = mBuf.size();
658 S32 url_buf_size = 3*mBuf.size() + 1; 658 S32 url_buf_size = 3*mBuf.size() + 1;
659 char *url_buf = new char[url_buf_size]; 659 char *url_buf = new char[url_buf_size];
660 660 if (url_buf == NULL)
661 {
662 llerrs << "Memory Allocation Failed" << llendl;
663 return result;
664 }
661 S32 cur_pos = 0; 665 S32 cur_pos = 0;
662 for (; i < buf_size; i++) 666 for (; i < buf_size; i++)
663 { 667 {
664 sprintf(url_buf + cur_pos, "%%%02x", mBuf[i]); 668 sprintf(url_buf + cur_pos, "%%%02x", mBuf[i]); /* Flawfinder: ignore */
665 cur_pos += 3; 669 cur_pos += 3;
666 } 670 }
667 url_buf[i*3] = 0; 671 url_buf[i*3] = 0;
@@ -680,12 +684,17 @@ LLString encode_string(const char *formname, const LLString &str)
680 S32 buf_size = str.size(); 684 S32 buf_size = str.size();
681 S32 url_buf_size = 3*str.size() + 1; 685 S32 url_buf_size = 3*str.size() + 1;
682 char *url_buf = new char[url_buf_size]; 686 char *url_buf = new char[url_buf_size];
687 if (url_buf == NULL)
688 {
689 llerrs << "Memory Allocation Failed" << llendl;
690 return result;
691 }
683 692
684 S32 cur_pos = 0; 693 S32 cur_pos = 0;
685 S32 i; 694 S32 i;
686 for (i = 0; i < buf_size; i++) 695 for (i = 0; i < buf_size; i++)
687 { 696 {
688 sprintf(url_buf + cur_pos, "%%%02x", str[i]); 697 sprintf(url_buf + cur_pos, "%%%02x", str[i]); /* Flawfinder: ignore */
689 cur_pos += 3; 698 cur_pos += 3;
690 } 699 }
691 url_buf[i*3] = 0; 700 url_buf[i*3] = 0;