~kevin8t8/mutt

f6fb5a17dbb74a4ec7cddde8268b56ec96cb4ca7 — Kevin McCarthy a month ago 5761113
Fix mutt_pattern_comp() to not segv on a NULL pattern string.

The change to mutt_parse_score() could now result in a NULL score
pattern if the user specified ''.  It might be possible for this to
happen elsewhere too, so just add a check at the top of
mutt_pattern_comp() to handle the case.
1 files changed, 6 insertions(+), 0 deletions(-)

M pattern.c
M pattern.c => pattern.c +6 -0
@@ 966,6 966,12 @@ pattern_t *mutt_pattern_comp (/* const */ char *s, int flags, BUFFER *err)
  char *buf;
  BUFFER ps;

  if (!s || !*s)
  {
    strfcpy (err->data, _("empty pattern"), err->dsize);
    return NULL;
  }

  mutt_buffer_init (&ps);
  ps.dptr = s;
  ps.dsize = mutt_strlen (s);