diff --git a/samgr_endpoint/source/samgr_mini_ipc_adapter.c b/samgr_endpoint/source/samgr_mini_ipc_adapter.c index 57f31b5771dab2cb07e6c34dbd6cd866bd0513c5..e94d07a7da4ef87477cbf5fee952982e9048cdae 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