Rev 4897: Merge in some of the 2.0.3 stuff, start preparing 2.1.0b4 in http://bazaar.launchpad.net/~jameinel/bzr/2.1.0b4-dev

John Arbash Meinel john at arbash-meinel.com
Mon Dec 14 20:28:02 GMT 2009


At http://bazaar.launchpad.net/~jameinel/bzr/2.1.0b4-dev

------------------------------------------------------------
revno: 4897 [merge]
revision-id: john at arbash-meinel.com-20091214202755-4dxijbonauq3og01
parent: pqm at pqm.ubuntu.com-20091214180342-nk22cwvqcz54e331
parent: john at arbash-meinel.com-20091214201750-tzjluuiwe0l8oa75
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.1.0b4-dev
timestamp: Mon 2009-12-14 14:27:55 -0600
message:
  Merge in some of the 2.0.3 stuff, start preparing 2.1.0b4
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/__init__.py             __init__.py-20050309040759-33e65acf91bbcd5d
  bzrlib/diff-delta.c            diffdelta.c-20090226042143-l9wzxynyuxnb5hus-1
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS	2009-12-14 16:04:27 +0000
+++ b/NEWS	2009-12-14 20:27:55 +0000
@@ -5,11 +5,11 @@
 .. contents:: List of Releases
    :depth: 1
 
-bzr 2.1.0b4 (not released yet)
-##############################
+bzr 2.1.0b4
+###########
 
 :Codename: san francisco airport
-:2.1.0b4: ???
+:2.1.0b4: 2009-12-14
 
 Compatibility Breaks
 ********************
@@ -153,17 +153,17 @@
 * TestCaseWithMemoryTransport no longer sets $HOME and $BZR_HOME to
   unicode strings. (Michael Hudson, #464174)
 
-bzr 2.0.3 (not released yet)
-############################
-
-:Codename: 
-:2.0.3: ???
-
-Compatibility Breaks
-********************
-
-New Features
-************
+
+bzr 2.0.3
+#########
+
+:Codename: little italy
+:2.0.3: 2009-12-14
+
+
+The third stable release of Bazaar has a small handful of bugfixes. As
+expected, this has no internal or external compatibility changes versus
+2.0.2 (or 2.0.0).
 
 Bug Fixes
 *********
@@ -175,25 +175,13 @@
 * Content filters are now applied correctly after pull, merge and switch.
   (Ian Clatworthy, #385879)
 
+* Fix a potential segfault in the groupcompress hash map handling code.
+  When inserting new entries, if the final hash bucket was empty, we could
+  end up trying to access if ``(last_entry+1)->ptr == NULL``.
+  (John Arbash Meinel, #490228)
+
 * Improve "Binary files differ" hunk handling.  (Aaron Bentley, #436325)
 
-Improvements
-************
-
-Documentation
-*************
-* Include Japanese translations for documentation (Inada Naoki)
-
-API Changes
-***********
-
-Internals
-*********
-
-Testing
-*******
-
-
 
 bzr 2.1.0b3
 ###########
@@ -418,21 +406,6 @@
   start reading 'inventories', etc.) This can have a significant impact on
   peak memory for initial copies (~200MB). (John Arbash Meinel)
 
-Improvements
-************
-
-Documentation
-*************
-
-API Changes
-***********
-
-Internals
-*********
-
-Testing
-*******
-
 
 bzr 2.0.2
 #########

=== modified file 'bzrlib/__init__.py'
--- a/bzrlib/__init__.py	2009-11-16 19:45:47 +0000
+++ b/bzrlib/__init__.py	2009-12-14 20:27:55 +0000
@@ -44,7 +44,7 @@
 # Python version 2.0 is (2, 0, 0, 'final', 0)."  Additionally we use a
 # releaselevel of 'dev' for unreleased under-development code.
 
-version_info = (2, 1, 0, 'dev', 4)
+version_info = (2, 1, 0, 'beta', 4)
 
 # API compatibility version: bzrlib is currently API compatible with 1.15.
 api_minimum_version = (2, 1, 0)

=== modified file 'bzrlib/diff-delta.c'
--- a/bzrlib/diff-delta.c	2009-08-03 16:54:36 +0000
+++ b/bzrlib/diff-delta.c	2009-12-14 15:54:42 +0000
@@ -688,7 +688,7 @@
     const unsigned char *data, *buffer, *top;
     unsigned char cmd;
     struct delta_index *new_index;
-    struct index_entry *entry, *entries, *old_entry;
+    struct index_entry *entry, *entries;
 
     if (!src->buf || !src->size)
         return NULL;
@@ -789,6 +789,7 @@
     entry = entries;
     num_inserted = 0;
     for (; num_entries > 0; --num_entries, ++entry) {
+        struct index_entry *next_bucket_entry, *cur_entry, *bucket_first_entry;
         hash_offset = (entry->val & old_index->hash_mask);
         /* The basic structure is a hash => packed_entries that fit in that
          * hash bucket. Things are structured such that the hash-pointers are
@@ -797,15 +798,19 @@
          * forward. If there are no NULL targets, then we know because
          * entry->ptr will not be NULL.
          */
-        old_entry = old_index->hash[hash_offset + 1];
-        old_entry--;
-        while (old_entry->ptr == NULL
-               && old_entry >= old_index->hash[hash_offset]) {
-            old_entry--;
+        // The start of the next bucket, this may point past the end of the
+        // entry table if hash_offset is the last bucket.
+        next_bucket_entry = old_index->hash[hash_offset + 1];
+        // First entry in this bucket
+        bucket_first_entry = old_index->hash[hash_offset];
+        cur_entry = next_bucket_entry - 1;
+        while (cur_entry->ptr == NULL && cur_entry >= bucket_first_entry) {
+            cur_entry--;
         }
-        old_entry++;
-        if (old_entry->ptr != NULL
-            || old_entry >= old_index->hash[hash_offset + 1]) {
+        // cur_entry now either points at the first NULL, or it points to
+        // next_bucket_entry if there were no blank spots.
+        cur_entry++;
+        if (cur_entry >= next_bucket_entry || cur_entry->ptr != NULL) {
             /* There is no room for this entry, we have to resize */
             // char buff[128];
             // get_text(buff, entry->ptr);
@@ -822,7 +827,7 @@
             break;
         }
         num_inserted++;
-        *old_entry = *entry;
+        *cur_entry = *entry;
         /* For entries which we *do* manage to insert into old_index, we don't
          * want them double copied into the final output.
          */



More information about the bazaar-commits mailing list