29 lines
789 B
Diff
29 lines
789 B
Diff
|
|
From 360bd43ff3c4e4938ee8af1a5ccf981152f7ca95 Mon Sep 17 00:00:00 2001
|
||
|
|
From: yangdepei <yangdepei@hygon.cn>
|
||
|
|
Date: Mon, 26 Aug 2024 15:40:25 +0800
|
||
|
|
Subject: [PATCH] hw/vfio/hct: fix ccp_index error caused by uninitialized buf
|
||
|
|
|
||
|
|
Signed-off-by: yangdepei <yangdepei@hygon.cn>
|
||
|
|
---
|
||
|
|
hw/vfio/hct.c | 4 ++--
|
||
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||
|
|
|
||
|
|
diff --git a/hw/vfio/hct.c b/hw/vfio/hct.c
|
||
|
|
index 790bb78439..9374e95e85 100644
|
||
|
|
--- a/hw/vfio/hct.c
|
||
|
|
+++ b/hw/vfio/hct.c
|
||
|
|
@@ -235,8 +235,8 @@ static int hct_check_duplicated_index(int index)
|
||
|
|
|
||
|
|
static int hct_get_ccp_index(HCTDevState *state)
|
||
|
|
{
|
||
|
|
- char path[PATH_MAX];
|
||
|
|
- char buf[CCP_INDEX_BYTES];
|
||
|
|
+ char path[PATH_MAX] = {0};
|
||
|
|
+ char buf[CCP_INDEX_BYTES] = {0};
|
||
|
|
int fd;
|
||
|
|
int ret;
|
||
|
|
int ccp_index;
|
||
|
|
--
|
||
|
|
2.41.0.windows.1
|
||
|
|
|