[CID-1103253] Fix bad bit shift operation 69/222769/1
authorSeonah Moon <seonah1.moon@samsung.com>
Mon, 20 Jan 2020 02:09:44 +0000 (11:09 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Mon, 20 Jan 2020 02:10:10 +0000 (11:10 +0900)
Change-Id: I91a989c5e6cac89bd64b97bf8ef835c0ac55fdce

provider/download-provider-client.c

index f5d8241..aa41601 100755 (executable)
@@ -1935,10 +1935,12 @@ void *dp_client_request_thread(void *arg)
                                CLIENT_MUTEX_UNLOCK(&slot->mutex);
                        }
                }
-       }
+       } // while (slot != NULL && client_sock >= 0 && ....)
 
-       FD_CLR(client_sock, &imask);
-       FD_CLR(client_sock, &emask);
+       if (client_sock >= 0 && client_sock < FD_SETSIZE) {
+               FD_CLR(client_sock, &imask);
+               FD_CLR(client_sock, &emask);
+       }
 
        // if no requests, clear slot after disconnect with client.
        CLIENT_MUTEX_LOCK(&slot->mutex);