summaryrefslogtreecommitdiff
path: root/libs/libcurl/src/strdup.c
diff options
context:
space:
mode:
authordartraiden <wowemuh@gmail.com>2025-04-21 09:33:29 +0300
committerdartraiden <wowemuh@gmail.com>2025-04-21 09:50:38 +0300
commitcf6ba06cd445f1f4554701637d5bab581acfba98 (patch)
tree0d9b618df1c8f888cb37221be0590f4a677fe477 /libs/libcurl/src/strdup.c
parent842ec200cd37ae05f2a9c56f2a4040088d2ac917 (diff)
libcurl: update to 8.13.0
Diffstat (limited to 'libs/libcurl/src/strdup.c')
-rw-r--r--libs/libcurl/src/strdup.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libs/libcurl/src/strdup.c b/libs/libcurl/src/strdup.c
index f3d8ed3846..e9f8535c6d 100644
--- a/libs/libcurl/src/strdup.c
+++ b/libs/libcurl/src/strdup.c
@@ -114,7 +114,10 @@ void *Curl_memdup0(const char *src, size_t length)
char *buf = malloc(length + 1);
if(!buf)
return NULL;
- memcpy(buf, src, length);
+ if(length) {
+ DEBUGASSERT(src); /* must never be NULL */
+ memcpy(buf, src, length);
+ }
buf[length] = 0;
return buf;
}