Changeset 38315 in webkit


Ignore:
Timestamp:
Nov 11, 2008 2:13:59 PM (15 years ago)
Author:
ddkilzer@apple.com
Message:

2008-11-11 Aaron Golden <agolden@apple.com>

Bug 22134: -[WebHistoryItem dictionaryRepresentation] accesses past the end of a vector

<https://bugs.webkit.org/show_bug.cgi?id=22134>

Reviewed by Geoff Garen.

  • History/WebHistoryItem.mm: (-[WebHistoryItem initFromDictionaryRepresentation:]): (-[WebHistoryItem dictionaryRepresentation]):
Location:
trunk/WebKit/mac
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/mac/ChangeLog

    r38283 r38315  
     12008-11-11  Aaron Golden  <agolden@apple.com>
     2
     3        Bug 22134: -[WebHistoryItem dictionaryRepresentation] accesses past the end of a vector
     4
     5        <https://bugs.webkit.org/show_bug.cgi?id=22134>
     6
     7        Reviewed by Geoff Garen.
     8
     9        * History/WebHistoryItem.mm:
     10        (-[WebHistoryItem initFromDictionaryRepresentation:]):
     11        (-[WebHistoryItem dictionaryRepresentation]):
     12
    1132008-11-10  Anders Carlsson  <andersca@apple.com>
    214
  • trunk/WebKit/mac/History/WebHistoryItem.mm

    r38207 r38315  
    353353    NSArray *childDicts = [dict objectForKey:WebChildrenKey];
    354354    if (childDicts) {
    355         for (int i = [childDicts count]; i >= 0; i--) {
     355        for (int i = [childDicts count] - 1; i >= 0; i--) {
    356356            WebHistoryItem *child = [[WebHistoryItem alloc] initFromDictionaryRepresentation: [childDicts objectAtIndex:i]];
    357357            core(_private)->addChildItem(core(child->_private));
     
    411411        NSMutableArray *childDicts = [NSMutableArray arrayWithCapacity:children.size()];
    412412       
    413         for (int i = children.size(); i >= 0; i--)
     413        for (int i = children.size() - 1; i >= 0; i--)
    414414            [childDicts addObject:[kit(children[i].get()) dictionaryRepresentation]];
    415415        [dict setObject: childDicts forKey:WebChildrenKey];
Note: See TracChangeset for help on using the changeset viewer.