From: Mark Wielaard <mark@klomp.org>
To: debugedit@sourceware.org
Cc: Mark Wielaard <mark@klomp.org>
Subject: [PATCH] Resync libiberty sha1.c
Date: Thu, 1 Jul 2021 16:51:14 +0200 [thread overview]
Message-ID: <20210701145114.327612-1-mark@klomp.org> (raw)
This brings in the following commit:
commit f6e9c1c9191c8b9998e03cb15de8600a2a4b9188
Author: Nick Clifton <nickc@redhat.com>
Date: Tue Mar 16 14:43:17 2021 +0000
Fix potentially undefined behaviour when computing a sha1 value.
libiberty/
* sha1.c (sha1_process_bytes): Use memmove in place of memcpy.
Signed-off-by: Mark Wielaard <mark@klomp.org>
---
tools/sha1.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/sha1.c b/tools/sha1.c
index e3d7f86..7d15d48 100644
--- a/tools/sha1.c
+++ b/tools/sha1.c
@@ -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;
}
--
2.32.0
reply other threads:[~2021-07-01 14:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210701145114.327612-1-mark@klomp.org \
--to=mark@klomp.org \
--cc=debugedit@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).