From 53cb12b4d084bc085fd2b22db886cc172b74e59c Mon Sep 17 00:00:00 2001 From: NHOrus Date: Sat, 8 Jul 2017 22:06:23 +0300 Subject: [PATCH] Bound the sizes of strcpy. --- actions.c | 2 +- main.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/actions.c b/actions.c index 0aa7d93..80e534b 100644 --- a/actions.c +++ b/actions.c @@ -1114,7 +1114,7 @@ static int say(struct command_t *command) { if (command->wd2 > 0) { command->wd1 = command->wd2; - strcpy(command->raw1, command->raw2); + strncpy(command->raw1, command->raw2, LINESIZE - 1); } char word1[TOKLEN + 1]; packed_to_token(command->wd1, word1); diff --git a/main.c b/main.c index c3fc353..6457d05 100644 --- a/main.c +++ b/main.c @@ -1197,7 +1197,7 @@ Laction: case GO_WORD2: /* Get second word for analysis. */ command.wd1 = command.wd2; - strcpy(command.raw1, command.raw2); + strncpy(command.raw1, command.raw2, LINESIZE - 1); wordclear(&command.wd2); command.raw2[0] = '\0'; goto L2620; -- 2.31.1