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:
parent
408d137027
commit
f6e9c1c919
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user