<p>On 16/05/25 02:42, Filip Roséen wrote:</p>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;color:#500050">
<p>See <a href="http://codepad.org/gTFDYk8G">this testcase</a>, or the attached file, for a simulation of the above. Given that the expression <code>p_hmmt->i_chapter_count*4</code> might result in a value that will overflow, the if-statement itself is faulty.</p>
<h3 id="disclaimer">Disclaimer</h3>
<ul>
<li><em>I am currently insanely tired and just skimmed the patch in this thread while having a smoke, I in no way claim that I am fit for fight for reviews at this hour.</em></li>
</ul>
</blockquote>
<p>And now I just noticed that <code>testcase.c</code> (the attached file) and the linked code should of course have declared <code>i_read</code> as <code>int64_t</code> (not <code>uint64_t</code>); but it will not change the fact that the relevant expression (mentioned earlier) could overflow.</p>
<p>obviously it is time to get some sleep! :-)</p>
<p>Peace!</p>