[webkit-reviews] review denied: [Bug 197684] [Win] Implement NetworkCache::Data by using FileSystem::MappedFileData : [Attachment 391126] patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Feb 20 09:09:42 PST 2020


Antti Koivisto <koivisto at iki.fi> has denied Christopher Reid
<chris.reid at sony.com>'s request for review:
Bug 197684: [Win] Implement NetworkCache::Data by using
FileSystem::MappedFileData
https://bugs.webkit.org/show_bug.cgi?id=197684

Attachment 391126: patch

https://bugs.webkit.org/attachment.cgi?id=391126&action=review




--- Comment #32 from Antti Koivisto <koivisto at iki.fi> ---
Comment on attachment 391126
  --> https://bugs.webkit.org/attachment.cgi?id=391126
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=391126&action=review

> Source/WebKit/NetworkProcess/cache/NetworkCacheData.cpp:45
> -    int fd = open(FileSystem::fileSystemRepresentation(path).data(), O_CREAT
| O_EXCL | O_RDWR , S_IRUSR | S_IWUSR);
> -    if (fd < 0)
> -	   return { };
> -
> -    if (ftruncate(fd, m_size) < 0) {
> -	   close(fd);
> +    auto handle = FileSystem::openFile(path,
FileSystem::FileOpenMode::ReadWrite, FileSystem::FileAccessPermission::User);
> +    if (!FileSystem::truncateFile(handle, m_size)) {
> +	   FileSystem::closeFile(handle);

Please don't lose O_EXCL (or any other flags). Otherwise in error situation
we'l truncate a file backing an existing mapping. This will crash hard.


More information about the webkit-reviews mailing list