<?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/"
		>
<channel>
	<title>Comments on: Long time no see, hello Chrome</title>
	<atom:link href="http://larholm.com/2008/09/09/long-time-no-see-hello-chrome/feed/" rel="self" type="application/rss+xml" />
	<link>http://larholm.com/2008/09/09/long-time-no-see-hello-chrome/</link>
	<description>Me, myself and I</description>
	<lastBuildDate>Fri, 25 Jun 2010 16:30:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: chinese translation</title>
		<link>http://larholm.com/2008/09/09/long-time-no-see-hello-chrome/comment-page-1/#comment-57575</link>
		<dc:creator>chinese translation</dc:creator>
		<pubDate>Sat, 03 Apr 2010 19:30:38 +0000</pubDate>
		<guid isPermaLink="false">http://larholm.com/?p=29#comment-57575</guid>
		<description>I like google chrome more and more each day because it makes my life a lot easier. This is simply unbelievable! This is the most reliable thing of thing we&#039;ve ever used.</description>
		<content:encoded><![CDATA[<p>I like google chrome more and more each day because it makes my life a lot easier. This is simply unbelievable! This is the most reliable thing of thing we&#8217;ve ever used.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mxatone</title>
		<link>http://larholm.com/2008/09/09/long-time-no-see-hello-chrome/comment-page-1/#comment-31210</link>
		<dc:creator>mxatone</dc:creator>
		<pubDate>Wed, 10 Sep 2008 16:25:51 +0000</pubDate>
		<guid isPermaLink="false">http://larholm.com/?p=29#comment-31210</guid>
		<description>Hum the issue is not on the snippet code you copy past.

The diff is here : http://src.chromium.org/viewvc/chrome/branches/chrome_official_branch/src/chrome/common/win_util.cc?r1=1766&amp;r2=1765&amp;pathrev=1766

The code was :

// Initially populated by the file component of &#039;suggested_name&#039;, this buffer 	 
// will be written into by Windows when the user is done with the dialog box. 	 
wchar_t file_name[MAX_PATH+1]; 	 
std::wstring file_part = file_util::GetFilenameFromPath(suggested_name); 
memcpy(file_name, file_part.c_str(), (file_part.length()+1) * sizeof(wchar_t));

and becomes:

// The size of the in/out buffer in number of characters we pass to win32
// GetSaveFileName.  From MSDN &quot;The buffer must be large enough to store the
// path and file name string or strings, including the terminating NULL
// character.  ... The buffer should be at least 256 characters long.&quot;.
static const size_t kMaxFilenameSize = MAX_PATH + 1;

// Initially populated by the file component of &#039;suggested_name&#039;, this buffer
// will be written into by Windows when the user is done with the dialog box.
std::wstring file_part = file_util::GetFilenameFromPath(suggested_name); 
wchar_t file_name[kMaxFilenameSize];
base::wclscpy(file_name, file_part.c_str(), kMaxFilenameSize);

file_part length is not trusted anymore.

It is because GetDirectoryFromPath is not restrained to a specific size. If the path is superior to MAX_PATH, GetFullPathName return the number of required chars (not 0) and then the entire string is returned.</description>
		<content:encoded><![CDATA[<p>Hum the issue is not on the snippet code you copy past.</p>
<p>The diff is here : <a href="http://src.chromium.org/viewvc/chrome/branches/chrome_official_branch/src/chrome/common/win_util.cc?r1=1766&amp;r2=1765&amp;pathrev=1766" rel="nofollow">http://src.chromium.org/viewvc/chrome/branches/chrome_official_branch/src/chrome/common/win_util.cc?r1=1766&amp;r2=1765&amp;pathrev=1766</a></p>
<p>The code was :</p>
<p>// Initially populated by the file component of &#8217;suggested_name&#8217;, this buffer<br />
// will be written into by Windows when the user is done with the dialog box.<br />
wchar_t file_name[MAX_PATH+1];<br />
std::wstring file_part = file_util::GetFilenameFromPath(suggested_name);<br />
memcpy(file_name, file_part.c_str(), (file_part.length()+1) * sizeof(wchar_t));</p>
<p>and becomes:</p>
<p>// The size of the in/out buffer in number of characters we pass to win32<br />
// GetSaveFileName.  From MSDN &#8220;The buffer must be large enough to store the<br />
// path and file name string or strings, including the terminating NULL<br />
// character.  &#8230; The buffer should be at least 256 characters long.&#8221;.<br />
static const size_t kMaxFilenameSize = MAX_PATH + 1;</p>
<p>// Initially populated by the file component of &#8217;suggested_name&#8217;, this buffer<br />
// will be written into by Windows when the user is done with the dialog box.<br />
std::wstring file_part = file_util::GetFilenameFromPath(suggested_name);<br />
wchar_t file_name[kMaxFilenameSize];<br />
base::wclscpy(file_name, file_part.c_str(), kMaxFilenameSize);</p>
<p>file_part length is not trusted anymore.</p>
<p>It is because GetDirectoryFromPath is not restrained to a specific size. If the path is superior to MAX_PATH, GetFullPathName return the number of required chars (not 0) and then the entire string is returned.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thor Larholm</title>
		<link>http://larholm.com/2008/09/09/long-time-no-see-hello-chrome/comment-page-1/#comment-31202</link>
		<dc:creator>Thor Larholm</dc:creator>
		<pubDate>Wed, 10 Sep 2008 15:04:28 +0000</pubDate>
		<guid isPermaLink="false">http://larholm.com/?p=29#comment-31202</guid>
		<description>You&#039;re not missing anything. The overflow itself is triggered in GetDirectoryFromPath when path.c_str() is called, but the actual corruption happens earlier.

Cheers
Thor</description>
		<content:encoded><![CDATA[<p>You&#8217;re not missing anything. The overflow itself is triggered in GetDirectoryFromPath when path.c_str() is called, but the actual corruption happens earlier.</p>
<p>Cheers<br />
Thor</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Harry Johnston</title>
		<link>http://larholm.com/2008/09/09/long-time-no-see-hello-chrome/comment-page-1/#comment-31174</link>
		<dc:creator>Harry Johnston</dc:creator>
		<pubDate>Tue, 09 Sep 2008 21:58:42 +0000</pubDate>
		<guid isPermaLink="false">http://larholm.com/?p=29#comment-31174</guid>
		<description>I don&#039;t see a buffer overflow in that function.  GetFullPathName won&#039;t write more than MAX_PATH characters, which is the size of the buffer.

The function fails to test the return value of GetFullPathName to see if the buffer was too small, and the documentation doesn&#039;t specify what happens to file_ptr in this case, which means that the string length might be calculated incorrectly.  However, as the string length is only passed to the wstring constructor, that can&#039;t cause a buffer overflow either.

Am I missing something?</description>
		<content:encoded><![CDATA[<p>I don&#8217;t see a buffer overflow in that function.  GetFullPathName won&#8217;t write more than MAX_PATH characters, which is the size of the buffer.</p>
<p>The function fails to test the return value of GetFullPathName to see if the buffer was too small, and the documentation doesn&#8217;t specify what happens to file_ptr in this case, which means that the string length might be calculated incorrectly.  However, as the string length is only passed to the wstring constructor, that can&#8217;t cause a buffer overflow either.</p>
<p>Am I missing something?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.173 seconds -->
<!-- Cached page served by WP-Cache -->
