Fossil

Check-in [dd75bc57]
Login

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

Overview
Comment:Integrate change to disallow passing in a NULL pointer to blob_append.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:dd75bc574d67a2fd268f3fa8624332c39adcd451
User & Date: andybradford 2015-08-07 05:15:47
Context
2015-08-11
04:03
Integrate new command amend into trunk. check-in: c73c95cc user: andybradford tags: trunk
2015-08-07
05:16
Merge in changes from trunk. Closed-Leaf check-in: 5246eac0 user: andybradford tags: check-in-edit
05:15
Integrate change to disallow passing in a NULL pointer to blob_append. check-in: dd75bc57 user: andybradford tags: trunk
2015-08-03
18:35
Integrate andygoth-undo-redo-revert-spacing. check-in: 0a2ebe57 user: andygoth tags: trunk
2015-08-02
02:44
Avoid using a null pointer resulting in a segfault if caller sends in null. Closed-Leaf check-in: 2d714a4e user: andybradford tags: pending-review
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/blob.c.

269
270
271
272
273
274
275

276
277
278
279
280
281
282
  pBlob->xRealloc = blobReallocStatic;
}

/*
** Append text or data to the end of a blob.
*/
void blob_append(Blob *pBlob, const char *aData, int nData){

  blob_is_init(pBlob);
  if( nData<0 ) nData = strlen(aData);
  if( nData==0 ) return;
  if( pBlob->nUsed + nData >= pBlob->nAlloc ){
    pBlob->xRealloc(pBlob, pBlob->nUsed + nData + pBlob->nAlloc + 100);
    if( pBlob->nUsed + nData >= pBlob->nAlloc ){
      blob_panic();







>







269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
  pBlob->xRealloc = blobReallocStatic;
}

/*
** Append text or data to the end of a blob.
*/
void blob_append(Blob *pBlob, const char *aData, int nData){
  assert( aData!=0 );
  blob_is_init(pBlob);
  if( nData<0 ) nData = strlen(aData);
  if( nData==0 ) return;
  if( pBlob->nUsed + nData >= pBlob->nAlloc ){
    pBlob->xRealloc(pBlob, pBlob->nUsed + nData + pBlob->nAlloc + 100);
    if( pBlob->nUsed + nData >= pBlob->nAlloc ){
      blob_panic();