diff options
author | Nigel Croxon <ncroxon@redhat.com> | 2021-08-17 15:14:48 +0200 |
---|---|---|
committer | Jes Sorensen <jsorensen@fb.com> | 2021-10-08 17:49:54 +0200 |
commit | 5f6dedfb86d616a7f340e2627f4bbc1e58b63e15 (patch) | |
tree | 1b715bbfcdd1a3e1d8df70225b9907868bb264ee | |
parent | disallow create or grow clustered bitmap with writemostly set (diff) | |
download | mdadm-5f6dedfb86d616a7f340e2627f4bbc1e58b63e15.tar.xz mdadm-5f6dedfb86d616a7f340e2627f4bbc1e58b63e15.zip |
Fix potential overlap dest buffer
To meet requirements of Common Criteria certification vulnerablility
assessment. Static code analysis has been run and found the following
error. Overlapping_buffer: The source buffer potentially overlaps
with the destination buffer, which results in undefined
behavior for "memcpy".
The change is to use memmove instead of memcpy.
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
-rw-r--r-- | sha1.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; } |