<?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"
	>
<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>
	<pubDate>Fri, 12 Mar 2010 03:35:23 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: BK RIos</title>
		<link>http://larholm.com/2008/09/09/long-time-no-see-hello-chrome/#comment-34786</link>
		<dc:creator>BK RIos</dc:creator>
		<pubDate>Thu, 04 Dec 2008 07:07:21 +0000</pubDate>
		<guid isPermaLink="false">http://larholm.com/?p=29#comment-34786</guid>
		<description>Swwweeet!  Thor's Back! Look out browser world!</description>
		<content:encoded><![CDATA[<p>Swwweeet!  Thor&#8217;s Back! Look out browser world!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thor Larholm</title>
		<link>http://larholm.com/2008/09/09/long-time-no-see-hello-chrome/#comment-34404</link>
		<dc:creator>Thor Larholm</dc:creator>
		<pubDate>Tue, 25 Nov 2008 14:06:03 +0000</pubDate>
		<guid isPermaLink="false">http://larholm.com/?p=29#comment-34404</guid>
		<description>Thanks Nate, I have some new vulnerabilities lying around that I might just have to post :)</description>
		<content:encoded><![CDATA[<p>Thanks Nate, I have some new vulnerabilities lying around that I might just have to post <img src='http://larholm.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nate McFeters</title>
		<link>http://larholm.com/2008/09/09/long-time-no-see-hello-chrome/#comment-34331</link>
		<dc:creator>Nate McFeters</dc:creator>
		<pubDate>Sun, 23 Nov 2008 18:14:44 +0000</pubDate>
		<guid isPermaLink="false">http://larholm.com/?p=29#comment-34331</guid>
		<description>Very interesting find Thor.  Hoping to see more posts from you soon.

-Nate</description>
		<content:encoded><![CDATA[<p>Very interesting find Thor.  Hoping to see more posts from you soon.</p>
<p>-Nate</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wes</title>
		<link>http://larholm.com/2008/09/09/long-time-no-see-hello-chrome/#comment-32258</link>
		<dc:creator>Wes</dc:creator>
		<pubDate>Tue, 14 Oct 2008 01:28:41 +0000</pubDate>
		<guid isPermaLink="false">http://larholm.com/?p=29#comment-32258</guid>
		<description>I diff'ed the file file_util_win.cc from prior to the code fix to better understand.  Trying to learn the code to start patch work.  Great catch.</description>
		<content:encoded><![CDATA[<p>I diff&#8217;ed the file file_util_win.cc from prior to the code fix to better understand.  Trying to learn the code to start patch work.  Great catch.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mxatone</title>
		<link>http://larholm.com/2008/09/09/long-time-no-see-hello-chrome/#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&#38;r2=1765&#38;pathrev=1766

The code was :

// Initially populated by the file component of 'suggested_name', 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 "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.".
static const size_t kMaxFilenameSize = MAX_PATH + 1;

// Initially populated by the file component of 'suggested_name', 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-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'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-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't see a buffer overflow in that function.  GetFullPathName won'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'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'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>
