Changeset 69716 in webkit


Ignore:
Timestamp:
Oct 13, 2010 5:21:40 PM (14 years ago)
Author:
cevans@google.com
Message:

2010-10-13 Chris Evans <cevans@google.com>

Reviewed by Jian Li.

Blob / BlobBuilder can be put into bad state with wild integers and strings, due to integer overflows
https://bugs.webkit.org/show_bug.cgi?id=47382

Add test for Blob.slice() integer overflow.

  • fast/files/blob-slice-overflow.html: Added.
  • fast/files/blob-slice-overflow-expected.txt: Added.

2010-10-13 Chris Evans <cevans@google.com>

Reviewed by Jian Li.

Blob / BlobBuilder can be put into bad state with wild integers and strings, due to integer overflows
https://bugs.webkit.org/show_bug.cgi?id=47382

Fix integer overflow errors in Blob.slice and BlobBuilder.append.

Test: fast/files/blob-slice-overflow.html

  • fileapi/Blob.cpp: (WebCore::Blob::slice): handle integer overflow properly.
  • fileapi/BlobBuilder.cpp: (WebCore::BlobBuilder::append): use correct type for vector length.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r69710 r69716  
     12010-10-13  Chris Evans  <cevans@google.com>
     2
     3        Reviewed by Jian Li.
     4
     5        Blob / BlobBuilder can be put into bad state with wild integers and strings, due to integer overflows
     6        https://bugs.webkit.org/show_bug.cgi?id=47382
     7
     8        Add test for Blob.slice() integer overflow.
     9
     10        * fast/files/blob-slice-overflow.html: Added.
     11        * fast/files/blob-slice-overflow-expected.txt: Added.
     12
    1132010-10-13  James Simonsen  <simonjam@chromium.org>
    214
  • trunk/WebCore/ChangeLog

    r69715 r69716  
     12010-10-13  Chris Evans  <cevans@google.com>
     2
     3        Reviewed by Jian Li.
     4
     5        Blob / BlobBuilder can be put into bad state with wild integers and strings, due to integer overflows
     6        https://bugs.webkit.org/show_bug.cgi?id=47382
     7
     8        Fix integer overflow errors in Blob.slice and BlobBuilder.append.
     9
     10        Test: fast/files/blob-slice-overflow.html
     11
     12        * fileapi/Blob.cpp:
     13        (WebCore::Blob::slice): handle integer overflow properly.
     14        * fileapi/BlobBuilder.cpp:
     15        (WebCore::BlobBuilder::append): use correct type for vector length.
     16
    1172010-10-13  Gavin Barraclough  <barraclough@apple.com>
    218
  • trunk/WebCore/fileapi/Blob.cpp

    r67208 r69716  
    8787        start = 0;
    8888        length = 0;
    89     } else if (start + length > size)
     89    } else if (start + length > size || length > std::numeric_limits<long long>::max() - start)
    9090        length = size - start;
    9191
  • trunk/WebCore/fileapi/BlobBuilder.cpp

    r69610 r69716  
    6464    if (!utf8Text.isNull()) {
    6565        Vector<char>& buffer = *m_items[m_items.size() - 1].data->mutableData();
    66         unsigned oldSize = buffer.size();
     66        size_t oldSize = buffer.size();
    6767
    6868        if (isEndingTypeNative)
Note: See TracChangeset for help on using the changeset viewer.