!15 Fix CVE-2023-0437

From: @wk333 
Reviewed-by: @wang--ge 
Signed-off-by: @wang--ge
This commit is contained in:
openeuler-ci-bot 2024-01-16 02:03:54 +00:00 committed by Gitee
commit be4550d3e6
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 32 additions and 1 deletions

27
CVE-2023-0437.patch Normal file
View File

@ -0,0 +1,27 @@
From be865dd759a28aa268232766f304d1bc11f1e8f7 Mon Sep 17 00:00:00 2001
From: Kevin Albertson <kevin.albertson@mongodb.com>
Date: Mon, 30 Oct 2023 18:01:30 +0000
Subject: [PATCH] CDRIVER-4747 use `size_t` consistently in
`bson_utf8_validate` (#1458)
Origin: https://github.com/mongodb/mongo-c-driver/commit/be865dd759a28aa268232766f304d1bc11f1e8f7
---
src/libbson/src/bson/bson-utf8.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/libbson/src/bson/bson-utf8.c b/src/libbson/src/bson/bson-utf8.c
index e122ac31f7..1cebd27069 100644
--- a/src/libbson/src/bson/bson-utf8.c
+++ b/src/libbson/src/bson/bson-utf8.c
@@ -118,8 +118,8 @@ bson_utf8_validate (const char *utf8, /* IN */
bson_unichar_t c;
uint8_t first_mask;
uint8_t seq_length;
- unsigned i;
- unsigned j;
+ size_t i;
+ size_t j;
BSON_ASSERT (utf8);

View File

@ -2,10 +2,11 @@
Name: mongo-c-driver
Summary: Client library written in C for MongoDB
Version: 1.13.1
Release: 6
Release: 7
License: ASL 2.0 and ISC and MIT and zlib
URL: https://github.com/mongodb/mongo-c-driver
Source0: https://github.com/mongodb/mongo-c-driver/releases/download/1.13.1/mongo-c-driver-1.13.1.tar.gz
Patch0: CVE-2023-0437.patch
BuildRequires: cmake >= 3.1 openssl-devel pkgconfig(libsasl2) pkgconfig(zlib) gcc
BuildRequires: pkgconfig(snappy) pkgconfig(icu-uc) perl-interpreter python3 python3-sphinx
BuildRequires: chrpath
@ -121,6 +122,9 @@ exit $ret
%doc NEWS
%changelog
* Tue Jan 16 2024 wangkai <13474090681@163.com> - 1.13.1-7
- Fix CVE-2023-0437
* Thu Aug 25 2022 wangkai <wangkai385@h-partners.com> - 1.13.1-6
- Remove rpath