<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:media="http://search.yahoo.com/mrss/"
	>
<channel>
	<title>Comments on: Spot the Overflow</title>
	<atom:link href="http://www.digitalbond.com/index.php/2008/05/02/spot-the-overflow/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.digitalbond.com/index.php/2008/05/02/spot-the-overflow/</link>
	<description>This Month in Control System Security</description>
	<lastBuildDate>Fri, 30 Jul 2010 09:35:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Brad Singletary</title>
		<link>http://www.digitalbond.com/index.php/2008/05/02/spot-the-overflow/comment-page-1/#comment-9947</link>
		<dc:creator>Brad Singletary</dc:creator>
		<pubDate>Thu, 15 May 2008 20:29:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.digitalbond.com/?p=898#comment-9947</guid>
		<description>A better error for both examples is not checking that the new returns non-zero...  You can force allocation to fail momentarily on some platforms.  

Probably another if buf has no terminator.  Incidental to not understanding the intent of foo.

If you consider the platform a microcontroller, you may have other problems too... incidental to not understanding the architecture.</description>
		<content:encoded><![CDATA[<p>A better error for both examples is not checking that the new returns non-zero&#8230;  You can force allocation to fail momentarily on some platforms.  </p>
<p>Probably another if buf has no terminator.  Incidental to not understanding the intent of foo.</p>
<p>If you consider the platform a microcontroller, you may have other problems too&#8230; incidental to not understanding the architecture.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mike</title>
		<link>http://www.digitalbond.com/index.php/2008/05/02/spot-the-overflow/comment-page-1/#comment-9927</link>
		<dc:creator>mike</dc:creator>
		<pubDate>Thu, 08 May 2008 16:09:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.digitalbond.com/?p=898#comment-9927</guid>
		<description>There is an integer overflow in the &quot;new char[strlen(buf) + 1]&quot; statement and then a heap overflow in &quot;strcat(myArray, buf)&quot; after you have overflowed the malloc.</description>
		<content:encoded><![CDATA[<p>There is an integer overflow in the &#8220;new char[strlen(buf) + 1]&#8221; statement and then a heap overflow in &#8220;strcat(myArray, buf)&#8221; after you have overflowed the malloc.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: codewookie</title>
		<link>http://www.digitalbond.com/index.php/2008/05/02/spot-the-overflow/comment-page-1/#comment-9906</link>
		<dc:creator>codewookie</dc:creator>
		<pubDate>Tue, 06 May 2008 22:01:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.digitalbond.com/?p=898#comment-9906</guid>
		<description>neat.  malloc(0).</description>
		<content:encoded><![CDATA[<p>neat.  malloc(0).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin Lackey</title>
		<link>http://www.digitalbond.com/index.php/2008/05/02/spot-the-overflow/comment-page-1/#comment-9895</link>
		<dc:creator>Kevin Lackey</dc:creator>
		<pubDate>Mon, 05 May 2008 15:43:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.digitalbond.com/?p=898#comment-9895</guid>
		<description>Visitor has it right. Off by one heap error. Good description of this exploit seen at: http://www.derkeiler.com/Mailing-Lists/Securiteam/2003-06/0070.html . And yes, this is a construed example.

So let&#039;s say the programmer had been a little more careful and done the following:
&lt;code&gt;
void foo(char *buf)
{
char *myArray;

myArray = new char[strlen(buf) + 1];
memset(myArray, 0, strlen(buf) + 1);
strcat(myArray, buf);

.
.
.
//do something intersting here with the buffer
.
.
.

}

&lt;/code&gt; 
Now where is the overflow?

Kevin</description>
		<content:encoded><![CDATA[<p>Visitor has it right. Off by one heap error. Good description of this exploit seen at: <a href="http://www.derkeiler.com/Mailing-Lists/Securiteam/2003-06/0070.html" rel="nofollow">http://www.derkeiler.com/Mailing-Lists/Securiteam/2003-06/0070.html</a> . And yes, this is a construed example.</p>
<p>So let&#8217;s say the programmer had been a little more careful and done the following:<br />
<code><br />
void foo(char *buf)<br />
{<br />
char *myArray;</p>
<p>myArray = new char[strlen(buf) + 1];<br />
memset(myArray, 0, strlen(buf) + 1);<br />
strcat(myArray, buf);</p>
<p>.<br />
.<br />
.<br />
//do something intersting here with the buffer<br />
.<br />
.<br />
.</p>
<p>}</p>
<p></code><br />
Now where is the overflow?</p>
<p>Kevin</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jake Brodsky</title>
		<link>http://www.digitalbond.com/index.php/2008/05/02/spot-the-overflow/comment-page-1/#comment-9893</link>
		<dc:creator>Jake Brodsky</dc:creator>
		<pubDate>Sun, 04 May 2008 13:59:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.digitalbond.com/?p=898#comment-9893</guid>
		<description>I usually look for fencepost errors whenever manipulating strings.  Errors like this and many more are often found in that lovely book, C Traps and Pitfalls.</description>
		<content:encoded><![CDATA[<p>I usually look for fencepost errors whenever manipulating strings.  Errors like this and many more are often found in that lovely book, C Traps and Pitfalls.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: visitor</title>
		<link>http://www.digitalbond.com/index.php/2008/05/02/spot-the-overflow/comment-page-1/#comment-9886</link>
		<dc:creator>visitor</dc:creator>
		<pubDate>Fri, 02 May 2008 21:09:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.digitalbond.com/?p=898#comment-9886</guid>
		<description>strlen() doesn&#039;t include the terminating NULL character in the size returned. The buffer is too short, and strcat will always write a NULL past its end.

Hopefully this is a constructed example, because the reasonable way to do this is with strdup()!</description>
		<content:encoded><![CDATA[<p>strlen() doesn&#8217;t include the terminating NULL character in the size returned. The buffer is too short, and strcat will always write a NULL past its end.</p>
<p>Hopefully this is a constructed example, because the reasonable way to do this is with strdup()!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthew Franz</title>
		<link>http://www.digitalbond.com/index.php/2008/05/02/spot-the-overflow/comment-page-1/#comment-9885</link>
		<dc:creator>Matthew Franz</dc:creator>
		<pubDate>Fri, 02 May 2008 20:45:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.digitalbond.com/?p=898#comment-9885</guid>
		<description>TGIF for you then, right?

(Snarky &quot;SCADA Time Warp comment deleted here)</description>
		<content:encoded><![CDATA[<p>TGIF for you then, right?</p>
<p>(Snarky &#8220;SCADA Time Warp comment deleted here)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
