Changeset 62755 in webkit


Ignore:
Timestamp:
Jul 7, 2010 9:37:04 PM (14 years ago)
Author:
dbates@webkit.org
Message:

2010-07-07 Daniel Bates <dbates@rim.com>

Reviewed by Dumitru Daniliuc.

VCSUtils.pm complains about uninitialized value $newLine
https://bugs.webkit.org/show_bug.cgi?id=41333

Fixes an issue where VCSUtils::fixChangeLogPatch() may read off the end of
an array when fixing a change log entry that overlaps with an earlier
entry. In particular, when a patch contains a change log entry inserted
earlier in the change log file, but after an entry with the same author
and date.

  • Scripts/VCSUtils.pm:
    • Added for-loop constraint to fixChangeLogPatch() so that it does not read off the end of the @overlappingLines array.
  • Scripts/webkitperl/VCSUtils_unittest/fixChangeLogPatch.pl: Added unit test.
Location:
trunk/WebKitTools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r62752 r62755  
     12010-07-07  Daniel Bates  <dbates@rim.com>
     2
     3        Reviewed by Dumitru Daniliuc.
     4
     5        VCSUtils.pm complains about uninitialized value $newLine
     6        https://bugs.webkit.org/show_bug.cgi?id=41333
     7
     8        Fixes an issue where VCSUtils::fixChangeLogPatch() may read off the end of
     9        an array when fixing a change log entry that overlaps with an earlier
     10        entry. In particular, when a patch contains a change log entry inserted
     11        earlier in the change log file, but after an entry with the same author
     12        and date.
     13
     14        * Scripts/VCSUtils.pm:
     15            - Added for-loop constraint to fixChangeLogPatch() so that it does not
     16              read off the end of the @overlappingLines array.
     17        * Scripts/webkitperl/VCSUtils_unittest/fixChangeLogPatch.pl: Added unit test.
     18
    1192010-07-07  Anders Carlsson  <andersca@apple.com>
    220
  • trunk/WebKitTools/Scripts/VCSUtils.pm

    r60015 r62755  
    13011301    # Work backwards, shifting overlapping lines towards front
    13021302    # while checking that patch stays equivalent.
    1303     for ($i = $dateStartIndex - 1; $i >= $chunkStartIndex; --$i) {
     1303    for ($i = $dateStartIndex - 1; @overlappingLines && $i >= $chunkStartIndex; --$i) {
    13041304        my $line = $lines[$i];
    13051305        if (substr($line, 0, 1) ne " ") {
  • trunk/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/fixChangeLogPatch.pl

    r52732 r62755  
    3131# Unit tests of VCSUtils::fixChangeLogPatch().
    3232
    33 use Test::Simple tests => 7;
     33use Test::Simple tests => 8;
    3434use VCSUtils;
    3535
     
    119119 
    120120         * File:
     121END
     122
     123ok(fixChangeLogPatch($in) eq $in, $title);
     124
     125# New test
     126$title = "fixChangeLogPatch: [no change] New entry inserted earlier in the file, but after an entry with the same author and date.";
     127
     128$in = <<'END';
     129--- ChangeLog
     130+++ ChangeLog
     131@@ -70,6 +70,14 @@
     132 
     133 2009-12-22  Alice  <alice@email.address>
     134 
     135+        Reviewed by Sue.
     136+
     137+        Changed some more code on 2009-12-22.
     138+
     139+        * File:
     140+
     141+2009-12-22  Alice  <alice@email.address>
     142+
     143         Reviewed by Ray.
     144 
     145         Changed some code on 2009-12-22.
    121146END
    122147
Note: See TracChangeset for help on using the changeset viewer.