Changeset 239927 in webkit


Ignore:
Timestamp:
Jan 14, 2019 7:51:41 AM (5 years ago)
Author:
zandobersek@gmail.com
Message:

DOMCacheStorage: use-after-move in doSequentialMatch()
https://bugs.webkit.org/show_bug.cgi?id=193396

Reviewed by Youenn Fablet.

Depending on the platform- and compiler-specific calling conventions,
the doSequentialMatch() code can move out the Vector<Ref<DOMCache>>
object into the callback lambda before the DOMCache object at the
specified index is retrieved for the DOMCache::doMatch() invocation.

This problem is now avoided by retrieving reference to the target
DOMCache object in an earlier expression.

  • Modules/cache/DOMCacheStorage.cpp:

(WebCore::doSequentialMatch):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r239926 r239927  
     12019-01-14  Zan Dobersek  <zdobersek@igalia.com>
     2
     3        DOMCacheStorage: use-after-move in doSequentialMatch()
     4        https://bugs.webkit.org/show_bug.cgi?id=193396
     5
     6        Reviewed by Youenn Fablet.
     7
     8        Depending on the platform- and compiler-specific calling conventions,
     9        the doSequentialMatch() code can move out the Vector<Ref<DOMCache>>
     10        object into the callback lambda before the DOMCache object at the
     11        specified index is retrieved for the DOMCache::doMatch() invocation.
     12
     13        This problem is now avoided by retrieving reference to the target
     14        DOMCache object in an earlier expression.
     15
     16        * Modules/cache/DOMCacheStorage.cpp:
     17        (WebCore::doSequentialMatch):
     18
    1192019-01-14  Zalan Bujtas  <zalan@apple.com>
    220
  • trunk/Source/WebCore/Modules/cache/DOMCacheStorage.cpp

    r239427 r239927  
    6060    }
    6161
    62     caches[index]->doMatch(WTFMove(info), WTFMove(options), [caches = WTFMove(caches), info, options, completionHandler = WTFMove(completionHandler), index](ExceptionOr<FetchResponse*>&& result) mutable {
     62    auto& cache = caches[index].get();
     63    cache.doMatch(WTFMove(info), WTFMove(options), [caches = WTFMove(caches), info, options, completionHandler = WTFMove(completionHandler), index](ExceptionOr<FetchResponse*>&& result) mutable {
    6364        if (result.hasException()) {
    6465            completionHandler(result.releaseException());
Note: See TracChangeset for help on using the changeset viewer.