WebCore:
Fix <rdar://
5569268> Crash when opening any FTP site in second tab/window
Reviewed by Sam.
No test possible.
* platform/win/SharedBufferWin.cpp:
(WebCore::SharedBuffer::createWithContentsOfFile): Bail if we get an
empty path, because _wfopen_s will crash if we pass it a null pointer.
WebKit/win:
Fix <rdar://
5569268> Crash when opening any FTP site in second tab/window
Reviewed by Sam.
* WebView.cpp:
(WebView::initWithFrame): Set the ftpDirectoryTemplatePath for every
Page, not just the first one.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27583
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-11-07 Adam Roben <aroben@apple.com>
+
+ Fix <rdar://5569268> Crash when opening any FTP site in second tab/window
+
+ Reviewed by Sam.
+
+ No test possible.
+
+ * platform/win/SharedBufferWin.cpp:
+ (WebCore::SharedBuffer::createWithContentsOfFile): Bail if we get an
+ empty path, because _wfopen_s will crash if we pass it a null pointer.
+
2007-11-07 David Kilzer <ddkilzer@apple.com>
WebKit confuses width/height for Media Queries device-aspect-ratio evaluation
\r
PassRefPtr<SharedBuffer> SharedBuffer::createWithContentsOfFile(const String& filePath)
{
+ if (filePath.isEmpty())
+ return 0;
+
String nullifiedPath = filePath;
FILE* fileDescriptor = 0;
if (_wfopen_s(&fileDescriptor, nullifiedPath.charactersWithNullTermination(), TEXT("r+b")) || !fileDescriptor) {
+2007-11-07 Adam Roben <aroben@apple.com>
+
+ Fix <rdar://5569268> Crash when opening any FTP site in second tab/window
+
+ Reviewed by Sam.
+
+ * WebView.cpp:
+ (WebView::initWithFrame): Set the ftpDirectoryTemplatePath for every
+ Page, not just the first one.
+
2007-11-06 Adam Roben <aroben@apple.com>
Change WebLocalizableStrings to take UTF-8 C strings
// in FrameLoader::provisionalLoadStarted() doesn't always fail
m_page->settings()->setUsesPageCache(false);
- // Try to set the FTP Directory template path in WebCore when the first WebView is initialized
- static bool setFTPDirectoryTemplatePathOnce = false;
-
- if (!setFTPDirectoryTemplatePathOnce && m_uiDelegate) {
+ if (m_uiDelegate) {
COMPtr<IWebUIDelegate2> uiDelegate2;
if (SUCCEEDED(m_uiDelegate->QueryInterface(IID_IWebUIDelegate2, (void**)&uiDelegate2))) {
BSTR path;
if (SUCCEEDED(uiDelegate2->ftpDirectoryTemplatePath(this, &path))) {
m_page->settings()->setFTPDirectoryTemplatePath(String(path, SysStringLen(path)));
SysFreeString(path);
- setFTPDirectoryTemplatePathOnce = true;
}
}
}