| Index: chrome/browser/views/tab_contents/tab_contents_view_win.cc
|
| diff --git a/chrome/browser/views/tab_contents/tab_contents_view_win.cc b/chrome/browser/views/tab_contents/tab_contents_view_win.cc
|
| index 7352951aa469c1aef1daa3f2d615136ad4ee6b49..e4218df0bfee8b00b872ce2d9dd1ad455960e1f6 100644
|
| --- a/chrome/browser/views/tab_contents/tab_contents_view_win.cc
|
| +++ b/chrome/browser/views/tab_contents/tab_contents_view_win.cc
|
| @@ -153,8 +153,10 @@ void TabContentsViewWin::StartDragging(const WebDropData& drop_data,
|
| file_name = file_name.BaseName().RemoveExtension();
|
| if (file_name.value().empty()) {
|
| // Retrieve the name from the URL.
|
| - file_name = FilePath::FromWStringHack(
|
| - net::GetSuggestedFilename(drop_data.url, "", "", L""));
|
| + std::wstring fn = net::GetSuggestedFilename(drop_data.url, "", "", L"");
|
| + if ((fn.size() + drop_data.file_extension.size() + 1) > MAX_PATH)
|
| + fn = fn.substr(0, MAX_PATH - drop_data.file_extension.size() - 2);
|
| + file_name = FilePath::FromWStringHack(fn);
|
| }
|
| file_name = file_name.ReplaceExtension(drop_data.file_extension);
|
| data.SetFileContents(file_name.value(), drop_data.file_contents);
|
|
|