View | Details | Raw Unified | Return to bug 19955
Collapse All | Expand All

(-)imap.c (-7 / +22 lines)
Lines 318-329 Link Here
318
static int parse_fetch (BOX_INFO *ibox, CONNECTION *conn, GList *headers, 
318
static int parse_fetch (BOX_INFO *ibox, CONNECTION *conn, GList *headers, 
319
    int unseen)
319
    int unseen)
320
{
320
{
321
  char from[STRING] = "";
321
  char from[LONG_STRING] = "";
322
  char subject[STRING] = "";
322
  char subject[LONG_STRING] = "";
323
  char xface[STRING] = "";
323
  char xface[LONG_STRING] = "";
324
  char buf[LONG_STRING];
324
  char buf[LONG_STRING];
325
  char seq[8];
325
  char seq[8];
326
  char *s;
326
  char *s, *last_head;
327
  int recent = 0;
327
  int recent = 0;
328
328
329
329
Lines 339-346 Link Here
339
      return (-1);
339
      return (-1);
340
    }
340
    }
341
341
342
    if (buf[0] == '*') 
342
    if (buf[0] == '*') {
343
    {
344
      s = imap_next_word (buf);
343
      s = imap_next_word (buf);
345
      if (!isdigit (*s))
344
      if (!isdigit (*s))
346
	continue;
345
	continue;
Lines 377-386 Link Here
377
	  if (!strncasecmp (buf, "From:", 5))
376
	  if (!strncasecmp (buf, "From:", 5))
378
	  {
377
	  {
379
	    rfc2047_decode (from, buf, sizeof (from));
378
	    rfc2047_decode (from, buf, sizeof (from));
379
	    last_head = from;
380
	  }
380
	  }
381
	  else if (!strncasecmp (buf, "Subject:", 8))
381
	  else if (!strncasecmp (buf, "Subject:", 8))
382
	  {
382
	  {
383
	    rfc2047_decode (subject, buf, sizeof (subject));
383
	    rfc2047_decode (subject, buf, sizeof (subject));
384
	    last_head = subject;
384
	  }
385
	  }
385
	  else if (!strncasecmp (buf, "X-Face:", 7))
386
	  else if (!strncasecmp (buf, "X-Face:", 7))
386
	  {
387
	  {
Lines 389-394 Link Here
389
	    strfcpy (xface, s, sizeof (xface));
390
	    strfcpy (xface, s, sizeof (xface));
390
	    if (strlen (s) > sizeof (xface))
391
	    if (strlen (s) > sizeof (xface))
391
	      g_print ("-E- xface header is larger than buffer\n");
392
	      g_print ("-E- xface header is larger than buffer\n");
393
	    last_head = xface;
394
	  }
395
	  else if (ISSPACE(buf[0])) {
396
	    s = buf;
397
	    while (*s && ISSPACE (*s)) s++;
398
	    if(strlen(s) + strlen(last_head) + 1 > LONG_STRING)
399
	      g_print ("-E- a continuing header is larger than buffer\n");
400
	    else {
401
	      /* If this is an X-Face line the space don't matter, but if this 
402
	       * is any other header the space is required. */
403
	      strcat(last_head, " ");
404
	      strncat(last_head, s, LONG_STRING - strlen(last_head));
405
	    }
406
	  } else {
407
	    last_head = NULL;
392
	  }
408
	  }
393
	}
409
	}
394
      } 
410
      } 
395
--- snip ----

Return to bug 19955