Fossil

Check-in [75ddc368]
Login

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

Overview
Comment:Given that the buffer may not actually be memory obtained by malloc(), make sure that it is, that checksum() doesn't fail an assertion.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | pending-review
Files: files | file ages | folders
SHA1:75ddc3687acbdb3295438865bbe29afbfcd76b77
User & Date: andybradford 2016-10-05 06:54:26
Context
2016-10-05
12:59
Ensure that inputs to delta_create() are always memory aligned as if obtained from malloc(). check-in: c91e4871 user: drh tags: trunk
06:54
Given that the buffer may not actually be memory obtained by malloc(), make sure that it is, that checksum() doesn't fail an assertion. Closed-Leaf check-in: 75ddc368 user: andybradford tags: pending-review
06:40
The 'manifest' setting still needs to be marked as 'versionable'. check-in: 3604802d user: mistachkin tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/deltacmd.c.

27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
*/
int blob_delta_create(Blob *pOriginal, Blob *pTarget, Blob *pDelta){
  const char *zOrig, *zTarg;
  int lenOrig, lenTarg;
  int len;
  char *zRes;
  blob_zero(pDelta);
  zOrig = blob_buffer(pOriginal);
  lenOrig = blob_size(pOriginal);
  zTarg = blob_buffer(pTarget);
  lenTarg = blob_size(pTarget);
  blob_resize(pDelta, lenTarg+16);
  zRes = blob_buffer(pDelta);
  len = delta_create(zOrig, lenOrig, zTarg, lenTarg, zRes);
  blob_resize(pDelta, len);
  return 0;
}

/*
** COMMAND: test-delta-create







|

|


|







27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
*/
int blob_delta_create(Blob *pOriginal, Blob *pTarget, Blob *pDelta){
  const char *zOrig, *zTarg;
  int lenOrig, lenTarg;
  int len;
  char *zRes;
  blob_zero(pDelta);
  zOrig = blob_materialize(pOriginal);
  lenOrig = blob_size(pOriginal);
  zTarg = blob_materialize(pTarget);
  lenTarg = blob_size(pTarget);
  blob_resize(pDelta, lenTarg+16);
  zRes = blob_materialize(pDelta);
  len = delta_create(zOrig, lenOrig, zTarg, lenTarg, zRes);
  blob_resize(pDelta, len);
  return 0;
}

/*
** COMMAND: test-delta-create