Fix potentially undefined behaviour when computing a sha1 value.

libiberty/
	* sha1.c (sha1_process_bytes): Use memmove in place of memcpy.
This commit is contained in:
Nick Clifton 2021-03-16 14:43:17 +00:00
parent 408d137027
commit f6e9c1c919
1 changed files with 1 additions and 1 deletions

View File

@ -258,7 +258,7 @@ sha1_process_bytes (const void *buffer, size_t len, struct sha1_ctx *ctx)
{
sha1_process_block (ctx->buffer, 64, ctx);
left_over -= 64;
memcpy (ctx->buffer, &ctx->buffer[16], left_over);
memmove (ctx->buffer, &ctx->buffer[16], left_over);
}
ctx->buflen = left_over;
}