~ubuntu-branches/ubuntu/feisty/sylpheed-claws/feisty-backports

« back to all changes in this revision

Viewing changes to src/procheader.c

  • Committer: Bazaar Package Importer
  • Author(s): Ricardo Mones
  • Date: 2005-03-24 17:19:43 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20050324171943-98swdzuq83orcp9q
Tags: 1.0.4-1
* New upstream release.
- Fixes security bug (buffer overflow) (Closes: #301200)

Show diffs side-by-side

added added

removed removed

Lines of Context:
425
425
                        header->name = g_strndup(buf, p - buf + 1);
426
426
                        p++;
427
427
                        while (*p == ' ' || *p == '\t') p++;
 
428
                        *tmp = 0;
428
429
                        conv_unmime_header(tmp, sizeof(tmp), p, NULL);
429
 
                        if(tmp == NULL) 
 
430
                        if (*tmp)
 
431
                                header->body = g_strdup(tmp);
 
432
                        else                                
430
433
                                header->body = g_strdup(p);
431
 
                        else    
432
 
                                header->body = g_strdup(tmp);
433
434
                        return header;
434
435
                }
435
436
        }
516
517
        H_X_STATUS      = 12,
517
518
        H_FROM_SPACE    = 13,
518
519
        H_SC_PLANNED_DOWNLOAD = 14,
519
 
        H_X_FACE        = 15,
520
 
        H_DISPOSITION_NOTIFICATION_TO = 16,
521
 
        H_RETURN_RECEIPT_TO = 17,
522
 
        H_SC_PARTIALLY_RETRIEVED = 18,
523
 
        H_SC_ACCOUNT_SERVER = 19,
524
 
        H_SC_ACCOUNT_LOGIN = 20,
525
 
        H_SC_MESSAGE_SIZE = 21
 
520
        H_SC_MESSAGE_SIZE = 15,
 
521
        H_X_FACE        = 16,
 
522
        H_DISPOSITION_NOTIFICATION_TO = 17,
 
523
        H_RETURN_RECEIPT_TO = 18,
 
524
        H_SC_PARTIALLY_RETRIEVED = 19,
 
525
        H_SC_ACCOUNT_SERVER = 20,
 
526
        H_SC_ACCOUNT_LOGIN = 21,
526
527
};
527
528
 
528
529
static HeaderEntry hentry_full[] = {{"Date:",           NULL, FALSE},
540
541
                                   {"X-Status:",        NULL, FALSE},
541
542
                                   {"From ",            NULL, FALSE},
542
543
                                   {"SC-Marked-For-Download:", NULL, FALSE},
 
544
                                   {"SC-Message-Size:", NULL, FALSE},
543
545
                                   {"X-Face:",          NULL, FALSE},
544
546
                                   {"Disposition-Notification-To:", NULL, FALSE},
545
547
                                   {"Return-Receipt-To:", NULL, FALSE},
546
548
                                   {"SC-Partially-Retrieved:", NULL, FALSE},
547
549
                                   {"SC-Account-Server:", NULL, FALSE},
548
550
                                   {"SC-Account-Login:",NULL, FALSE},
549
 
                                   {"SC-Message-Size:", NULL, FALSE},
550
551
                                   {NULL,               NULL, FALSE}};
551
552
 
552
553
static HeaderEntry hentry_short[] = {{"Date:",          NULL, FALSE},
564
565
                                    {"X-Status:",       NULL, FALSE},
565
566
                                    {"From ",           NULL, FALSE},
566
567
                                    {"SC-Marked-For-Download:", NULL, FALSE},
 
568
                                    {"SC-Message-Size:",NULL, FALSE},
567
569
                                    {NULL,              NULL, FALSE}};
568
570
 
569
571
HeaderEntry* procheader_get_headernames(gboolean full)
962
964
{
963
965
        gchar *file;
964
966
        FILE *fp;
965
 
        HeaderEntry hentry[]={ { header, NULL, TRUE  },
966
 
                               { NULL,   NULL, FALSE } };
 
967
        HeaderEntry hentry[]={ { NULL, NULL, TRUE  },
 
968
                               { NULL, NULL, FALSE } };
967
969
        gint val;
 
970
 
 
971
        hentry[0].name = header;
968
972
       
969
973
        g_return_val_if_fail(msginfo != NULL, -1);
970
974
        file = procmsg_get_message_file_path(msginfo);