sync the patch from master to 2403

This commit is contained in:
Wang_M 2024-09-06 06:23:38 +00:00
parent eb36b808e5
commit 2772524cf2
2 changed files with 31 additions and 3 deletions

View File

@ -0,0 +1,27 @@
From abedc1848cf6305f2c1f20078710755c66415d2d Mon Sep 17 00:00:00 2001
From: folkert van heusden <mail@vanheusden.com>
Date: Tue, 30 Jan 2024 15:33:20 +0100
Subject: [PATCH] Fix for https://github.com/sahlberg/libiscsi/issues/409
'ms->pages' was not checked for being NULL. This can happen when a target
does not return any pages.
---
test-tool/iscsi-support.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test-tool/iscsi-support.c b/test-tool/iscsi-support.c
index 169d2b0..ea9f711 100644
--- a/test-tool/iscsi-support.c
+++ b/test-tool/iscsi-support.c
@@ -2740,7 +2740,7 @@ int set_swp(struct scsi_device *sdev)
logging(LOG_VERBOSE, "[SUCCESS] CONTROL page fetched.");
ms = scsi_datain_unmarshall(sense_task);
- if (ms == NULL) {
+ if (ms == NULL || ms->pages == NULL) {
logging(LOG_NORMAL, "failed to unmarshall mode sense datain "
"blob");
ret = -1;
--
2.27.0

View File

@ -29,10 +29,11 @@ Patch20: 0020-Check-return-value-of-scsi_malloc-in-order-to.patch
Patch21: 0021-Fix-segmentation-fault-problem.patch
Patch22: 0022-init-fix-memory-leak-in-iscsi_create_context.patch
Patch23: 0023-iscsi-command-Fix-leak-in-iscsi_send_data_out.patch
Patch24: 0024-fix-segmentation-fault.patch
Source: https://github.com/sahlberg/%{name}/archive/%{version}.tar.gz
BuildRequires: gcc
BuildRequires: gcc
BuildRequires: autoconf automake libtool popt-devel CUnit-devel libgcrypt-devel rdma-core-devel chrpath
%description
@ -130,8 +131,8 @@ This package contains utilities of %{name} to connect to iSCSI targets
%{_bindir}/iscsi-test-cu
%changelog
* Wed Jul 31 2024 JiangJianJun <jiangjianjun3@huawei.com> - 1.19.0-11
- DESC: fix spec format
* Thu Aug 8 2024 yanshuai <yanshuai01@kylinos.cn> - 1.19.0-11
- DESC: fix segmentation fault
* Wed Mar 22 2023 Wenchao Hao <haowenchao2@huawei.com> - 1.19.0-10
- DESC: backport patch to fix some memory leak issues