telnet_init_dynif: don't allow negative port

Binding to a negative port should not be allowed.
Using signed value for unsigned parameter is a mistake to begin with.

Change-Id: I24f957641f2d8e230ccceb331a719496df0fdb1f
This commit is contained in:
Max 2022-12-03 17:10:42 +03:00 committed by msuraev
parent 6d261343fa
commit af35eb203c
1 changed files with 3 additions and 0 deletions

View File

@ -80,6 +80,9 @@ int telnet_init_dynif(void *tall_ctx, void *priv, const char *ip, int port)
{
int rc;
if (port < 0)
return -EINVAL;
tall_telnet_ctx = talloc_named_const(tall_ctx, 1,
"telnet_connection");