diff options
Diffstat (limited to 'linden/indra/linux_crash_logger/linux_crash_logger.cpp')
-rw-r--r-- | linden/indra/linux_crash_logger/linux_crash_logger.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/linden/indra/linux_crash_logger/linux_crash_logger.cpp b/linden/indra/linux_crash_logger/linux_crash_logger.cpp index a332ccc..196ff6e 100644 --- a/linden/indra/linux_crash_logger/linux_crash_logger.cpp +++ b/linden/indra/linux_crash_logger/linux_crash_logger.cpp | |||
@@ -238,10 +238,8 @@ int main(int argc, char **argv) | |||
238 | db_filep = new LLFileEncoder("DB", db_file_name.c_str()); | 238 | db_filep = new LLFileEncoder("DB", db_file_name.c_str()); |
239 | 239 | ||
240 | // Get the filename of the SecondLife.log file | 240 | // Get the filename of the SecondLife.log file |
241 | // *TODO tofu - get right MAX_PATH. | 241 | // *NOTE: These buffer sizes are hardcoded into a scanf() below. |
242 | // *FIX: What's up with this? This #define just can't be safe. | 242 | char tmp_sl_name[LL_MAX_PATH]; |
243 | #define MAX_PATH PATH_MAX | ||
244 | char tmp_sl_name[MAX_PATH]; | ||
245 | tmp_sl_name[0] = '\0'; | 243 | tmp_sl_name[0] = '\0'; |
246 | char tmp_space[256]; | 244 | char tmp_space[256]; |
247 | tmp_space[0] = '\0'; | 245 | tmp_space[0] = '\0'; |
@@ -251,7 +249,7 @@ int main(int argc, char **argv) | |||
251 | { | 249 | { |
252 | // This was originally scanning for "SL Log: %[^\r\n]", which happily skipped to the next line | 250 | // This was originally scanning for "SL Log: %[^\r\n]", which happily skipped to the next line |
253 | // on debug logs (which don't have anything after "SL Log:" and tried to open a nonsensical filename. | 251 | // on debug logs (which don't have anything after "SL Log:" and tried to open a nonsensical filename. |
254 | sscanf(db_filep->mBuf.c_str(), "SL Log:%[ ]%[^\r\n]", tmp_space, tmp_sl_name); | 252 | sscanf(db_filep->mBuf.c_str(), "SL Log:%255[ ]%1023[^\r\n]", tmp_space, tmp_sl_name); |
255 | } | 253 | } |
256 | else | 254 | else |
257 | { | 255 | { |