TRACE_DEBUG_MSG("failed to read message header");
return -1;
}
- if (clientinfo->requestinfo->client_packagename.length > 1) {
+ if (clientinfo->requestinfo->client_packagename.length > 1
+ && clientinfo->requestinfo->client_packagename.length < DP_MAX_STR_LEN) {
clientinfo->requestinfo->client_packagename.str =
(char *)
calloc((clientinfo->requestinfo->client_packagename.length +
clientinfo->requestinfo->client_packagename.
str);
}
- if (clientinfo->requestinfo->url.length > 1) {
+ if (clientinfo->requestinfo->url.length > 1
+ && clientinfo->requestinfo->url.length < DP_MAX_URL_LEN) {
clientinfo->requestinfo->url.str =
(char *)calloc((clientinfo->requestinfo->url.length + 1),
sizeof(char));
TRACE_DEBUG_INFO_MSG("request url [%s]",
clientinfo->requestinfo->url.str);
}
- if (clientinfo->requestinfo->install_path.length > 1) {
+ if (clientinfo->requestinfo->install_path.length > 1
+ && clientinfo->requestinfo->install_path.length < DP_MAX_PATH_LEN) {
clientinfo->requestinfo->install_path.str =
(char *)
calloc((clientinfo->requestinfo->install_path.length + 1),
TRACE_DEBUG_INFO_MSG("request install_path [%s]",
clientinfo->requestinfo->install_path.str);
}
- if (clientinfo->requestinfo->filename.length > 1) {
+ if (clientinfo->requestinfo->filename.length > 1
+ && clientinfo->requestinfo->filename.length < DP_MAX_STR_LEN) {
clientinfo->requestinfo->filename.str =
(char *)
calloc((clientinfo->requestinfo->filename.length + 1),
TRACE_DEBUG_MSG("content [%s]", content);
// relatively unique
- if (title && clientinfo->downloadinfo->content_name) {
+ if (title) {
int title_length = strlen(title);
int content_name_length =
strlen(clientinfo->downloadinfo->content_name);
}
// Only when matched title.
if (checkInfo && content) {
+ checkInfo = false;
char *failed_content =
__get_string_status(DOWNLOAD_STATE_FAILED);
if (failed_content) {
if (!ongoing) {
// view the special viewer by contents
if (clientinfo->downloadinginfo
- && clientinfo->downloadinginfo->saved_path
+ && sizeof(clientinfo->downloadinginfo->saved_path) > 0
&& clientinfo->state == DOWNLOAD_STATE_FINISHED) {
if (service_set_operation
(clientinfo->service_handle,