diff options
| author | Federico G. Schwindt <fgsch@lodoss.net> | 2013-04-20 10:53:16 +0100 |
|---|---|---|
| committer | Federico G. Schwindt <fgsch@lodoss.net> | 2013-04-20 10:53:16 +0100 |
| commit | 51e5ba94b3f28f84aadc140f0c340d03d2a11d6c (patch) | |
| tree | 8af3faf8c2f81ee97cbac20d43035c1efa07d8dc | |
| parent | b4d0a4038398c23d015bd3faf6247a0dd91016a9 (diff) | |
| download | ngircd-51e5ba94b3f28f84aadc140f0c340d03d2a11d6c.tar.gz ngircd-51e5ba94b3f28f84aadc140f0c340d03d2a11d6c.zip | |
Ensure there is enough space for the mask
As pointed by Alex while strl{cat,cpy} take the full length
we need to leave space to ensure a proper mask is always created
so revert the removal of - N from my last change.
| -rw-r--r-- | src/ngircd/lists.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ngircd/lists.c b/src/ngircd/lists.c index d98dc6c8..b0accd41 100644 --- a/src/ngircd/lists.c +++ b/src/ngircd/lists.c @@ -279,16 +279,16 @@ Lists_MakeMask(const char *Pattern, char *mask, size_t len) if (!at && !excl) { /* Neither "!" nor "@" found: use string as nickname */ - strlcpy(mask, Pattern, len); + strlcpy(mask, Pattern, len - 5); strlcat(mask, "!*@*", len); } else if (!at && excl) { /* Domain part is missing */ - strlcpy(mask, Pattern, len); + strlcpy(mask, Pattern, len - 3); strlcat(mask, "@*", len); } else if (at && !excl) { /* User name is missing */ *at = '\0'; at++; - strlcpy(mask, Pattern, len); + strlcpy(mask, Pattern, len - 5); strlcat(mask, "!*@", len); strlcat(mask, at, len); } else { |