Fossil SCM
Check the return code form blob_delta_apply() to make sure there are no errors prior to using the result.
Commit
85fc2e0a4801349657df46b4e75a343b8cc98c27
Parent
451f04f6fe631c3…
1 file changed
+9
-6
+9
-6
| --- src/content.c | ||
| +++ src/content.c | ||
| @@ -282,18 +282,21 @@ | ||
| 282 | 282 | rc = content_get(a[n], pBlob); |
| 283 | 283 | n--; |
| 284 | 284 | while( rc && n>=0 ){ |
| 285 | 285 | rc = content_of_blob(a[n], &delta); |
| 286 | 286 | if( rc ){ |
| 287 | - blob_delta_apply(pBlob, &delta, &next); | |
| 288 | - blob_reset(&delta); | |
| 289 | - if( (mx-n)%8==0 ){ | |
| 290 | - content_cache_insert(a[n+1], pBlob); | |
| 287 | + if( blob_delta_apply(pBlob, &delta, &next)<0 ){ | |
| 288 | + rc = 1; | |
| 291 | 289 | }else{ |
| 292 | - blob_reset(pBlob); | |
| 290 | + blob_reset(&delta); | |
| 291 | + if( (mx-n)%8==0 ){ | |
| 292 | + content_cache_insert(a[n+1], pBlob); | |
| 293 | + }else{ | |
| 294 | + blob_reset(pBlob); | |
| 295 | + } | |
| 296 | + *pBlob = next; | |
| 293 | 297 | } |
| 294 | - *pBlob = next; | |
| 295 | 298 | } |
| 296 | 299 | n--; |
| 297 | 300 | } |
| 298 | 301 | free(a); |
| 299 | 302 | if( !rc ) blob_reset(pBlob); |
| 300 | 303 |
| --- src/content.c | |
| +++ src/content.c | |
| @@ -282,18 +282,21 @@ | |
| 282 | rc = content_get(a[n], pBlob); |
| 283 | n--; |
| 284 | while( rc && n>=0 ){ |
| 285 | rc = content_of_blob(a[n], &delta); |
| 286 | if( rc ){ |
| 287 | blob_delta_apply(pBlob, &delta, &next); |
| 288 | blob_reset(&delta); |
| 289 | if( (mx-n)%8==0 ){ |
| 290 | content_cache_insert(a[n+1], pBlob); |
| 291 | }else{ |
| 292 | blob_reset(pBlob); |
| 293 | } |
| 294 | *pBlob = next; |
| 295 | } |
| 296 | n--; |
| 297 | } |
| 298 | free(a); |
| 299 | if( !rc ) blob_reset(pBlob); |
| 300 |
| --- src/content.c | |
| +++ src/content.c | |
| @@ -282,18 +282,21 @@ | |
| 282 | rc = content_get(a[n], pBlob); |
| 283 | n--; |
| 284 | while( rc && n>=0 ){ |
| 285 | rc = content_of_blob(a[n], &delta); |
| 286 | if( rc ){ |
| 287 | if( blob_delta_apply(pBlob, &delta, &next)<0 ){ |
| 288 | rc = 1; |
| 289 | }else{ |
| 290 | blob_reset(&delta); |
| 291 | if( (mx-n)%8==0 ){ |
| 292 | content_cache_insert(a[n+1], pBlob); |
| 293 | }else{ |
| 294 | blob_reset(pBlob); |
| 295 | } |
| 296 | *pBlob = next; |
| 297 | } |
| 298 | } |
| 299 | n--; |
| 300 | } |
| 301 | free(a); |
| 302 | if( !rc ) blob_reset(pBlob); |
| 303 |