return PKGMGR_R_ERROR;
}
- if (service_type == PM_REQUEST_KILL_APP)
+ if (service_type == PM_REQUEST_KILL_APP) {
ret = pkgmgr_client_connection_send_request(client, "kill",
g_variant_new("(us)", uid, pkgid), &result);
- else if (service_type == PM_REQUEST_CHECK_APP)
+ } else if (service_type == PM_REQUEST_CHECK_APP) {
ret = pkgmgr_client_connection_send_request(client, "check",
g_variant_new("(us)", uid, pkgid), &result);
+ } else {
+ ERR("unexpected service type: %d", service_type);
+ ret = PKGMGR_R_ERROR;
+ }
+
if (ret != PKGMGR_R_OK) {
ERR("request failed: %d", ret);
return ret;
return FALSE;
}
+ if (type_len == 0) {
+ LOGE("invalid type_len");
+ close(clifd);
+ return FALSE;
+ }
+
/* get signal name (including terminating null byte) */
type_name = malloc(type_len);
memcpy(type_name, buf, type_len);