Check-in [8e147fdbac]
Not logged in
Overview

SHA1 Hash:8e147fdbac452ff3d92faa44bd26f678e3c00efb
Date: 2009-12-19 03:16:52
User: drh
Comment:Fix a segfault that occurs on an attempt to merge binary files. Ticket 3f2cb270b2f6.
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified src/merge3.c from [61efa8a333] to [bbe357cf65].

@@ -161,10 +161,12 @@
   int nConflict = 0;     /* Number of merge conflicts seen so far */
   static const char zBegin[] = ">>>>>>> BEGIN MERGE CONFLICT\n";
   static const char zMid[]   = "============================\n";
   static const char zEnd[]   = "<<<<<<< END MERGE CONFLICT\n";
 
+  blob_zero(pOut);         /* Merge results stored in pOut */
+
   /* Compute the edits that occur from pPivot => pV1 (into aC1)
   ** and pPivot => pV2 (into aC2).  Each of the aC1 and aC2 arrays is
   ** an array of integer triples.  Within each triple, the first integer
   ** is the number of lines of text to copy directly from the pivot,
   ** the second integer is the number of lines of text to omit from the
@@ -177,11 +179,10 @@
     free(aC1);
     free(aC2);
     return -1;
   }
 
-  blob_zero(pOut);         /* Merge results stored in pOut */
   blob_rewind(pV1);        /* Rewind inputs:  Needed to reconstruct output */
   blob_rewind(pV2);
   blob_rewind(pPivot);
 
   /* Determine the length of the aC1[] and aC2[] change vectors */