sg3_utils/0004-sg3_utils-fix-memset-coredump.patch
2021-11-04 09:58:05 +08:00

30 lines
906 B
Diff

From dd2a61c9551ac5d2ac0c5902172fd8312edc22cb Mon Sep 17 00:00:00 2001
From: yanglongkang <yanglongkang@huawei.com>
Date: Tue, 9 Feb 2021 11:39:32 +0800
Subject: [PATCH] sg3_utils: fix memset coredump
alloc MX_ALLOC_LEN size mem to enc_stat_rsp for
solving coredump problem.
Signed-off-by: yanglongkang <yanglongkang@huawei.com>
---
src/sg_ses.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/sg_ses.c b/src/sg_ses.c
index 23fc3b9..cf344b7 100644
--- a/src/sg_ses.c
+++ b/src/sg_ses.c
@@ -5582,7 +5582,7 @@ main(int argc, char * argv[])
enumerate_work(op);
goto early_out;
}
- enc_stat_rsp = sg_memalign(op->maxlen, 0, &free_enc_stat_rsp, false);
+ enc_stat_rsp = sg_memalign(MX_ALLOC_LEN, 0, &free_enc_stat_rsp, false);
if (NULL == enc_stat_rsp) {
pr2serr("Unable to get heap for enc_stat_rsp\n");
goto err_out;
--
1.8.3.1