Changeset 182602 in webkit
- Timestamp:
- Apr 9, 2015 9:20:21 AM (9 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r182598 r182602 1 2015-04-09 Antti Koivisto <antti@apple.com> 2 3 Network Cache: Crash in WebCore::CachedResource::tryReplaceEncodedData 4 https://bugs.webkit.org/show_bug.cgi?id=143562 5 6 Reviewed by Anders Carlsson. 7 8 If another thread comes and truncates the file before we map it we end up with a map that crashes when accessed. 9 10 * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm: 11 (WebKit::NetworkCache::IOChannel::IOChannel): 12 13 When creating a new file unlink any existing file instead of using O_TRUNC. 14 1 15 2015-04-09 Csaba Osztrogonác <ossy@webkit.org> 2 16 -
trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm
r181700 r182602 44 44 , m_type(type) 45 45 { 46 auto path = WebCore::fileSystemRepresentation(filePath); 46 47 int oflag; 47 48 mode_t mode; … … 49 50 switch (m_type) { 50 51 case Type::Create: 51 oflag = O_RDWR | O_CREAT | O_TRUNC | O_NONBLOCK; 52 // We don't want to truncate any existing file (with O_TRUNC) as another thread might be mapping it. 53 unlink(path.data()); 54 oflag = O_RDWR | O_CREAT | O_NONBLOCK; 52 55 mode = S_IRUSR | S_IWUSR; 53 56 break; … … 61 64 } 62 65 63 CString path = WebCore::fileSystemRepresentation(filePath);64 66 int fd = ::open(path.data(), oflag, mode); 65 67 m_fileDescriptor = fd;
Note: See TracChangeset
for help on using the changeset viewer.