代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/libiscsi 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 8592dc58838872d0d49c3d773df950f0b3e1eb4b Mon Sep 17 00:00:00 2001
From: sallyjunjun <72725839+sallyjunjun@users.noreply.github.com>
Date: Tue, 31 May 2022 14:20:43 +0800
Subject: [PATCH 1/4] Update iscsi-dd.c
add check after malloc to avoid referencing an illegal pointer
---
examples/iscsi-dd.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/examples/iscsi-dd.c b/examples/iscsi-dd.c
index b2d41ac..1f7ae9f 100644
--- a/examples/iscsi-dd.c
+++ b/examples/iscsi-dd.c
@@ -131,6 +131,11 @@ void read_cb(struct iscsi_context *iscsi, int status, void *command_data, void *
}
wt = malloc(sizeof(struct write_task));
+ if (wt == NULL) {
+ fprintf(stderr, "failed to alloc write task\n");
+ exit(10);
+ }
+
wt->rt = task;
wt->client = client;
@@ -430,6 +435,11 @@ void cscd_ident_inq(struct iscsi_context *iscsi,
_tgt_desig->designator_type = tgt_desig->designator_type;
_tgt_desig->designator_length = tgt_desig->designator_length;
_tgt_desig->designator = malloc(tgt_desig->designator_length);
+ if (_tgt_desig->designator == NULL) {
+ fprintf(stderr, "failed to alloc designator\n");
+ exit(10);
+ }
+
memcpy(_tgt_desig->designator, tgt_desig->designator, tgt_desig->designator_length);
scsi_free_scsi_task(task);
--
1.8.3.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。