mirror of
https://github.com/curl/curl.git
synced 2026-08-25 23:23:31 +03:00
lib: strndup/memdup instead of malloc, memcpy and null-terminate
- bufref: use strndup - cookie: use strndup - formdata: use strndup - ftp: use strndup - gtls: use aprintf instead of malloc + strcpy * 2 - http: use strndup - mbedtls: use strndup - md4: use memdup - ntlm: use memdup - ntlm_sspi: use strndup - pingpong: use memdup - rtsp: use strndup instead of malloc, memcpy and null-terminate - sectransp: use strndup - socks_gssapi.c: use memdup - vtls: use dynbuf instead of malloc, snprintf and memcpy - vtls: use strdup instead of malloc + memcpy - wolfssh: use strndup Closes #12453
This commit is contained in:
parent
63cdaefbc3
commit
7309b9cbbf
16 changed files with 48 additions and 91 deletions
|
|
@ -194,11 +194,9 @@ static int MD4_Init(MD4_CTX *ctx)
|
|||
static void MD4_Update(MD4_CTX *ctx, const void *data, unsigned long size)
|
||||
{
|
||||
if(!ctx->data) {
|
||||
ctx->data = malloc(size);
|
||||
if(ctx->data) {
|
||||
memcpy(ctx->data, data, size);
|
||||
ctx->data = Curl_memdup(data, size);
|
||||
if(ctx->data)
|
||||
ctx->size = size;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue