Fossil

Check-in [5b91887495]
Login

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

Overview
Comment:Fix a memory allocation bug in the ZIP archive generator. Ticket [8d6efe4f927]
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 5b91887495c357fe2cae15e5ef268e904304bc0c
User & Date: drh 2009-08-15 13:21:45.000
References
2009-08-15
13:24 Fixed ticket [8d6efe4f92]: fossil version [90048e0b30] will not save zip archive on winXP plus 2 other changes artifact: c3989f5cb0 user: drh
Context
2009-08-15
16:47
Add the "circa" capability to the timeline. Check-in hyperlinks go to the "diff" page by default, rather than the "detail" page. check-in: 5a539f82dc user: drh tags: trunk
13:21
Fix a memory allocation bug in the ZIP archive generator. Ticket [8d6efe4f927] check-in: 5b91887495 user: drh tags: trunk
12:18
If the special "ckout" of the "/doc" webpage is used and the server is not within a local check-out, then automatically convert "ckout" to "tip". check-in: 292e585661 user: drh tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/zip.c.
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
      c = zName[i+1];
      zName[i+1] = 0;
      for(j=0; j<nDir; j++){
        if( strcmp(zName, azDir[j])==0 ) break;
      }
      if( j>=nDir ){
        nDir++;
        azDir = realloc(azDir, nDir);
        azDir[j] = sqlite3_mprintf("%s", zName);
        zip_add_file(zName, 0);
      }
      zName[i+1] = c;
    }
  }
}








|
|







106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
      c = zName[i+1];
      zName[i+1] = 0;
      for(j=0; j<nDir; j++){
        if( strcmp(zName, azDir[j])==0 ) break;
      }
      if( j>=nDir ){
        nDir++;
        azDir = realloc(azDir, sizeof(azDir[0])*nDir);
        azDir[j] = mprintf("%s", zName);
        zip_add_file(zName, 0);
      }
      zName[i+1] = c;
    }
  }
}

284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
  put16(&zBuf[20], 0);
  blob_append(&body, zBuf, 22);
  blob_reset(&toc);
  *pZip = body;
  blob_zero(&body);
  nEntry = 0;
  for(i=0; i<nDir; i++){
    sqlite3_free(azDir[i]);
  }
  free(azDir);
  nDir = 0;
  azDir = 0;
}

/*







|







284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
  put16(&zBuf[20], 0);
  blob_append(&body, zBuf, 22);
  blob_reset(&toc);
  *pZip = body;
  blob_zero(&body);
  nEntry = 0;
  for(i=0; i<nDir; i++){
    free(azDir[i]);
  }
  free(azDir);
  nDir = 0;
  azDir = 0;
}

/*