summaryrefslogtreecommitdiff
path: root/linux_priv.c
diff options
context:
space:
mode:
authorQu Chen <quchen@amazon.com>2022-08-13 12:27:07 -0700
committerdormando <dormando@rydia.net>2022-08-24 22:35:33 -0700
commitcfe751ef9fa05b19ec70d4314718d1b3df23f38c (patch)
treea1771d8aded8da0f3fd0319ee4d7d642bce643af /linux_priv.c
parent4c919bd2e7eae0cc436c62780fd6294f028b3525 (diff)
downloadmemcached-cfe751ef9fa05b19ec70d4314718d1b3df23f38c.tar.gz
Do memory bound check for some C string operations
Diffstat (limited to 'linux_priv.c')
-rw-r--r--linux_priv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/linux_priv.c b/linux_priv.c
index a8283db..8d132c8 100644
--- a/linux_priv.c
+++ b/linux_priv.c
@@ -49,7 +49,7 @@ static const struct sigaction act = {
void setup_privilege_violations_handler(void) {
kill_msg = malloc(strlen(KILL_MSG_STR)+1);
- strcpy(kill_msg, KILL_MSG_STR);
+ strncpy(kill_msg, KILL_MSG_STR, strlen(KILL_MSG_STR)+1);
sigaction(SIGSYS, &act, NULL);
}