TRACE(...., debugstr_w(uninitialised data))?
Hi, winmm/mci.c contains some code like this: TRACE("=> 1/ %x (%s)\n", dwRet, debugstr_w(lpstrRet)); However, in case of error, the lpstrRet buffer is likely not initialised. This could cause 1. debugstr_w to choke on bad/unconvertible data (not even 0-terminated); 2. Valgrind errors (I don't know whether the Valgrind warnings I observe are due to this line of code). Am I worrying too much or should any such piece of code be protected by TRACE("=> 1/ %x (%s)\n", dwRet, LOWORD(dwRet) ? "" : debugstr_w(lpstrRet)); (actually, an even more convoluted test is needed because of MCI_INTEGER_RETURNED) Or is it not worth careing about because it's within TRACE() only? I assume that debugstr_w is not executed when that channel is not traced. Correct? Regards, Jörg Höhle
Hi Joerg,
Am I worrying too much or should any such piece of code be protected by TRACE("=> 1/ %x (%s)\n", dwRet, LOWORD(dwRet) ? "" : debugstr_w(lpstrRet)); (actually, an even more convoluted test is needed because of MCI_INTEGER_RETURNED)
I'd worry about it. We've sometimes had bugs where a crash appears in a failure mode when a particular debug channel is enabled, but that debug channel is the very thing that might help us debug the failure better.
I assume that debugstr_w is not executed when that channel is not traced. Correct?
That's correct. --Juan
participants (2)
-
Joerg-Cyril.Hoehle@t-systems.com -
Juan Lang