match: assert mask_match mask is not too long
This commit is contained in:
parent
57fbf05388
commit
7741039058
1 changed files with 5 additions and 1 deletions
|
@ -144,12 +144,16 @@ int mask_match(const char *mask_, const char *name)
|
||||||
static char mask[BUFSIZE];
|
static char mask[BUFSIZE];
|
||||||
const char *m = mask, *n = name;
|
const char *m = mask, *n = name;
|
||||||
const char *m_tmp = mask, *n_tmp = name;
|
const char *m_tmp = mask, *n_tmp = name;
|
||||||
|
size_t len;
|
||||||
int star_p;
|
int star_p;
|
||||||
|
|
||||||
s_assert(mask_ != NULL);
|
s_assert(mask_ != NULL);
|
||||||
s_assert(name != NULL);
|
s_assert(name != NULL);
|
||||||
|
|
||||||
rb_strlcpy(mask, mask_, sizeof mask);
|
len = rb_strlcpy(mask, mask_, sizeof mask);
|
||||||
|
s_assert(len < sizeof mask);
|
||||||
|
(void) len; /* for NDEBUG */
|
||||||
|
|
||||||
match_arrange_stars(mask);
|
match_arrange_stars(mask);
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
|
|
Loading…
Reference in a new issue