[Webkit-unassigned] [Bug 133069] [Curl] Invalid content in cache file, causes broken rendering.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 19 09:11:20 PDT 2014


https://bugs.webkit.org/show_bug.cgi?id=133069


Brent Fulgham <bfulgham at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #231688|review?                     |review-
               Flag|                            |




--- Comment #2 from Brent Fulgham <bfulgham at webkit.org>  2014-05-19 09:11:41 PST ---
(From update of attachment 231688)
View in context: https://bugs.webkit.org/attachment.cgi?id=231688&action=review

r-: Please adjust a few functions for early return! :-)

> Source/WebCore/platform/network/curl/CurlCacheEntry.cpp:365
> +    if (m_contentFile == invalidPlatformFileHandle) {

We prefer this as an early return:  "if (m_contentFile != invalidPlatformFileHandle) \r return true;"

> Source/WebCore/platform/network/curl/CurlCacheEntry.cpp:366
> +        m_contentFile = openFile(m_contentFilename, OpenForWrite);

I was very surprised to see that we don't have an "OpenForWrite" style that does not concatenate the file!

> Source/WebCore/platform/network/curl/CurlCacheEntry.cpp:367
> +        if (!isHandleValid(m_contentFile)) {

Again, we prefer to exit early if possible in tests like this.

> Source/WebCore/platform/network/curl/CurlCacheEntry.cpp:377
> +    if (m_contentFile != invalidPlatformFileHandle) {

Early return please.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list