Hi,<br><br>It was only to make sure we don&#39;t overread the array, and because of the valgrind message.<br><br>Sorry<br><br><div class="gmail_quote">Le 2 avril 2012 15:04, Lubos Lunak <span dir="ltr">&lt;<a href="mailto:l.lunak@suse.cz">l.lunak@suse.cz</a>&gt;</span> a écrit :<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Saturday 31 of March 2012, Arnaud Versini wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; This patch prevent and fix memory issue in SwWW8ImplReader.<br>
<br>
</div> Did you base your patch just on your valgrind findings, or do you have also<br>
some other base for these changes, such as something in the .doc spec?<br>
<br>
 You are right that reading of some of the sprm&#39;s is broken, but looking at<br>
the first problem with the test document in Read_UL(), it is called with nId<br>
= 0x246D, which is sprmPFContextualSpacing, and the .doc spec for that one<br>
says it&#39;s 1 byte, while e.g. nId = 0xA413, sprmPDyaBefore, is 2 bytes<br>
according to the spec. So as far as I understand it, somebody was a bit lazy<br>
and lumped together two slightly different things, which should otherwise be<br>
read differently, and the proper fix would be to always read the exact size<br>
depending on the nId. On the other hand, looking at the end of<br>
WW8AttributeOutput::FormatULSpace(), we apparently do write<br>
sprmPFContextualSpacing as 2 bytes, which seems wrong.<br>
<br>
 So could you please explain why you decided to fix the problem this way?<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
 Lubos Lunak<br>
 <a href="mailto:l.lunak@suse.cz">l.lunak@suse.cz</a><br>
_______________________________________________<br>
LibreOffice mailing list<br>
<a href="mailto:LibreOffice@lists.freedesktop.org">LibreOffice@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/libreoffice" target="_blank">http://lists.freedesktop.org/mailman/listinfo/libreoffice</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br>Arnaud Versini<br>