From 834d524b6cd5f96d8c70eb241d9cb03c622e0dd2 Mon Sep 17 00:00:00 2001 From: res Date: Mon, 17 Dec 2007 03:58:51 +0000 Subject: [PATCH] use strlcpy() instead of strcpy() git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7810 d7cf8633-e32d-0410-b094-e92efae38249 --- zone.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/zone.c b/zone.c index a945a850..2ab390bd 100644 --- a/zone.c +++ b/zone.c @@ -561,9 +561,10 @@ void MemStats_f(void) char* Mem_strdup (mempool_t *pool, const char* s) { char* p; + size_t sz = strlen (s) + 1; if (s == NULL) return NULL; - p = (char*)Mem_Alloc (pool, strlen (s) + 1); - strcpy (p, s); + p = (char*)Mem_Alloc (pool, sz); + strlcpy (p, s, sz); return p; } -- 2.39.2