[patch] fix buffer overrun in logging, and code cleanup
[patch] fix buffer overrun in logging, and code cleanup
Hello, While I was troubleshooting some user problem and trying to figure out why mylog_xxx.log is not created, I found a tiny bug. The buffers for holding the full path for MyLog and CommLog are small -- only 80 bytes. If you specify a long path for Logdir, the buffer overrun occurs. Please find the attached patch mylog_buffer_overrun.patch. The other patch mylog_cleanup.patch removes code which are unused or unnecessary anymore. I'd like to make the code as lean as possible, so that it makes code reading and searching easier and faster. This patch removes about 120 lines. Regards Takayuki Tsunakawa
Re: [patch] fix buffer overrun in logging, and code cleanup
От:
"Inoue, Hiroshi" <h-inoue@dream.email.ne.jp>
Дата:
Hi, I would examine the patch. However forcelog() exists in msdtc_enlist.cpp at first glance. regards, Hiroshi Inoue On 2016/05/26 11:40, Tsunakawa, Takayuki wrote: > Hello, > > While I was troubleshooting some user problem and trying to figure out why mylog_xxx.log is not created, I found a tiny bug. The buffers for holding the full path for MyLog and CommLog are small -- only 80 bytes. If you specify a long path for Logdir, the buffer overrun occurs. Please find the attached patch mylog_buffer_overrun.patch. > > The other patch mylog_cleanup.patch removes code which are unused or unnecessary anymore. I'd like to make the code as lean as possible, so that it makes code reading and searching easier and faster. This patch removes about 120 lines. > > Regards > Takayuki Tsunakawa
Re: [patch] fix buffer overrun in logging, and code cleanup
> From: Inoue, Hiroshi [mailto:h-inoue@dream.email.ne.jp] > However forcelog() exists in msdtc_enlist.cpp at first glance. Oh, I overlooked it. I removed the use of forcelog() there by: 1) Remove #ifdef _LOCK_DEBUG ... #endif code fragments. 2) Replace remaining forcelog() call sites with mylog(). I think mylog() should be used to allow users of the log file accumulation. Regards Takayuki Tsunakawa