ecore_con: Check for the valid port number

Summary:
This patch checks whether the port number is valid or not.
The valid port number is an unsigned 16-bit integer, so 1-65535.
0 is reserved already.

Test Plan: Execute test suite

Reviewers: cedric, raster, stefan, Jaehyun_Cho

Reviewed By: raster

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D5761
This commit is contained in:
Myoungwoon Roy, Kim 2018-01-25 13:22:56 +09:00 committed by Carsten Haitzler (Rasterman)
parent 426ccba6bd
commit 1837253935
1 changed files with 2 additions and 0 deletions

View File

@ -1671,6 +1671,8 @@ ecore_con_server_add(Ecore_Con_Type compl_type,
Eo *loop;
EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);
/* The allowable port number is an unsigned 16-bit integer, so 1-65535, 0 is reserved */
if (port < 0 || port > 65535) return NULL;
type = compl_type & ECORE_CON_TYPE;