Skip to content
Snippets Groups Projects
Commit f6e9c1c9 authored by Nick Clifton's avatar Nick Clifton
Browse files

Fix potentially undefined behaviour when computing a sha1 value.

libiberty/
	* sha1.c (sha1_process_bytes): Use memmove in place of memcpy.
parent 408d1370
No related merge requests found
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment