ret = request_sync_cmd ( PLUGIN_SYNC_CMD_CAPABILITY, &in, &out );
if ( ret == PLUGIN_CMD_SUCCESS ) {
- strncpy ( out_buf, out.array_of_parameter[0].v_string.data, out_len - 1 );
- out_buf[out_len - 1] = '\0';
- success = 1;
+ if(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;
+ }
release_parameters ( &out );
D ("request capability success : %s\n", out_buf);
ret = request_sync_cmd ( cmd, &in, &out );
if ( ret == PLUGIN_CMD_SUCCESS ) {
- strncpy ( out_buf, out.array_of_parameter[0].v_string.data, out_len - 1 );
- out_buf[out_len - 1] = '\0';
- success = 1;
+ if(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;
+ }
release_parameters ( &out );
}
ret = plugin_sync_proc ( cmd, &in, &out );
if ( ret == PLUGIN_CMD_SUCCESS ) {
- strncpy ( out_buf, out.array_of_parameter[0].v_string.data, out_len - 1 );
- out_buf[out_len - 1] = '\0';
- success = 1;
+ if(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;
+ }
release_parameters ( &out );
}
full_cmd[ENV_BUF_MAX - 1] = '\0';
}
else {
- strcat(full_cmd, cmd_name);
+ strncat(full_cmd, cmd_name, strlen(cmd_name));
}
int i = 1;
if (strlen(full_cmd) + strlen(tokens[i]) + 1 >= ENV_BUF_MAX) {
break;
}
- strcat(full_cmd, " ");
- strcat(full_cmd, tokens[i]);
+ strncat(full_cmd, " ",1);
+ strncat(full_cmd, tokens[i], strlen(tokens[i]));
}
D("full extcmd: %s\n", full_cmd);
if (!strcmp(exec_type, "sync")) {