From 7c94d88ac779760e481d744fc917715db6b6544c Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Mon, 26 Feb 2007 21:39:25 +0000 Subject: [PATCH] sock_connect() returns with an error if the supplied host, port, or protocol is null or zero length --- citadel/clientsocket.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/citadel/clientsocket.c b/citadel/clientsocket.c index c90134f74..c2f992ed7 100644 --- a/citadel/clientsocket.c +++ b/citadel/clientsocket.c @@ -44,6 +44,13 @@ int sock_connect(char *host, char *service, char *protocol) struct sockaddr_in sin; int s, type; + if (host == NULL) return(-1); + if (strlen(host) == 0) return(-1); + if (service == NULL) return(-1); + if (strlen(service) == 0) return(-1); + if (protocol == NULL) return(-1); + if (strlen(protocol) == 0) return(-1); + memset(&sin, 0, sizeof(sin)); sin.sin_family = AF_INET; -- 2.39.2