diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 2006-12-18 22:37:46 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 2006-12-18 22:37:46 +0000 |
commit | bd01d7ec8dfde5e64d39dc248902b3e1515e9a4f (patch) | |
tree | 9b04dd5abf3662aba4066d142e5534984720d8b4 | |
parent | fbcce65f629d86558b91eb64cdac2cedc2faa794 (diff) | |
download | ATCD-bd01d7ec8dfde5e64d39dc248902b3e1515e9a4f.tar.gz |
ChangeLogTag:Mon
-rw-r--r-- | ACE/ChangeLog | 13 | ||||
-rw-r--r-- | ACE/ace/Log_Msg_NT_Event_Log.cpp | 10 | ||||
-rw-r--r-- | ACE/ace/Log_Record.h | 6 |
3 files changed, 23 insertions, 6 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog index f45b33ed582..601b1275982 100644 --- a/ACE/ChangeLog +++ b/ACE/ChangeLog @@ -1,3 +1,16 @@ +Mon Dec 18 22:28:48 UTC 2006 Douglas C. Schmidt <schmidt@dre.vanderbilt.edu> + + * ace/Log_Msg_NT_Event_Log.cpp (log): Iterate for i < + log_record.msg_data_len() rather than i < log_record.length () + to avoid nasty overrun errors. Thanks to Paxton Mason <PMason + at wolve dot com> for reporting this. + +Mon Dec 18 22:28:18 UTC 2006 Douglas C. Schmidt <schmidt@dre.vanderbilt.edu> + + * ace/Log_Record.h: Clarify the meaning of length() in the + comments. Thanks to Paxton Mason <PMason at wolve dot com> for + motivating this. + Mon Dec 18 13:48:12 UTC 2006 Johnny Willemsen <jwillemsen@remedy.nl> * ACEXML/common/common.mpc: diff --git a/ACE/ace/Log_Msg_NT_Event_Log.cpp b/ACE/ace/Log_Msg_NT_Event_Log.cpp index 8053624283c..664d7524e09 100644 --- a/ACE/ace/Log_Msg_NT_Event_Log.cpp +++ b/ACE/ace/Log_Msg_NT_Event_Log.cpp @@ -103,13 +103,15 @@ int ACE_Log_Msg_NT_Event_Log::log (ACE_Log_Record &log_record) { // Make a copy of the log text and replace any newlines with - // CR-LF. Newline characters on their own do not appear correctly - // in the event viewer. We allow for a doubling in the size of - // the msg data for the worst case of all newlines. + // CR-LF. Newline characters on their own do not appear correctly in + // the event viewer. We allow for a doubling in the size of the msg + // data for the worst case of all newlines. const ACE_TCHAR* src_msg_data = log_record.msg_data (); ACE_TCHAR msg_data [ACE_Log_Record::MAXLOGMSGLEN * 2]; - for (long i = 0, j = 0; i < log_record.length (); ++i) + for (long i = 0, j = 0; + i < log_record.msg_data_len (); + ++i) { if (src_msg_data[i] == '\n') { diff --git a/ACE/ace/Log_Record.h b/ACE/ace/Log_Record.h index 36bda6f89ac..978f2ade5ae 100644 --- a/ACE/ace/Log_Record.h +++ b/ACE/ace/Log_Record.h @@ -130,10 +130,12 @@ public: /// power of 2, as defined by the enums in <ACE_Log_Priority>). void priority (u_long num); - /// Get the length of the <Log_Record>. + /// Get the total length of the <Log_Record>, which includes the + /// size of the various data member fields. long length (void) const; - /// Set the length of the <Log_Record>. + /// Set the total length of the <Log_Record>, which needs to account for + /// the size of the various data member fields. void length (long); /// Get the time stamp of the <Log_Record>. |