Fossil SCM

Fix a segfault that occurs on an attempt to merge binary files. Ticket [3f2cb270b2f6].

drh 2009-12-19 03:16 trunk
Commit 8e147fdbac452ff3d92faa44bd26f678e3c00efb
1 file changed +2 -1
+2 -1
--- src/merge3.c
+++ src/merge3.c
@@ -160,10 +160,12 @@
160160
int limit1, limit2; /* Sizes of aC1[] and aC2[] */
161161
int nConflict = 0; /* Number of merge conflicts seen so far */
162162
static const char zBegin[] = ">>>>>>> BEGIN MERGE CONFLICT\n";
163163
static const char zMid[] = "============================\n";
164164
static const char zEnd[] = "<<<<<<< END MERGE CONFLICT\n";
165
+
166
+ blob_zero(pOut); /* Merge results stored in pOut */
165167
166168
/* Compute the edits that occur from pPivot => pV1 (into aC1)
167169
** and pPivot => pV2 (into aC2). Each of the aC1 and aC2 arrays is
168170
** an array of integer triples. Within each triple, the first integer
169171
** is the number of lines of text to copy directly from the pivot,
@@ -177,11 +179,10 @@
177179
free(aC1);
178180
free(aC2);
179181
return -1;
180182
}
181183
182
- blob_zero(pOut); /* Merge results stored in pOut */
183184
blob_rewind(pV1); /* Rewind inputs: Needed to reconstruct output */
184185
blob_rewind(pV2);
185186
blob_rewind(pPivot);
186187
187188
/* Determine the length of the aC1[] and aC2[] change vectors */
188189
--- src/merge3.c
+++ src/merge3.c
@@ -160,10 +160,12 @@
160 int limit1, limit2; /* Sizes of aC1[] and aC2[] */
161 int nConflict = 0; /* Number of merge conflicts seen so far */
162 static const char zBegin[] = ">>>>>>> BEGIN MERGE CONFLICT\n";
163 static const char zMid[] = "============================\n";
164 static const char zEnd[] = "<<<<<<< END MERGE CONFLICT\n";
 
 
165
166 /* Compute the edits that occur from pPivot => pV1 (into aC1)
167 ** and pPivot => pV2 (into aC2). Each of the aC1 and aC2 arrays is
168 ** an array of integer triples. Within each triple, the first integer
169 ** is the number of lines of text to copy directly from the pivot,
@@ -177,11 +179,10 @@
177 free(aC1);
178 free(aC2);
179 return -1;
180 }
181
182 blob_zero(pOut); /* Merge results stored in pOut */
183 blob_rewind(pV1); /* Rewind inputs: Needed to reconstruct output */
184 blob_rewind(pV2);
185 blob_rewind(pPivot);
186
187 /* Determine the length of the aC1[] and aC2[] change vectors */
188
--- src/merge3.c
+++ src/merge3.c
@@ -160,10 +160,12 @@
160 int limit1, limit2; /* Sizes of aC1[] and aC2[] */
161 int nConflict = 0; /* Number of merge conflicts seen so far */
162 static const char zBegin[] = ">>>>>>> BEGIN MERGE CONFLICT\n";
163 static const char zMid[] = "============================\n";
164 static const char zEnd[] = "<<<<<<< END MERGE CONFLICT\n";
165
166 blob_zero(pOut); /* Merge results stored in pOut */
167
168 /* Compute the edits that occur from pPivot => pV1 (into aC1)
169 ** and pPivot => pV2 (into aC2). Each of the aC1 and aC2 arrays is
170 ** an array of integer triples. Within each triple, the first integer
171 ** is the number of lines of text to copy directly from the pivot,
@@ -177,11 +179,10 @@
179 free(aC1);
180 free(aC2);
181 return -1;
182 }
183
 
184 blob_rewind(pV1); /* Rewind inputs: Needed to reconstruct output */
185 blob_rewind(pV2);
186 blob_rewind(pPivot);
187
188 /* Determine the length of the aC1[] and aC2[] change vectors */
189

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button