From cd37f2a84de39054d7f6633e8bf760e8c483bee3 Mon Sep 17 00:00:00 2001 From: Bang Kwang-Min Date: Thu, 9 May 2013 13:44:55 +0900 Subject: [PATCH] download_get_url() return wrong error with invalid id [issue#] failure in Tizen Compliance Tests [cause] if sql return empty string, client will meet socket timeout error [solution] add the checking the length of string Change-Id: I16e840326e4ba7ac7e6cd5451b5ae77b9a55e348 --- provider/download-provider-thread-request.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/provider/download-provider-thread-request.c b/provider/download-provider-thread-request.c index 195395b..e8262b2 100755 --- a/provider/download-provider-thread-request.c +++ b/provider/download-provider-thread-request.c @@ -974,7 +974,7 @@ void *dp_thread_requests_manager(void *arg) if (request == NULL) { int check_id = dp_db_get_int_column(command.id, DP_DB_TABLE_LOG, DP_DB_COL_ID); - if (check_id != command.id) { + if (check_id < 0 || check_id != command.id) { errorcode = DP_ERROR_ID_NOT_FOUND; TRACE_ERROR("[ERROR][%d][%s]", command.id, dp_print_errorcode(errorcode)); @@ -1155,6 +1155,8 @@ void *dp_thread_requests_manager(void *arg) break; } if (is_checked == 1) { + if (read_str == NULL || strlen(read_str) < 1) + errorcode = DP_ERROR_NO_DATA; dp_ipc_send_errorcode(sock, errorcode); if (errorcode == DP_ERROR_NONE) { dp_ipc_send_string(sock, read_str); -- 2.7.4