<div>the explanations for the bug fix look really strange</div>
<div>all the printf use %4.4s form, which will limit output to only 4 chars, whatever the string is terminated or not</div>
<div>so the crash doesn&#39;t come from here</div>
<div>looking quickly at the patch, several remark arise</div>
<div>- in the second &amp; third modification to the TRACE call, are you sure the test to srcType is relevant (I don&#39;t have the code handy, but it may be a wrong cut &amp; paste)</div>
<div>- more importantly, as the %4.4s form implies a 4 char strings, the strings used in case of NULL value must be 4 characters long, instead we may get into trouble<br></div>
<div>A+<br></div>
<div class="gmail_quote">2010/7/18 Tim Cadogan-Cowper <span dir="ltr">&lt;<a href="mailto:tccowper@yahoo.com.au">tccowper@yahoo.com.au</a>&gt;</span><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Three TRACE debug calls in the mmioDescend function of mmio.c attempt<br>to print FOURCC data, by directly casting it to LPCSTR. �This is<br>
dangerous as: (i) FOURCC data types are DWORDs, i.e. four bytes (one for<br>each char), with no null terminating byte (see<br><a href="http://msdn.microsoft.com/en-us/library/dd375802%28VS.85%29.aspx" target="_blank">http://msdn.microsoft.com/en-us/library/dd375802%28VS.85%29.aspx</a>); and<br>
(ii) it assumes the byte order on the host architecture is little �endian.<br><br>Because the LPCSTR casts are not necessarily null-terminated there will<br>occasionally be buffer overflows in mmio&#39;s TRACE debug strings, with a<br>
consequent crash to desktop and debug output beginning with �&#39;wine_dbg_vprintf:<br>debugstr buffer overflow...&#39; �For a consistent and predictable case �where this<br>occurs, see Bug 10280 &quot;Oblivion: Horse Armour Crash&quot;<br>
(<a href="http://bugs.winehq.org/show_bug.cgi?id=10280" target="_blank">http://bugs.winehq.org/show_bug.cgi?id=10280</a>).<br><br>This patch fixes the problem (and any crashes caused by it) by using a<br>new internal function in mmio - mmioFOURCCToString - which converts �FOURCC<br>
data to strings that are correctly null-terminated and respect byte �order.<br>I have tested with Oblivion and can confirm it fixes Bug 10280 on my<br>machine (ubuntu 10.04). �Furthermore the patch will ensure that chunk �IDs and<br>
fourccTypes are correctly printed in the mmio debug channel (at the �moment<br>they are not).<br><font color="#888888"><br>Tim<br><br><br>� � �</font><br><br><br></blockquote></div><br><br clear="all"><br>-- <br>-- <br>Eric Pouech<br>