Network Cache: Crash in WebCore::CachedResource::tryReplaceEncodedData
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Apr 2015 16:20:21 +0000 (16:20 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Apr 2015 16:20:21 +0000 (16:20 +0000)
commit8dbee4e4740aa415970e39514cdd8f4a39994d07
tree6fb9461fe730ad91af7cf6d9e3571a1cd837ec23
parent82f8335462c0e3cda94aeb5a5cffe816bdfda86f
Network Cache: Crash in WebCore::CachedResource::tryReplaceEncodedData
https://bugs.webkit.org/show_bug.cgi?id=143562

Reviewed by Anders Carlsson.

If another thread comes and truncates the file before we map it we end up with a map that crashes when accessed.

* NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
(WebKit::NetworkCache::IOChannel::IOChannel):

    When creating a new file unlink any existing file instead of using O_TRUNC.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@182602 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm