Fossil

Check-in [2d714a4e]
Login

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

Overview
Comment:Avoid using a null pointer resulting in a segfault if caller sends in null.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | pending-review
Files: files | file ages | folders
SHA1: 2d714a4e4825154997b882089afbf3339087ea05
User & Date: andybradford 2015-08-02 02:44:23.516
Context
2015-08-07
05:15
Integrate change to disallow passing in a NULL pointer to blob_append. ... (check-in: dd75bc57 user: andybradford 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)
2015-07-29
17:35
minor CGI-in-chroot doc update from the ML. ... (check-in: 1d3a8047 user: stephan tags: trunk)
Changes
Unified Diff 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();