From 44e0456766dc84ff9c1922af22b79815b5ef0668 Mon Sep 17 00:00:00 2001 From: Patrick Caulfield Date: Fri, 6 Oct 2006 10:06:37 +0000 Subject: [PATCH] Use strncpy rather than strcpy --- daemons/clvmd/lvm-functions.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/daemons/clvmd/lvm-functions.c b/daemons/clvmd/lvm-functions.c index 9891b26d9..4452feb00 100644 --- a/daemons/clvmd/lvm-functions.c +++ b/daemons/clvmd/lvm-functions.c @@ -537,7 +537,8 @@ static void lvm2_log_fn(int level, const char *file, int line, if (level != _LOG_ERR && level != _LOG_FATAL) return; - strcpy(last_error, message); + strncpy(last_error, message, sizeof(last_error)); + last_error[sizeof(last_error)-1] = '\0'; } /* This checks some basic cluster-LVM configuration stuff */