ret = request_sync_cmd ( PLUGIN_SYNC_CMD_CAPABILITY, &in, &out );
if ( ret == PLUGIN_CMD_SUCCESS ) {
- if(out.array_of_parameter[0].v_string.data != NULL) {
+ if ( out.array_of_parameter != NULL && out.array_of_parameter[0].v_string.data != NULL) {
strncpy ( out_buf, out.array_of_parameter[0].v_string.data, out_len - 1 );
out_buf[out_len - 1] = '\0';
success = 1;
ret = request_sync_cmd ( cmd, &in, &out );
if ( ret == PLUGIN_CMD_SUCCESS ) {
- success = ( out.array_of_parameter[0].v_int32 == PLUGIN_RET_VALID ) ? 1 : 0;
- release_parameters ( &out );
+ if (out.array_of_parameter != NULL) {
+ success = ( out.array_of_parameter[0].v_int32 == PLUGIN_RET_VALID ) ? 1 : 0;
+ release_parameters ( &out );
+ }
D ("request validity success : %d\n", success);
}
out.array_of_parameter = NULL;
ret = plugin_sync_proc ( cmd, &in, &out );
if ( ret == PLUGIN_CMD_SUCCESS ) {
- success = ( out.array_of_parameter[0].v_int32 == PLUGIN_RET_VALID ) ? 1 : 0;
- release_parameters ( &out );
+ if (out.array_of_parameter != NULL) {
+ success = ( out.array_of_parameter[0].v_int32 == PLUGIN_RET_VALID ) ? 1 : 0;
+ release_parameters ( &out );
+ }
D ("request validity success : %d\n", success);
}
ret = request_sync_cmd ( cmd, &in, &out );
if ( ret == PLUGIN_CMD_SUCCESS ) {
- if(out.array_of_parameter[0].v_string.data != NULL) {
+ if(out.array_of_parameter != NULL && out.array_of_parameter[0].v_string.data != NULL) {
strncpy ( out_buf, out.array_of_parameter[0].v_string.data, out_len - 1 );
out_buf[out_len - 1] = '\0';
success = 1;
ret = plugin_sync_proc ( cmd, &in, &out );
if ( ret == PLUGIN_CMD_SUCCESS ) {
- if(out.array_of_parameter[0].v_string.data != NULL) {
+ if (out.array_of_parameter != NULL && out.array_of_parameter[0].v_string.data != NULL) {
strncpy ( out_buf, out.array_of_parameter[0].v_string.data, out_len - 1 );
out_buf[out_len - 1] = '\0';
success = 1;
ret = request_sync_cmd ( PLUGIN_SYNC_CMD_GET_LOCK_STATE, &in, &out );
if ( ret == PLUGIN_CMD_SUCCESS ) {
- if ( out.array_of_parameter[0].v_int32 == PLUGIN_RET_ON ) {
- result = 1;
- } else {
- result = 0;
- }
- is_pwlocked = result;
- release_parameters ( &out );
+ if (out.array_of_parameter != NULL) {
+ if ( out.array_of_parameter[0].v_int32 == PLUGIN_RET_ON ) {
+ result = 1;
+ } else {
+ result = 0;
+ }
+ is_pwlocked = result;
+ release_parameters ( &out );
+ }
}
release_parameters ( &in );
ret = request_sync_cmd ( cmd, &in, &out );
if ( ret == PLUGIN_CMD_SUCCESS ) {
- success = ( out.array_of_parameter[0].v_int32 == PLUGIN_RET_HANDLE ) ? 1 : 0;
- release_parameters ( &out );
+ if (out.array_of_parameter != NULL) {
+ success = ( out.array_of_parameter[0].v_int32 == PLUGIN_RET_HANDLE ) ? 1 : 0;
+ release_parameters ( &out );
+ }
D ("request command handling success : %d\n", success);
}
} else {
FILE *info_file = fopen(SDBD_BOOT_INFO_FILE, "w");
if (info_file != NULL) {
- fprintf(info_file, "%d", 1);
- fclose(info_file);
+ char* tmppath = realpath(SDBD_BOOT_INFO_FILE, NULL);
+ if (tmppath != NULL) {
+ if (strcmp(SDBD_BOOT_INFO_FILE, tmppath) == 0) {
+ fprintf(info_file, "%d", 1);
+ I("booting is done\n");
+ } else {
+ D("Path has symbolic link, security risk \n");
+ free(tmppath);
+ return;
+ }
+ free(tmppath);
+ } else {
+ D("Getting realpath failed\n");
+ }
+ fclose(info_file);
}
- I("booting is done\n");
}
I("handled the booting done signal\n");