mirror of
https://git.yoctoproject.org/poky
synced 2026-03-27 16:02:21 +01:00
curl: fix CVE-2023-32001
(From OE-Core rev: f6ab54c91d18d5ebb0c7e27e41f49fc17c9d8c1c) Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
This commit is contained in:
committed by
Steve Sakoman
parent
aa63b25cbe
commit
b2e02ea2be
39
meta/recipes-support/curl/curl/CVE-2023-32001.patch
Normal file
39
meta/recipes-support/curl/curl/CVE-2023-32001.patch
Normal file
@@ -0,0 +1,39 @@
|
||||
CVE: CVE-2023-32001
|
||||
Upstream-Status: Backport [https://github.com/curl/curl/commit/0c667188e0c6cda615a036b8a2b4125f2c404dde]
|
||||
Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com>
|
||||
|
||||
|
||||
From 0c667188e0c6cda615a036b8a2b4125f2c404dde Mon Sep 17 00:00:00 2001
|
||||
From: SaltyMilk <soufiane.elmelcaoui@gmail.com>
|
||||
Date: Mon, 10 Jul 2023 21:43:28 +0200
|
||||
Subject: [PATCH] fopen: optimize
|
||||
|
||||
Closes #11419
|
||||
---
|
||||
lib/fopen.c | 12 ++++++------
|
||||
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/lib/fopen.c b/lib/fopen.c
|
||||
index c9c9e3d6e73a2..b6e3cadddef65 100644
|
||||
--- a/lib/fopen.c
|
||||
+++ b/lib/fopen.c
|
||||
@@ -56,13 +56,13 @@ CURLcode Curl_fopen(struct Curl_easy *data, const char *filename,
|
||||
int fd = -1;
|
||||
*tempname = NULL;
|
||||
|
||||
- if(stat(filename, &sb) == -1 || !S_ISREG(sb.st_mode)) {
|
||||
- /* a non-regular file, fallback to direct fopen() */
|
||||
- *fh = fopen(filename, FOPEN_WRITETEXT);
|
||||
- if(*fh)
|
||||
- return CURLE_OK;
|
||||
+ *fh = fopen(filename, FOPEN_WRITETEXT);
|
||||
+ if(!*fh)
|
||||
goto fail;
|
||||
- }
|
||||
+ if(fstat(fileno(*fh), &sb) == -1 || !S_ISREG(sb.st_mode))
|
||||
+ return CURLE_OK;
|
||||
+ fclose(*fh);
|
||||
+ *fh = NULL;
|
||||
|
||||
result = Curl_rand_hex(data, randsuffix, sizeof(randsuffix));
|
||||
if(result)
|
||||
@@ -17,6 +17,7 @@ SRC_URI = " \
|
||||
file://CVE-2023-28319.patch \
|
||||
file://CVE-2023-28320.patch \
|
||||
file://CVE-2023-28321.patch \
|
||||
file://CVE-2023-32001.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "0a381cd82f4d00a9a334438b8ca239afea5bfefcfa9a1025f2bf118e79e0b5f0"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user