It checked at the beginning before dereferencing, but not at the end.
Since lastp is only used for the user_hdrs case, move the local
variable and assignment inside that block to make it clear.
short do_2047, LIST **lastp)
{
int matched = 0;
- LIST *last = NULL;
-
- if (lastp)
- last = *lastp;
switch (ascii_tolower (line[0]))
{
/* Keep track of the user-defined headers */
if (!matched && user_hdrs)
{
+ LIST *last = NULL;
+
+ if (lastp)
+ last = *lastp;
+
/* restore the original line */
line[strlen (line)] = ':';
-
+
if (weed && option (OPTWEED) && mutt_matches_ignore (line, Ignore)
&& !mutt_matches_ignore (line, UnIgnore))
goto done;
last->data = safe_strdup (line);
if (do_2047)
rfc2047_decode (&last->data);
+
+ if (lastp)
+ *lastp = last;
}
done:
-
- *lastp = last;
return matched;
}