Commit 491856cb authored by Thomas Roessler's avatar Thomas Roessler

Fix a strtok NULL pointer problem.

parent 458307e7
......@@ -718,15 +718,17 @@ BODY *pgp_make_key_attachment (char *tempf)
static LIST *pgp_add_string_to_hints (LIST *hints, const char *str)
{
char *scratch = safe_strdup (str);
char *scratch;
char *t;
t = strtok (scratch, " ,.:\"()<>\n");
while (t)
if ((scratch = safe_strdup (str)) == NULL)
return hints;
for (t = strtok (scratch, " ,.:\"()<>\n"); t;
t = strtok (NULL, " ,.:\"()<>\n"))
{
if (strlen (t) > 3)
hints = mutt_add_list (hints, t);
t = strtok (NULL, " ,.:\"()<>\n");
}
safe_free ((void **) &scratch);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment