(rzlib) Avoid strcpy

This commit is contained in:
twinaphex 2014-10-12 17:58:11 +02:00
parent b1e636a1ff
commit 8caea95a1d

4
deps/rzlib/gzlib.c vendored
View File

@ -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