• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

neomutt / neomutt / 24648356273

18 Apr 2026 01:24PM UTC coverage: 42.851% (+0.5%) from 42.375%
24648356273

push

github

flatcap
merge: fix security issues

Raised by evilrabbit on Mutt devel mailing list.

 * security: fix GSSAPI buffer underflow on short unwrapped tokens
 * security: reject percent-encoded NUL bytes in URL decoding
 * security: skip CN fallback when SAN dNSName entries exist (RFC6125)
 * security: cap POP3 UIDL responses to prevent OOM from malicious server

3 of 7 new or added lines in 2 files covered. (42.86%)

3465 existing lines in 53 files now uncovered.

12428 of 29003 relevant lines covered (42.85%)

5272.14 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

95.45
/pattern/module.c
1
/**
2
 * @file
3
 * Definition of the Pattern Module
4
 *
5
 * @authors
6
 * Copyright (C) 2025-2026 Richard Russon <rich@flatcap.org>
7
 *
8
 * @copyright
9
 * This program is free software: you can redistribute it and/or modify it under
10
 * the terms of the GNU General Public License as published by the Free Software
11
 * Foundation, either version 2 of the License, or (at your option) any later
12
 * version.
13
 *
14
 * This program is distributed in the hope that it will be useful, but WITHOUT
15
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16
 * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
17
 * details.
18
 *
19
 * You should have received a copy of the GNU General Public License along with
20
 * this program.  If not, see <http://www.gnu.org/licenses/>.
21
 */
22

23
/**
24
 * @page pattern_module Definition of the Pattern Module
25
 *
26
 * Definition of the Pattern Module
27
 */
28

29
#include "config.h"
30
#include <stdbool.h>
31
#include <stddef.h>
32
#include "private.h"
33
#include "mutt/lib.h"
34
#include "config/lib.h"
35
#include "core/lib.h"
36
#include "module_data.h"
37

38
extern struct ConfigDef PatternVars[];
39

40
/**
41
 * pattern_init - Initialise a Module - Implements Module::init()
42
 */
43
static bool pattern_init(struct NeoMutt *n)
649✔
44
{
45
  struct PatternModuleData *mod_data = MUTT_MEM_CALLOC(1, struct PatternModuleData);
649✔
46

47
  // clang-format off
48
  mod_data->range_regexes[RANGE_K_REL]  = (struct RangeRegex){ RANGE_REL_RX,  1, 3, 0, { 0 } };
649✔
49
  mod_data->range_regexes[RANGE_K_ABS]  = (struct RangeRegex){ RANGE_ABS_RX,  1, 3, 0, { 0 } };
649✔
50
  mod_data->range_regexes[RANGE_K_LT]   = (struct RangeRegex){ RANGE_LT_RX,   1, 2, 0, { 0 } };
649✔
51
  mod_data->range_regexes[RANGE_K_GT]   = (struct RangeRegex){ RANGE_GT_RX,   2, 1, 0, { 0 } };
649✔
52
  mod_data->range_regexes[RANGE_K_BARE] = (struct RangeRegex){ RANGE_BARE_RX, 1, 1, 0, { 0 } };
649✔
53
  // clang-format on
54

55
  neomutt_set_module_data(n, MODULE_ID_PATTERN, mod_data);
649✔
56

57
  mod_data->notify = notify_new();
649✔
58
  notify_set_parent(mod_data->notify, n->notify);
649✔
59

60
  return true;
649✔
61
}
62

63
/**
64
 * pattern_config_define_variables - Define the Config Variables - Implements Module::config_define_variables()
65
 */
66
static bool pattern_config_define_variables(struct NeoMutt *n, struct ConfigSet *cs)
649✔
67
{
68
  return cs_register_variables(cs, PatternVars);
649✔
69
}
70

71
/**
72
 * pattern_cleanup - Clean up a Module - Implements Module::cleanup()
73
 */
74
static bool pattern_cleanup(struct NeoMutt *n)
648✔
75
{
76
  struct PatternModuleData *mod_data = neomutt_get_module_data(n, MODULE_ID_PATTERN);
648✔
77
  ASSERT(mod_data);
648✔
78

79
  notify_free(&mod_data->notify);
648✔
80

81
  for (int i = 0; i < RANGE_K_INVALID; i++)
3,888✔
82
  {
83
    if (mod_data->range_regexes[i].ready)
3,240✔
UNCOV
84
      regfree(&mod_data->range_regexes[i].cooked);
×
85
  }
86

87
  FREE(&mod_data);
648✔
88
  return true;
648✔
89
}
90

91
/**
92
 * ModulePattern - Module for the Pattern library
93
 */
94
const struct Module ModulePattern = {
95
  MODULE_ID_PATTERN,
96
  "pattern",
97
  pattern_init,
98
  NULL, // config_define_types
99
  pattern_config_define_variables,
100
  NULL, // commands_register
101
  NULL, // gui_init
102
  NULL, // gui_cleanup
103
  pattern_cleanup,
104
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc