<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Please Join me in welcoming memcpy() to the SDL Rogues Gallery</title><link>http://blogs.msdn.com/sdl/archive/2009/05/14/please-join-me-in-welcoming-memcpy-to-the-sdl-rogues-gallery.aspx</link><description>Over the last few years I have written a number of articles, papers and books describing some of the dangers of using various buffer-manipulating C runtime functions. Well-known examples of bad function calls include strcpy(), strcat(), strncpy(), strncat(),</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Please Join me in welcoming memcpy() to the SDL Rogues Gallery | Microsoft Share Point</title><link>http://blogs.msdn.com/sdl/archive/2009/05/14/please-join-me-in-welcoming-memcpy-to-the-sdl-rogues-gallery.aspx#9617229</link><pubDate>Fri, 15 May 2009 01:30:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9617229</guid><dc:creator>Please Join me in welcoming memcpy() to the SDL Rogues Gallery | Microsoft Share Point</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://microsoft-sharepoint.simplynetdev.com/please-join-me-in-welcoming-memcpy-to-the-sdl-rogues-gallery/"&gt;http://microsoft-sharepoint.simplynetdev.com/please-join-me-in-welcoming-memcpy-to-the-sdl-rogues-gallery/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: Please Join me in welcoming memcpy() to the SDL Rogues Gallery</title><link>http://blogs.msdn.com/sdl/archive/2009/05/14/please-join-me-in-welcoming-memcpy-to-the-sdl-rogues-gallery.aspx#9618080</link><pubDate>Fri, 15 May 2009 11:20:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9618080</guid><dc:creator>jmtd</dc:creator><description>&lt;p&gt;Linus is not the one who would make a decision on memcpy: it would be the maintainers of the GNU C library (&amp;quot;glibc&amp;quot;). They might well add a memcpy_s macro (undoubtably there is already a secure memcpy function in GNU libc, but with a different name) but they would almost certainly not remove or forbid access to the C standard memcpy.&lt;/p&gt;
</description></item><item><title>Microsoft Bans memcpy()</title><link>http://blogs.msdn.com/sdl/archive/2009/05/14/please-join-me-in-welcoming-memcpy-to-the-sdl-rogues-gallery.aspx#9618780</link><pubDate>Fri, 15 May 2009 18:54:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9618780</guid><dc:creator>US ISV Developer Evangelism Team</dc:creator><description>&lt;p&gt;For those writing in C, you will be interested in a posting on The Security Development Lifecycle blog&lt;/p&gt;
</description></item><item><title>Ada?</title><link>http://blogs.msdn.com/sdl/archive/2009/05/14/please-join-me-in-welcoming-memcpy-to-the-sdl-rogues-gallery.aspx#9618951</link><pubDate>Fri, 15 May 2009 20:40:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9618951</guid><dc:creator>nelsonchandler</dc:creator><description>&lt;p&gt;Are we ever going to see Microsoft Ada? It can do everything C does, but in a much safer way.&lt;/p&gt;
</description></item><item><title>re: Please Join me in welcoming memcpy() to the SDL Rogues Gallery</title><link>http://blogs.msdn.com/sdl/archive/2009/05/14/please-join-me-in-welcoming-memcpy-to-the-sdl-rogues-gallery.aspx#9620146</link><pubDate>Sat, 16 May 2009 01:53:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9620146</guid><dc:creator>t-scotmc</dc:creator><description>&lt;p&gt;Questionably useful. &amp;nbsp;If you're using C but can afford pointless checks, then you're using the wrong language. &amp;nbsp;(Well, I think that C is the wrong language on anything with a filesystem, but that's a separate issue.)&lt;/p&gt;
&lt;p&gt;Sure, this sounds good, but I'm not convinced memcpy_s will really help. &amp;nbsp;It's only checking consistency between 2 of the arguments, which means that all 4 can still be wrong. &amp;nbsp;Not something I'd call &amp;quot;secure&amp;quot;. &amp;nbsp;(At very least I'd want checks that src+srcsize &amp;lt;= dst || dst+dstsize &amp;lt;= src, but what you really to check need is that the memory ranges are valid subranges of allocated arrays, which you can't without either ruining performance or breaking code.)&lt;/p&gt;
&lt;p&gt;I wonder whether Larry, Steve and Linus will actually notice a difference in the quality of Steve (Ballmer)'s products...&lt;/p&gt;
</description></item><item><title>re: Please Join me in welcoming memcpy() to the SDL Rogues Gallery</title><link>http://blogs.msdn.com/sdl/archive/2009/05/14/please-join-me-in-welcoming-memcpy-to-the-sdl-rogues-gallery.aspx#9623175</link><pubDate>Sat, 16 May 2009 18:46:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9623175</guid><dc:creator>A.M.</dc:creator><description>&lt;p&gt;Functions like memcpy_s don't make code more secure and are poorly written and will degrade performance of your code as much as 3 times. What will be your next step - deprecate pointers?&lt;/p&gt;
&lt;p&gt;This is just a publicity stunt. Microsoft has to stop letting marketing people write code.&lt;/p&gt;
</description></item><item><title>re: Please Join me in welcoming memcpy() to the SDL Rogues Gallery</title><link>http://blogs.msdn.com/sdl/archive/2009/05/14/please-join-me-in-welcoming-memcpy-to-the-sdl-rogues-gallery.aspx#9624652</link><pubDate>Mon, 18 May 2009 04:16:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9624652</guid><dc:creator>sdl</dc:creator><description>&lt;p&gt;A.M.&lt;/p&gt;
&lt;p&gt;absolutely no-one from mktg touched the content of this article. this is a technical article, describing some real changes we're making to our dev processes. you should take a look at &lt;a rel="nofollow" target="_new" href="http://www.microsoft.com/sdl"&gt;http://www.microsoft.com/sdl&lt;/a&gt; to see it's not mktg.&lt;/p&gt;
</description></item><item><title>False sense of security!</title><link>http://blogs.msdn.com/sdl/archive/2009/05/14/please-join-me-in-welcoming-memcpy-to-the-sdl-rogues-gallery.aspx#9627686</link><pubDate>Tue, 19 May 2009 14:45:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9627686</guid><dc:creator>twonine</dc:creator><description>&lt;p&gt;I do not believe this approach – that of requiring source and target buffer lengths to be supplied as function arguments – solves the problem! It simply introduces another opportunity for error.&lt;/p&gt;
&lt;p&gt;This approach only works if the lengths supplied are correct, and I think it is easy for a programmer to get this wrong while having a false sense of security.&lt;/p&gt;
</description></item><item><title>re: Please Join me in welcoming memcpy() to the SDL Rogues Gallery</title><link>http://blogs.msdn.com/sdl/archive/2009/05/14/please-join-me-in-welcoming-memcpy-to-the-sdl-rogues-gallery.aspx#9644789</link><pubDate>Wed, 27 May 2009 21:45:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9644789</guid><dc:creator>asnowfall</dc:creator><description>&lt;p&gt;I have always used something like this...&lt;/p&gt;
&lt;p&gt;#define BUFF_SIZE 32&lt;/p&gt;
&lt;p&gt;char dst[BUFF_SIZE], src[BUFF_SIZE];&lt;/p&gt;
&lt;p&gt;memcpy(dst,src,BUFF_SIZE);&lt;/p&gt;
&lt;p&gt;First thing that I do is to assign the buffer length to a variable, and use it for both source and destination while calling malloc(), memcpy(), etc.... I follow similar descipline while using strxxx() and it has worked fine. I have tried using strxxx_S() versions found it to be redundent.&lt;/p&gt;
&lt;p&gt;Word like &amp;quot;poison&amp;quot; is uncalled for because problem is with programmer, and as you say, a poor programmer could drive even memcpy_s() to ditch :-). &amp;nbsp; &lt;/p&gt;
</description></item></channel></rss>