/[packages]/updates/8/gnutls/current/SOURCES/gnutls-CVE-2021-4209.patch
ViewVC logotype

Contents of /updates/8/gnutls/current/SOURCES/gnutls-CVE-2021-4209.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1788846 - (show annotations) (download)
Sat Mar 5 08:20:38 2022 UTC (2 years, 1 month ago) by ns80
File size: 901 byte(s)
- add upstream patch for CVE-2021-4209 (mga#30112)

1 From 3db352734472d851318944db13be73da61300568 Mon Sep 17 00:00:00 2001
2 From: Daiki Ueno <ueno@gnu.org>
3 Date: Wed, 22 Dec 2021 09:12:25 +0100
4 Subject: [PATCH] wrap_nettle_hash_fast: avoid calling _update with zero-length
5 input
6
7 As Nettle's hash update functions internally call memcpy, providing
8 zero-length input may cause undefined behavior.
9
10 Signed-off-by: Daiki Ueno <ueno@gnu.org>
11 ---
12 lib/nettle/mac.c | 4 +++-
13 1 file changed, 3 insertions(+), 1 deletion(-)
14
15 diff --git a/lib/nettle/mac.c b/lib/nettle/mac.c
16 index f9d4d7a8df..35e070fab0 100644
17 --- a/lib/nettle/mac.c
18 +++ b/lib/nettle/mac.c
19 @@ -788,7 +788,9 @@ static int wrap_nettle_hash_fast(gnutls_digest_algorithm_t algo,
20 if (ret < 0)
21 return gnutls_assert_val(ret);
22
23 - ctx.update(&ctx, text_size, text);
24 + if (text_size > 0) {
25 + ctx.update(&ctx, text_size, text);
26 + }
27 ctx.digest(&ctx, ctx.length, digest);
28
29 return 0;
30 --
31 GitLab
32

  ViewVC Help
Powered by ViewVC 1.1.30