Fossil

Check-in [122905c2]
Login

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

Overview
Comment:Fix a critical bug in the new blob_append_char() routine that was added to the previous check-in. This bug causes crashes. Also change the quoted-printable encoding to escape the ':' character so that lines in the body of an email will never be confused with a header line like "From:".
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 122905c29b43f5358911a0b6e5f1868b53bd9621143904864ce2442098859446
User & Date: drh 2018-06-26 02:26:14
Context
2018-06-26
11:21
Make the mv-rm-files available without special compile-time options. check-in: 27e5e5ce user: drh tags: trunk
02:26
Fix a critical bug in the new blob_append_char() routine that was added to the previous check-in. This bug causes crashes. Also change the quoted-printable encoding to escape the ':' character so that lines in the body of an email will never be confused with a header line like "From:". check-in: 122905c2 user: drh tags: trunk
02:01
Change the email transfer encoding to quoted-printable. check-in: b6a13c45 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/blob.c.

296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
  pBlob->aData[pBlob->nUsed] = 0;   /* Blobs are always nul-terminated */
}

/*
** Append a single character to the blob
*/
void blob_append_char(Blob *pBlob, char c){
  if( pBlob->nUsed+1>pBlob->nAlloc ){
    pBlob->xRealloc(pBlob, pBlob->nUsed + pBlob->nAlloc + 100);
    if( pBlob->nUsed + 1 >= pBlob->nAlloc ){
      blob_panic();
    }
  }
  pBlob->aData[pBlob->nUsed++] = c;    
}







|







296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
  pBlob->aData[pBlob->nUsed] = 0;   /* Blobs are always nul-terminated */
}

/*
** Append a single character to the blob
*/
void blob_append_char(Blob *pBlob, char c){
  if( pBlob->nUsed+1 >= pBlob->nAlloc ){
    pBlob->xRealloc(pBlob, pBlob->nUsed + pBlob->nAlloc + 100);
    if( pBlob->nUsed + 1 >= pBlob->nAlloc ){
      blob_panic();
    }
  }
  pBlob->aData[pBlob->nUsed++] = c;    
}

Changes to src/email.c.

314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
** append it onto pOut
*/
static void append_quoted(Blob *pOut, Blob *pMsg){
  char *zIn = blob_str(pMsg);
  char c;
  int iCol = 0;
  while( (c = *(zIn++))!=0 ){
    if( (c>='!' && c<='~' && c!='=')
     || (c==' ' && zIn[0]!='\r' && zIn[0]!='\n')
    ){
      blob_append_char(pOut, c);
      iCol++;
      if( iCol>=70 ){
        blob_append(pOut, "=\n", 2);
        iCol = 0;







|







314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
** append it onto pOut
*/
static void append_quoted(Blob *pOut, Blob *pMsg){
  char *zIn = blob_str(pMsg);
  char c;
  int iCol = 0;
  while( (c = *(zIn++))!=0 ){
    if( (c>='!' && c<='~' && c!='=' && c!=':')
     || (c==' ' && zIn[0]!='\r' && zIn[0]!='\n')
    ){
      blob_append_char(pOut, c);
      iCol++;
      if( iCol>=70 ){
        blob_append(pOut, "=\n", 2);
        iCol = 0;