Fossil SCM
Fix a segfault that occurs on an attempt to merge binary files. Ticket [3f2cb270b2f6].
Commit
8e147fdbac452ff3d92faa44bd26f678e3c00efb
Parent
0f4f6c032587c3b…
1 file changed
+2
-1
+2
-1
| --- src/merge3.c | ||
| +++ src/merge3.c | ||
| @@ -160,10 +160,12 @@ | ||
| 160 | 160 | int limit1, limit2; /* Sizes of aC1[] and aC2[] */ |
| 161 | 161 | int nConflict = 0; /* Number of merge conflicts seen so far */ |
| 162 | 162 | static const char zBegin[] = ">>>>>>> BEGIN MERGE CONFLICT\n"; |
| 163 | 163 | static const char zMid[] = "============================\n"; |
| 164 | 164 | static const char zEnd[] = "<<<<<<< END MERGE CONFLICT\n"; |
| 165 | + | |
| 166 | + blob_zero(pOut); /* Merge results stored in pOut */ | |
| 165 | 167 | |
| 166 | 168 | /* Compute the edits that occur from pPivot => pV1 (into aC1) |
| 167 | 169 | ** and pPivot => pV2 (into aC2). Each of the aC1 and aC2 arrays is |
| 168 | 170 | ** an array of integer triples. Within each triple, the first integer |
| 169 | 171 | ** is the number of lines of text to copy directly from the pivot, |
| @@ -177,11 +179,10 @@ | ||
| 177 | 179 | free(aC1); |
| 178 | 180 | free(aC2); |
| 179 | 181 | return -1; |
| 180 | 182 | } |
| 181 | 183 | |
| 182 | - blob_zero(pOut); /* Merge results stored in pOut */ | |
| 183 | 184 | blob_rewind(pV1); /* Rewind inputs: Needed to reconstruct output */ |
| 184 | 185 | blob_rewind(pV2); |
| 185 | 186 | blob_rewind(pPivot); |
| 186 | 187 | |
| 187 | 188 | /* Determine the length of the aC1[] and aC2[] change vectors */ |
| 188 | 189 |
| --- 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 |