Changeset 74251 in webkit


Ignore:
Timestamp:
Dec 17, 2010 4:46:10 AM (13 years ago)
Author:
sergio@webkit.org
Message:

2010-12-16 Sergio Villar Senin <svillar@igalia.com>

Reviewed by Martin Robinson.

Wrong check in ResourceHandleSoup in error cases
https://bugs.webkit.org/show_bug.cgi?id=51171

Calling didReceiveData with no data causes a crash in debug
builds. Checking for soupMsg->response_body->data is not correct as libsoup
always creates a buffer for that. Instead we should check for
soupMsg->response_body->length

  • platform/network/soup/ResourceHandleSoup.cpp: (WebCore::sendRequestCallback):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r74248 r74251  
     12010-12-16  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        Reviewed by Martin Robinson.
     4
     5        Wrong check in ResourceHandleSoup in error cases
     6        https://bugs.webkit.org/show_bug.cgi?id=51171
     7
     8        Calling didReceiveData with no data causes a crash in debug
     9        builds. Checking for soupMsg->response_body->data is not correct as libsoup
     10        always creates a buffer for that. Instead we should check for
     11        soupMsg->response_body->length
     12
     13        * platform/network/soup/ResourceHandleSoup.cpp:
     14        (WebCore::sendRequestCallback):
     15
    1162010-12-17  Andreas Kling  <andreas.kling@nokia.com>
    217
  • trunk/WebCore/platform/network/soup/ResourceHandleSoup.cpp

    r73357 r74251  
    509509            client->didReceiveResponse(handle.get(), d->m_response);
    510510
    511             // WebCore might have cancelled the job in the while
    512             if (!d->m_cancelled && soupMsg->response_body->data)
     511            // WebCore might have cancelled the job in the while. We
     512            // must check for response_body->length and not
     513            // response_body->data as libsoup always creates the
     514            // SoupBuffer for the body even if the length is 0
     515            if (!d->m_cancelled && soupMsg->response_body->length)
    513516                client->didReceiveData(handle.get(), soupMsg->response_body->data, soupMsg->response_body->length, true);
    514517        }
Note: See TracChangeset for help on using the changeset viewer.