aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2024-08-04 00:19:47 +0200
committerMarkus Uhlin <markus@nifty-networks.net>2024-08-04 00:19:47 +0200
commitee5f8f670f4d7f82e47bcf75c53b91fca4b1a137 (patch)
tree0d9a616715ecfa8d6b5f8d11e88f1c8611dbdfef
parent22a1ccf7a3afa9c2e3e5565a5698bf970a748697 (diff)
Fixed possible buffer overflow
-rw-r--r--FICS/playerdb.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/FICS/playerdb.c b/FICS/playerdb.c
index b5f40d9..d9381e1 100644
--- a/FICS/playerdb.c
+++ b/FICS/playerdb.c
@@ -2431,10 +2431,13 @@ SaveThisMsg(int which, char *line)
char Sender[MAX_LOGIN_NAME] = { '\0' };
int p1;
+ _Static_assert(19 < ARRAY_SIZE(Sender), "Array too small");
+
if (which == 0)
return 1;
- sscanf(line, "%s", Sender);
+ if (sscanf(line, "%19s", Sender) != 1)
+ warnx("%s: failed to read sender");
if (which < 0) {
p1 = (-which) - 1;