~ubuntu-dev/ubuntu/lucid/mutt/lucid-201002101854

« back to all changes in this revision

Viewing changes to mutt_idna.c

Tags: 1.5.18-6
* Grab from upstream:
  + Guard idata->mailbox read in imap_mailbox_state.
    The bug happens when a user has more than a imap mailbox, when
    he/she browses through them mutt will segfault.
    (Closes: #462266, #513230, #514309. Mutt: #3057)

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
  /* Is this the right function?  Interesting effects with some bad identifiers! */
56
56
  if (idna_to_unicode_8z8z (in, out, 1) != IDNA_SUCCESS)
57
57
    goto notrans;
58
 
  if (mutt_convert_string (out, "utf-8", Charset, M_ICONV_HOOK_TO) == -1)
 
58
 
 
59
  /* we don't want charset-hook effects, so we set flags to 0 */
 
60
  if (mutt_convert_string (out, "utf-8", Charset, 0) == -1)
59
61
    goto notrans;
60
62
 
61
63
  /* 
68
70
    int irrev = 0;
69
71
    char *t2 = NULL;
70
72
    char *tmp = safe_strdup (*out);
71
 
    if (mutt_convert_string (&tmp, Charset, "utf-8", M_ICONV_HOOK_FROM) == -1)
 
73
 
 
74
    /* we don't want charset-hook effects, so we set flags to 0 */
 
75
    if (mutt_convert_string (&tmp, Charset, "utf-8", 0) == -1)
72
76
      irrev = 1;
73
77
    if (!irrev && idna_to_ascii_8z (tmp, &t2, 1) != IDNA_SUCCESS)
74
78
      irrev = 1;
106
110
    return -1;
107
111
  }
108
112
  
109
 
  if (mutt_convert_string (&tmp, Charset, "utf-8", M_ICONV_HOOK_FROM) == -1)
 
113
  /* we don't want charset-hook effects, so we set flags to 0 */
 
114
  if (mutt_convert_string (&tmp, Charset, "utf-8", 0) == -1)
110
115
    rv = -1;
111
116
  if (!rv && idna_to_ascii_8z (tmp, out, 1) != IDNA_SUCCESS)
112
117
    rv = -2;