diff --git a/ChangeLog b/ChangeLog index bf70f905..6758cf35 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Tue Jul 8 14:15:07 CEST 2003 Daniel Veillard + + * nanoftp.c nanohttp.c: the modules should not import + directly, some cleanups + * xmlschemas.c: Peter Sobisch found a nasty bug in the Schemas + validation code. + Mon Jul 7 18:00:51 CEST 2003 Daniel Veillard * win32/configure.js: Jesse Pelton pointed out a problem in the diff --git a/nanoftp.c b/nanoftp.c index 16dc6f23..3c6257c8 100644 --- a/nanoftp.c +++ b/nanoftp.c @@ -68,7 +68,6 @@ #include #include #include -#include /* #define DEBUG_FTP 1 */ #ifdef STANDALONE @@ -125,7 +124,8 @@ static char *proxyPasswd = NULL;/* passwd for proxy authentication */ static int proxyType = 0; /* uses TYPE or a@b ? */ #ifdef SUPPORT_IP6 -static int have_ipv6() { +static +int have_ipv6(void) { int s; s = socket (AF_INET6, SOCK_STREAM, 0); @@ -1004,7 +1004,7 @@ xmlNanoFTPConnect(void *ctx) { struct hostent *hp; int port; int res; - int addrlen; + int addrlen = sizeof (struct sockaddr_in); if (ctxt == NULL) return(-1); @@ -1026,7 +1026,7 @@ xmlNanoFTPConnect(void *ctx) { #ifdef SUPPORT_IP6 if (have_ipv6 ()) { - struct addrinfo hints, *res, *result; + struct addrinfo hints, *tmp, *result; result = NULL; memset (&hints, 0, sizeof(hints)); @@ -1040,22 +1040,22 @@ xmlNanoFTPConnect(void *ctx) { if (getaddrinfo (ctxt->hostname, NULL, &hints, &result) != 0) return (-1); - for (res = result; res; res = res->ai_next) - if (res->ai_family == AF_INET || res->ai_family == AF_INET6) + for (tmp = result; tmp; tmp = tmp->ai_next) + if (tmp->ai_family == AF_INET || tmp->ai_family == AF_INET6) break; - if (res) { - if (res->ai_family == AF_INET6) { - memcpy (&ctxt->ftpAddr, res->ai_addr, res->ai_addrlen); + if (tmp) { + if (tmp->ai_family == AF_INET6) { + memcpy (&ctxt->ftpAddr, tmp->ai_addr, tmp->ai_addrlen); ((struct sockaddr_in6 *) &ctxt->ftpAddr)->sin6_port = htons (port); ctxt->controlFd = socket (AF_INET6, SOCK_STREAM, 0); } else { - memcpy (&ctxt->ftpAddr, res->ai_addr, res->ai_addrlen); + memcpy (&ctxt->ftpAddr, tmp->ai_addr, tmp->ai_addrlen); ((struct sockaddr_in *) &ctxt->ftpAddr)->sin_port = htons (port); ctxt->controlFd = socket (AF_INET, SOCK_STREAM, 0); } - addrlen = res->ai_addrlen; + addrlen = tmp->ai_addrlen; freeaddrinfo (result); } } @@ -1607,7 +1607,7 @@ xmlNanoFTPGetConnection(void *ctx) { char buf6[INET6_ADDRSTRLEN]; inet_ntop (AF_INET6, &((struct sockaddr_in6 *)&dataAddr)->sin6_addr, buf6, INET6_ADDRSTRLEN); - adp = buf6; + adp = (unsigned char *) buf6; portp = (unsigned char *) &((struct sockaddr_in6 *)&dataAddr)->sin6_port; snprintf (buf, sizeof(buf), "EPRT |2|%s|%s|\r\n", adp, portp); } else diff --git a/nanohttp.c b/nanohttp.c index c16cf0bc..0034a171 100644 --- a/nanohttp.c +++ b/nanohttp.c @@ -80,7 +80,6 @@ #include #include #include -#include /** * A couple portability macros @@ -154,7 +153,8 @@ static int socket_errno(void) { } #ifdef SUPPORT_IP6 -static int have_ipv6() { +static +int have_ipv6(void) { int s; s = socket (AF_INET6, SOCK_STREAM, 0); @@ -956,7 +956,7 @@ static int xmlNanoHTTPConnectHost(const char *host, int port) { struct hostent *h; - struct sockaddr *addr; + struct sockaddr *addr = NULL; struct in_addr ia; struct sockaddr_in sockin; diff --git a/xmlschemas.c b/xmlschemas.c index fa623a89..7a2dfbe1 100644 --- a/xmlschemas.c +++ b/xmlschemas.c @@ -5413,8 +5413,9 @@ xmlSchemaValidateType(xmlSchemaValidCtxtPtr ctxt, xmlNodePtr elem, xmlSchemaTypePtr type) { xmlChar *nil; - if ((elem->content == NULL) || (type == NULL) || (elemDecl == NULL)) + if ((elem == NULL) || (type == NULL) || (elemDecl == NULL)) return(0); + /* * 3.3.4 : 2 */