aboutsummaryrefslogtreecommitdiffstats
path: root/FICS
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2026-04-08 00:31:12 +0200
committerMarkus Uhlin <markus@nifty-networks.net>2026-04-08 00:31:12 +0200
commit51cd6586d5fee35756135e2d930feeffa41b2b3e (patch)
tree5f9e6fadd8020bc443974b14c9ae8212b13a6cb2 /FICS
parent81d5b8cce7588fd69f12f171790a0e6ea8ddf568 (diff)
com_handles: check the player dir
Diffstat (limited to 'FICS')
-rw-r--r--FICS/comproc.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/FICS/comproc.c b/FICS/comproc.c
index cd7d6bb..1a395ca 100644
--- a/FICS/comproc.c
+++ b/FICS/comproc.c
@@ -2062,9 +2062,14 @@ com_handles(int p, param_list param)
{
char *buffer[1000] = { NULL };
char pdir[MAX_FILENAME_SIZE] = { '\0' };
- int count;
+ int count, ret;
- snprintf(pdir, sizeof pdir, "%s/%c", player_dir, param[0].val.word[0]);
+ ret = snprintf(pdir, sizeof pdir, "%s/%c", player_dir,
+ param[0].val.word[0]);
+ if (is_too_long(ret, sizeof pdir)) {
+ warnx("%s: player dir too long", __func__);
+ return COM_FAILED;
+ }
count = search_directory(pdir, param[0].val.word, buffer,
ARRAY_SIZE(buffer));