summaryrefslogtreecommitdiff
path: root/libs/libcurl/src/strdup.c
diff options
context:
space:
mode:
authordartraiden <wowemuh@gmail.com>2020-08-20 16:00:06 +0300
committerdartraiden <wowemuh@gmail.com>2020-08-20 16:00:06 +0300
commite5193f7cfc63bed18795b195a1b86a959638a5bf (patch)
tree556aaab722ebcdbd63c89d2ccabca5144c1537e2 /libs/libcurl/src/strdup.c
parentfb9c38570dbdb83d3c53b01f12326a97f7ba16e3 (diff)
libcurl: update to 7.72.0
Diffstat (limited to 'libs/libcurl/src/strdup.c')
-rw-r--r--libs/libcurl/src/strdup.c13
1 files changed, 4 insertions, 9 deletions
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, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, 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