From 2f176766861d9f6e2c4a8c2b5bdc62173ff9ef96 Mon Sep 17 00:00:00 2001 From: wuminjie Date: Fri, 26 Apr 2024 11:02:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E5=91=8A=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wuminjie --- .../source/samgr_mini_ipc_adapter.c | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/samgr_endpoint/source/samgr_mini_ipc_adapter.c b/samgr_endpoint/source/samgr_mini_ipc_adapter.c index 57f31b5..e94d07a 100644 --- a/samgr_endpoint/source/samgr_mini_ipc_adapter.c +++ b/samgr_endpoint/source/samgr_mini_ipc_adapter.c @@ -151,23 +151,24 @@ static void GetRemotePolicy(IpcIo *reply, PolicyTrans **policy, uint32 *policyNu return; } for (uint32 i = 0; i < *policyNum; i++) { - if (ReadInt32(reply, &(*policy)[i].type)) { - switch ((*policy)[i].type) { - case RANGE: - ReadInt32(reply, &((*policy)[i].uidMin)); - ReadInt32(reply, &((*policy)[i].uidMax)); - break; - case FIXED: - for (uint32 j = 0; j < UID_SIZE; j++) { - ReadInt32(reply, &((*policy)[i].fixedUid[j])); - } - break; - case BUNDLENAME: - ReadInt32(reply, &((*policy)[i].fixedUid[0])); - break; - default: - break; - } + if (!ReadInt32(reply, &(*policy)[i].type)) { + continue; } + switch ((*policy)[i].type) { + case RANGE: + ReadInt32(reply, &((*policy)[i].uidMin)); + ReadInt32(reply, &((*policy)[i].uidMax)); + break; + case FIXED: + for (uint32 j = 0; j < UID_SIZE; j++) { + ReadInt32(reply, &((*policy)[i].fixedUid[j])); + } + break; + case BUNDLENAME: + ReadInt32(reply, &((*policy)[i].fixedUid[0])); + break; + default: + break; + } } } \ No newline at end of file -- Gitee