<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[bug of the day: a memcmp that only compares every fourth byte]]></title><description><![CDATA[<p>bug of the day: a memcmp that only compares every fourth byte</p>]]></description><link>https://board.circlewithadot.net/topic/17c533de-cdfb-4798-8d23-5064e4d56049/bug-of-the-day-a-memcmp-that-only-compares-every-fourth-byte</link><generator>RSS for Node</generator><lastBuildDate>Thu, 16 Apr 2026 00:48:55 GMT</lastBuildDate><atom:link href="https://board.circlewithadot.net/topic/17c533de-cdfb-4798-8d23-5064e4d56049.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 30 Mar 2026 22:45:43 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to bug of the day: a memcmp that only compares every fourth byte on Tue, 31 Mar 2026 16:07:15 GMT]]></title><description><![CDATA[<p><span><a href="/user/gsuberland%40chaos.social" rel="nofollow noopener">@<span>gsuberland</span></a></span> i'm reminded of a weird bug i found in a compiler. in this case the vendor (green hills c compiler for coldfire cpus) converted a sequence like this:</p><p>```uint8_t idx;<br />idx = ;<br />char newbyte = lookup_table[idx];</p><pre><code>The code was converting upper/lowercase letters iirc.<br /><br />In this case the compiler actually converted idx to a signed value using a coldfire MVS.B instruction for some reason, so you could obtain values outside of the lookup table array if the user input a byte &gt;= 0x80.<br /><br />Not incredibly useful on its own in the app I was analyzing, but the bug was in the compiler itself so needed to be fixed...I never would have spotted the bug were it not for using Ida back in the day.<br /></code></pre>]]></description><link>https://board.circlewithadot.net/post/https://infosec.exchange/users/reverseics/statuses/116324645939941916</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://infosec.exchange/users/reverseics/statuses/116324645939941916</guid><dc:creator><![CDATA[reverseics@infosec.exchange]]></dc:creator><pubDate>Tue, 31 Mar 2026 16:07:15 GMT</pubDate></item><item><title><![CDATA[Reply to bug of the day: a memcmp that only compares every fourth byte on Tue, 31 Mar 2026 13:23:07 GMT]]></title><description><![CDATA[<p><span><a href="/user/gsuberland%40chaos.social" rel="nofollow noopener">@<span>gsuberland</span></a></span> dw, relatable</p>]]></description><link>https://board.circlewithadot.net/post/https://tech.lgbt/users/mildsunrise/statuses/116324000530459093</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://tech.lgbt/users/mildsunrise/statuses/116324000530459093</guid><dc:creator><![CDATA[mildsunrise@tech.lgbt]]></dc:creator><pubDate>Tue, 31 Mar 2026 13:23:07 GMT</pubDate></item><item><title><![CDATA[Reply to bug of the day: a memcmp that only compares every fourth byte on Tue, 31 Mar 2026 12:50:30 GMT]]></title><description><![CDATA[<p><span><a href="/user/mildsunrise%40tech.lgbt">@<span>mildsunrise</span></a></span> yeah nah I'm just tiiired</p>]]></description><link>https://board.circlewithadot.net/post/https://chaos.social/users/gsuberland/statuses/116323872296992640</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://chaos.social/users/gsuberland/statuses/116323872296992640</guid><dc:creator><![CDATA[gsuberland@chaos.social]]></dc:creator><pubDate>Tue, 31 Mar 2026 12:50:30 GMT</pubDate></item><item><title><![CDATA[Reply to bug of the day: a memcmp that only compares every fourth byte on Tue, 31 Mar 2026 12:33:54 GMT]]></title><description><![CDATA[<p><span><a href="/user/mildsunrise%40tech.lgbt">@<span>mildsunrise</span></a></span> if you wrap it in brackets and deref outside doesn't it turn into pre behaviour regardless? (now I'm writing this I'm realising it probably doesn't, but this is c++ so principle of most surprise applies lol)</p>]]></description><link>https://board.circlewithadot.net/post/https://chaos.social/users/gsuberland/statuses/116323807065203396</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://chaos.social/users/gsuberland/statuses/116323807065203396</guid><dc:creator><![CDATA[gsuberland@chaos.social]]></dc:creator><pubDate>Tue, 31 Mar 2026 12:33:54 GMT</pubDate></item><item><title><![CDATA[Reply to bug of the day: a memcmp that only compares every fourth byte on Tue, 31 Mar 2026 09:14:06 GMT]]></title><description><![CDATA[<p><span><a href="/user/gsuberland%40chaos.social" rel="nofollow noopener">@<span>gsuberland</span></a></span> (a++) is post increment, pre increment would be (++a)</p>]]></description><link>https://board.circlewithadot.net/post/https://tech.lgbt/users/mildsunrise/statuses/116323021365495950</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://tech.lgbt/users/mildsunrise/statuses/116323021365495950</guid><dc:creator><![CDATA[mildsunrise@tech.lgbt]]></dc:creator><pubDate>Tue, 31 Mar 2026 09:14:06 GMT</pubDate></item><item><title><![CDATA[Reply to bug of the day: a memcmp that only compares every fourth byte on Tue, 31 Mar 2026 03:48:53 GMT]]></title><description><![CDATA[<p><span><a href="/user/mildsunrise%40tech.lgbt">@<span>mildsunrise</span></a></span> but yeah it should be *a ^ *b and then separately incrementing</p>]]></description><link>https://board.circlewithadot.net/post/https://chaos.social/users/gsuberland/statuses/116321742563123809</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://chaos.social/users/gsuberland/statuses/116321742563123809</guid><dc:creator><![CDATA[gsuberland@chaos.social]]></dc:creator><pubDate>Tue, 31 Mar 2026 03:48:53 GMT</pubDate></item><item><title><![CDATA[Reply to bug of the day: a memcmp that only compares every fourth byte on Tue, 31 Mar 2026 03:48:00 GMT]]></title><description><![CDATA[<p><span><a href="/user/mildsunrise%40tech.lgbt">@<span>mildsunrise</span></a></span> wait no, cos (a++) would be equivalent to pre-increment</p>]]></description><link>https://board.circlewithadot.net/post/https://chaos.social/users/gsuberland/statuses/116321739139437217</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://chaos.social/users/gsuberland/statuses/116321739139437217</guid><dc:creator><![CDATA[gsuberland@chaos.social]]></dc:creator><pubDate>Tue, 31 Mar 2026 03:48:00 GMT</pubDate></item><item><title><![CDATA[Reply to bug of the day: a memcmp that only compares every fourth byte on Tue, 31 Mar 2026 03:47:16 GMT]]></title><description><![CDATA[<p><span><a href="/user/mildsunrise%40tech.lgbt">@<span>mildsunrise</span></a></span> probably yeah I'm tired lol</p>]]></description><link>https://board.circlewithadot.net/post/https://chaos.social/users/gsuberland/statuses/116321736247302168</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://chaos.social/users/gsuberland/statuses/116321736247302168</guid><dc:creator><![CDATA[gsuberland@chaos.social]]></dc:creator><pubDate>Tue, 31 Mar 2026 03:47:16 GMT</pubDate></item><item><title><![CDATA[Reply to bug of the day: a memcmp that only compares every fourth byte on Tue, 31 Mar 2026 02:52:50 GMT]]></title><description><![CDATA[<p><span><a href="/user/gsuberland%40chaos.social" rel="nofollow noopener">@<span>gsuberland</span></a></span> unrelated but shouldn't it be something like <code>*(a++) ^ *(b++)</code>?</p>]]></description><link>https://board.circlewithadot.net/post/https://tech.lgbt/users/mildsunrise/statuses/116321522206175476</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://tech.lgbt/users/mildsunrise/statuses/116321522206175476</guid><dc:creator><![CDATA[mildsunrise@tech.lgbt]]></dc:creator><pubDate>Tue, 31 Mar 2026 02:52:50 GMT</pubDate></item><item><title><![CDATA[Reply to bug of the day: a memcmp that only compares every fourth byte on Tue, 31 Mar 2026 01:41:31 GMT]]></title><description><![CDATA[<p>i blogged about the memcmp thing</p><p><div class="card col-md-9 col-lg-6 position-relative link-preview p-0">

<div class="card-body">
<h5 class="card-title">
<a href="https://blog.poly.nomial.co.uk/2026-03-31-watch-out-for-missed-warnings-on-vendor-cpp-toolchains.html">
Watch out for missed warnings on vendor C++ toolchains - Graham Sutherland's Blog
</a>
</h5>
<p class="card-text line-clamp-3"></p>
</div>
<a href="https://blog.poly.nomial.co.uk/2026-03-31-watch-out-for-missed-warnings-on-vendor-cpp-toolchains.html" class="card-footer text-body-secondary small d-flex gap-2 align-items-center lh-2">



<img src="https://blog.poly.nomial.co.uk/favicon.ico" alt="favicon" class="not-responsive overflow-hiddden" style="max-width: 21px; max-height: 21px;" />



<p class="d-inline-block text-truncate mb-0"> <span class="text-secondary">(blog.poly.nomial.co.uk)</span></p>
</a>
</div></p>]]></description><link>https://board.circlewithadot.net/post/https://chaos.social/users/gsuberland/statuses/116321241765135830</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://chaos.social/users/gsuberland/statuses/116321241765135830</guid><dc:creator><![CDATA[gsuberland@chaos.social]]></dc:creator><pubDate>Tue, 31 Mar 2026 01:41:31 GMT</pubDate></item><item><title><![CDATA[Reply to bug of the day: a memcmp that only compares every fourth byte on Mon, 30 Mar 2026 22:55:04 GMT]]></title><description><![CDATA[<p><span><a href="https://app.wafrn.net/fediverse/blog/marzhall">@<span>marzhall</span></a></span> <span><a href="/user/dysfun%40social.treehouse.systems">@<span>dysfun</span></a></span> 32-bit, but yes</p>]]></description><link>https://board.circlewithadot.net/post/https://chaos.social/users/gsuberland/statuses/116320587246834900</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://chaos.social/users/gsuberland/statuses/116320587246834900</guid><dc:creator><![CDATA[gsuberland@chaos.social]]></dc:creator><pubDate>Mon, 30 Mar 2026 22:55:04 GMT</pubDate></item><item><title><![CDATA[Reply to bug of the day: a memcmp that only compares every fourth byte on Mon, 30 Mar 2026 22:53:51 GMT]]></title><description><![CDATA[<p><span><a href="/user/gsuberland%40chaos.social" rel="nofollow noopener">@<span>gsuberland</span></a></span> yeah it lucked out by not having bit rotted yet</p>]]></description><link>https://board.circlewithadot.net/post/https://social.treehouse.systems/users/dysfun/statuses/116320582499676159</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://social.treehouse.systems/users/dysfun/statuses/116320582499676159</guid><dc:creator><![CDATA[dysfun@social.treehouse.systems]]></dc:creator><pubDate>Mon, 30 Mar 2026 22:53:51 GMT</pubDate></item><item><title><![CDATA[Reply to bug of the day: a memcmp that only compares every fourth byte on Mon, 30 Mar 2026 22:52:46 GMT]]></title><description><![CDATA[<p><span><a href="/user/dysfun%40social.treehouse.systems">@<span>dysfun</span></a></span> ehehehe</p><p>the code in question lucked out by never actually using it in a path that matters, but it's in a core lib for something security sensitive so easily could've ended up being bad</p>]]></description><link>https://board.circlewithadot.net/post/https://chaos.social/users/gsuberland/statuses/116320578236978591</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://chaos.social/users/gsuberland/statuses/116320578236978591</guid><dc:creator><![CDATA[gsuberland@chaos.social]]></dc:creator><pubDate>Mon, 30 Mar 2026 22:52:46 GMT</pubDate></item><item><title><![CDATA[Reply to bug of the day: a memcmp that only compares every fourth byte on Mon, 30 Mar 2026 22:52:30 GMT]]></title><description><![CDATA[<p><span><a href="/user/gsuberland%40chaos.social">@<span>gsuberland</span></a></span> <br />It's not named allmemcmp for a reason.</p>]]></description><link>https://board.circlewithadot.net/post/https://fosstodon.org/users/jannem/statuses/116320577154280261</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://fosstodon.org/users/jannem/statuses/116320577154280261</guid><dc:creator><![CDATA[jannem@fosstodon.org]]></dc:creator><pubDate>Mon, 30 Mar 2026 22:52:30 GMT</pubDate></item><item><title><![CDATA[Reply to bug of the day: a memcmp that only compares every fourth byte on Mon, 30 Mar 2026 22:51:56 GMT]]></title><description><![CDATA[<p><span><a href="/user/gsuberland%40chaos.social">@<span>gsuberland</span></a></span> <span><a href="/user/dysfun%40social.treehouse.systems">@<span>dysfun</span></a></span> lmao</p>]]></description><link>https://board.circlewithadot.net/post/https://social.treehouse.systems/users/astraleureka/statuses/116320574936513714</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://social.treehouse.systems/users/astraleureka/statuses/116320574936513714</guid><dc:creator><![CDATA[astraleureka@social.treehouse.systems]]></dc:creator><pubDate>Mon, 30 Mar 2026 22:51:56 GMT</pubDate></item><item><title><![CDATA[Reply to bug of the day: a memcmp that only compares every fourth byte on Mon, 30 Mar 2026 22:51:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gsuberland%40chaos.social" aria-label="Profile: gsuberland@chaos.social">@<bdi>gsuberland@chaos.social</bdi></a> ....the famous wii trucha bug is probably because broadon didn't understand the difference between strncmp and memcmp, in their own libc they do the same thing</p>
]]></description><link>https://board.circlewithadot.net/post/https://60228.dev/users/leo/statuses/116320574572429523</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://60228.dev/users/leo/statuses/116320574572429523</guid><dc:creator><![CDATA[leo@60228.dev]]></dc:creator><pubDate>Mon, 30 Mar 2026 22:51:51 GMT</pubDate></item><item><title><![CDATA[Reply to bug of the day: a memcmp that only compares every fourth byte on Mon, 30 Mar 2026 22:51:42 GMT]]></title><description><![CDATA[<p><span><a href="/user/dysfun%40social.treehouse.systems" rel="nofollow noopener">@<span>dysfun@social.treehouse.systems</span></a></span> <span><a href="/user/gsuberland%40chaos.social" rel="nofollow noopener">@<span>gsuberland@chaos.social</span></a></span></p><p>Hmm… is the issue casting 64-bit memory to an 8-bit char?</p>]]></description><link>https://board.circlewithadot.net/post/https://app.wafrn.net/fediverse/post/5d3b12f9-5eca-4031-a46a-c2a119ab8fdb</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://app.wafrn.net/fediverse/post/5d3b12f9-5eca-4031-a46a-c2a119ab8fdb</guid><dc:creator><![CDATA[marzhall@app.wafrn.net]]></dc:creator><pubDate>Mon, 30 Mar 2026 22:51:42 GMT</pubDate></item><item><title><![CDATA[Reply to bug of the day: a memcmp that only compares every fourth byte on Mon, 30 Mar 2026 22:51:33 GMT]]></title><description><![CDATA[<p><span><a href="/user/gsuberland%40chaos.social">@<span>gsuberland</span></a></span> my bad. I misheard directions, and used AL when what the boss really wanted was AI.</p>]]></description><link>https://board.circlewithadot.net/post/https://mastodon.social/users/rotopenguin/statuses/116320573427203761</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://mastodon.social/users/rotopenguin/statuses/116320573427203761</guid><dc:creator><![CDATA[rotopenguin@mastodon.social]]></dc:creator><pubDate>Mon, 30 Mar 2026 22:51:33 GMT</pubDate></item><item><title><![CDATA[Reply to bug of the day: a memcmp that only compares every fourth byte on Mon, 30 Mar 2026 22:51:17 GMT]]></title><description><![CDATA[<p><span><a href="/user/gsuberland%40chaos.social" rel="nofollow noopener">@<span>gsuberland</span></a></span> yes, that's exactly what i thought</p>]]></description><link>https://board.circlewithadot.net/post/https://social.treehouse.systems/users/dysfun/statuses/116320572383686621</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://social.treehouse.systems/users/dysfun/statuses/116320572383686621</guid><dc:creator><![CDATA[dysfun@social.treehouse.systems]]></dc:creator><pubDate>Mon, 30 Mar 2026 22:51:17 GMT</pubDate></item><item><title><![CDATA[Reply to bug of the day: a memcmp that only compares every fourth byte on Mon, 30 Mar 2026 22:51:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gsuberland%40chaos.social" aria-label="Profile: gsuberland@chaos.social">@<bdi>gsuberland@chaos.social</bdi></a> what about an strncmp that doesn't stop at a null terminator</p>
]]></description><link>https://board.circlewithadot.net/post/https://60228.dev/users/leo/statuses/116320572090966448</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://60228.dev/users/leo/statuses/116320572090966448</guid><dc:creator><![CDATA[leo@60228.dev]]></dc:creator><pubDate>Mon, 30 Mar 2026 22:51:13 GMT</pubDate></item><item><title><![CDATA[Reply to bug of the day: a memcmp that only compares every fourth byte on Mon, 30 Mar 2026 22:50:40 GMT]]></title><description><![CDATA[<p><span><a href="/user/dysfun%40social.treehouse.systems">@<span>dysfun</span></a></span> essentially this:</p><p>int memcmp32(uint32_t* a, uint32_t* b, int words)<br />{<br />  uint8_t sum = 0; // whoops<br />  while(words--) {<br />    sum |= *a++ ^ *b++;<br />  }<br />  return sum;<br />}</p>]]></description><link>https://board.circlewithadot.net/post/https://chaos.social/users/gsuberland/statuses/116320569959585018</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://chaos.social/users/gsuberland/statuses/116320569959585018</guid><dc:creator><![CDATA[gsuberland@chaos.social]]></dc:creator><pubDate>Mon, 30 Mar 2026 22:50:40 GMT</pubDate></item><item><title><![CDATA[Reply to bug of the day: a memcmp that only compares every fourth byte on Mon, 30 Mar 2026 22:49:00 GMT]]></title><description><![CDATA[<p><span><a href="/user/gsuberland%40chaos.social">@<span>gsuberland</span></a></span></p>

<div class="row mt-3"><div class="col-12 mt-3"><div class="ratio ratio-16x9">
<video controls width="228" height="276">
<source src="https://media.hachyderm.io/media_attachments/files/116/320/563/155/261/401/original/a76519d78785a029.mp4" type="video/mp4"></source>
</video>
</div></div></div>]]></description><link>https://board.circlewithadot.net/post/https://hachyderm.io/users/petrillic/statuses/116320563421779164</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://hachyderm.io/users/petrillic/statuses/116320563421779164</guid><dc:creator><![CDATA[petrillic@hachyderm.io]]></dc:creator><pubDate>Mon, 30 Mar 2026 22:49:00 GMT</pubDate></item><item><title><![CDATA[Reply to bug of the day: a memcmp that only compares every fourth byte on Mon, 30 Mar 2026 22:46:38 GMT]]></title><description><![CDATA[<p><span><a href="/user/dysfun%40social.treehouse.systems">@<span>dysfun</span></a></span> it's a constant time implementation if that helps</p>]]></description><link>https://board.circlewithadot.net/post/https://chaos.social/users/gsuberland/statuses/116320554063310051</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://chaos.social/users/gsuberland/statuses/116320554063310051</guid><dc:creator><![CDATA[gsuberland@chaos.social]]></dc:creator><pubDate>Mon, 30 Mar 2026 22:46:38 GMT</pubDate></item><item><title><![CDATA[Reply to bug of the day: a memcmp that only compares every fourth byte on Mon, 30 Mar 2026 22:46:21 GMT]]></title><description><![CDATA[<p><span><a href="/user/gsuberland%40chaos.social" rel="nofollow noopener">@<span>gsuberland</span></a></span> is it doing what i think it's doing?</p>]]></description><link>https://board.circlewithadot.net/post/https://social.treehouse.systems/users/dysfun/statuses/116320552967578328</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://social.treehouse.systems/users/dysfun/statuses/116320552967578328</guid><dc:creator><![CDATA[dysfun@social.treehouse.systems]]></dc:creator><pubDate>Mon, 30 Mar 2026 22:46:21 GMT</pubDate></item></channel></rss>