Fossil

Check-in [b9a744e1]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix a segfault that can occur if a corrupt delta gets into the archive.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b9a744e1c4d842a289a9cb350085ca4935633e83
User & Date: drh 2010-06-21 19:28:50
Context
2010-06-23
11:48
Merge quickstart.wiki changes into the trunk. check-in: c6cfa4eb user: drh tags: trunk
11:46
Back out the benoit branch changes added by the previous check-in. check-in: 17075ffb user: drh tags: ttmrichter
02:21
Merging trunk into private branch. check-in: 54d0648f user: michael tags: ttmrichter
2010-06-22
11:35
Improve Make system for easier compilation with MinGW awk must still be in PATH and zlib compiled for mingw. check-in: 7b7fe276 user: BM tags: benoit
2010-06-21
19:28
Fix a segfault that can occur if a corrupt delta gets into the archive. check-in: b9a744e1 user: drh tags: trunk
15:08
Update to the latest version of SQLite with WAL support. check-in: ed1037e2 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/deltacmd.c.

83
84
85
86
87
88
89

90
91
92
93
94
95
96
*/
int blob_delta_apply(Blob *pOriginal, Blob *pDelta, Blob *pTarget){
  int len, n;
  Blob out;

  n = delta_output_size(blob_buffer(pDelta), blob_size(pDelta));
  blob_zero(&out);

  blob_resize(&out, n);
  len = delta_apply(
     blob_buffer(pOriginal), blob_size(pOriginal),
     blob_buffer(pDelta), blob_size(pDelta),
     blob_buffer(&out));
  if( len<0 ){
    blob_reset(&out);







>







83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
*/
int blob_delta_apply(Blob *pOriginal, Blob *pDelta, Blob *pTarget){
  int len, n;
  Blob out;

  n = delta_output_size(blob_buffer(pDelta), blob_size(pDelta));
  blob_zero(&out);
  if( n<0 ) return -1;
  blob_resize(&out, n);
  len = delta_apply(
     blob_buffer(pOriginal), blob_size(pOriginal),
     blob_buffer(pDelta), blob_size(pDelta),
     blob_buffer(&out));
  if( len<0 ){
    blob_reset(&out);