From 8caea95a1d8c7f08423765807b0c4af8dc3a9b74 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 12 Oct 2014 17:58:11 +0200 Subject: [PATCH] (rzlib) Avoid strcpy --- deps/rzlib/gzlib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deps/rzlib/gzlib.c b/deps/rzlib/gzlib.c index def6cf7ab5..9577c125b6 100644 --- a/deps/rzlib/gzlib.c +++ b/deps/rzlib/gzlib.c @@ -209,7 +209,7 @@ local gzFile gz_open(const void *path, int fd, const char *mode) #if !defined(NO_snprintf) && !defined(NO_vsnprintf) snprintf(state->path, len + 1, "%s", (const char *)path); #else - strcpy(state->path, path); + strlcpy(state->path, path, sizeof(state->path)); #endif /* compute the flags for open() */ @@ -575,7 +575,7 @@ void ZLIB_INTERNAL gz_error(gz_statep state, int err, const char *msg) snprintf(state->msg, strlen(state->path) + strlen(msg) + 3, "%s%s%s", state->path, ": ", msg); #else - strcpy(state->msg, state->path); + strlcpy(state->msg, state->path, sizeof(state->msg)); strcat(state->msg, ": "); strcat(state->msg, msg); #endif