summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshuai.lou <shuai.lou@greatopensource.com>2018-03-02 22:34:46 +0800
committershuai.lou <shuai.lou@greatopensource.com>2018-03-02 22:34:46 +0800
commit45df27f3869f66d895964f18a582136bb44333af (patch)
tree64758b1985be5423dbd928c6829858bc6eefb7ce
parentfe8bdb83f29f0b520a5a9be872c51d2b4f5726b2 (diff)
downloadATCD-45df27f3869f66d895964f18a582136bb44333af.tar.gz
Bugfix: ACE abort when use %l and the msg len exceed ACE_MAXLOGMSGLEN
-rw-r--r--ACE/ace/Log_Msg.cpp1
-rw-r--r--ACE/tests/Log_Msg_Test.cpp2
2 files changed, 2 insertions, 1 deletions
diff --git a/ACE/ace/Log_Msg.cpp b/ACE/ace/Log_Msg.cpp
index 09b43632575..cc5cf7107a2 100644
--- a/ACE/ace/Log_Msg.cpp
+++ b/ACE/ace/Log_Msg.cpp
@@ -1256,6 +1256,7 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str,
this->linenum ());
else
this_len = ACE_OS::sprintf (bp, format, this->linenum ());
+ ACE_UPDATE_COUNT (bspace, this_len);
break;
case 'N': // Source file name
diff --git a/ACE/tests/Log_Msg_Test.cpp b/ACE/tests/Log_Msg_Test.cpp
index 0b489116694..b0f31ddf21a 100644
--- a/ACE/tests/Log_Msg_Test.cpp
+++ b/ACE/tests/Log_Msg_Test.cpp
@@ -246,7 +246,7 @@ test_log_msg_features (const ACE_TCHAR *program)
big[index] = alphabet[i % j];
}
big[ACE_Log_Record::MAXLOGMSGLEN] = ACE_TEXT ('\0');
- ACE_DEBUG ((LM_INFO, ACE_TEXT ("This is too big: %s\n"), big));
+ ACE_DEBUG ((LM_INFO, ACE_TEXT ("This is too big:%l %s\n"), big));
ACE_HEX_DUMP((LM_INFO, (const char*)big, ACE_Log_Record::MAXLOGMSGLEN ));