From e5193f7cfc63bed18795b195a1b86a959638a5bf Mon Sep 17 00:00:00 2001 From: dartraiden Date: Thu, 20 Aug 2020 16:00:06 +0300 Subject: libcurl: update to 7.72.0 --- libs/libcurl/src/strdup.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'libs/libcurl/src/strdup.c') diff --git a/libs/libcurl/src/strdup.c b/libs/libcurl/src/strdup.c index 1ab10fd644..7732802b07 100644 --- a/libs/libcurl/src/strdup.c +++ b/libs/libcurl/src/strdup.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -39,19 +39,14 @@ char *curlx_strdup(const char *str) if(!str) return (char *)NULL; - len = strlen(str); + len = strlen(str) + 1; - if(len >= ((size_t)-1) / sizeof(char)) - return (char *)NULL; - - newstr = malloc((len + 1)*sizeof(char)); + newstr = malloc(len); if(!newstr) return (char *)NULL; - memcpy(newstr, str, (len + 1)*sizeof(char)); - + memcpy(newstr, str, len); return newstr; - } #endif -- cgit v1.2.3