[Commits] SDL: Fixed bug 3947 - replace strlcpy with memcpy in SDL_strdup()

libsdl.org revision control commits-owner at libsdl.org
Tue Feb 13 08:13:32 PST 2018


details:   https://hg.libsdl.org/SDL/rev/68864895c386
changeset: 11869:68864895c386
user:      Sam Lantinga <slouken at libsdl.org>
date:      Tue Feb 13 08:13:29 2018 -0800
description:
Fixed bug 3947 - replace strlcpy with memcpy in SDL_strdup()

diffstat:

 src/stdlib/SDL_string.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 5ec7bc5b3d12 -r 68864895c386 src/stdlib/SDL_string.c
--- a/src/stdlib/SDL_string.c	Tue Feb 13 08:07:52 2018 -0800
+++ b/src/stdlib/SDL_string.c	Tue Feb 13 08:13:29 2018 -0800
@@ -564,7 +564,7 @@
     size_t len = SDL_strlen(string) + 1;
     char *newstr = SDL_malloc(len);
     if (newstr) {
-        SDL_strlcpy(newstr, string, len);
+        SDL_memcpy(newstr, string, len);
     }
     return newstr;
 }


More information about the commits mailing list