From 1f73bf3ba08bb281057a6c79a70b84c4547ab15a Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Thu, 30 Mar 2000 16:40:33 +0000 Subject: Add a htons in the default_number case, and document the fact that the * camel-service.c (camel_service_getport): Add a htons in the default_number case, and document the fact that the function returns the port in network byte order. * providers/pop3/camel-pop3-store.c (pop3_connect): Revert Miguel's change. The port number bug was actually somewhere else, and the IP address copying code was fine already. svn path=/trunk/; revision=2256 --- camel/providers/pop3/camel-pop3-store.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'camel/providers') diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c index b41c27b0aa..543a6ce532 100644 --- a/camel/providers/pop3/camel-pop3-store.c +++ b/camel/providers/pop3/camel-pop3-store.c @@ -233,13 +233,8 @@ pop3_connect (CamelService *service, CamelException *ex) } sin.sin_family = h->h_addrtype; - sin.sin_port = htons (port); - - /* - * We copy only 4 bytes, as we can not trust h->h_length, as it - * comes from the DNS and might have been tampered with. - */ - memcpy (&sin.sin_addr, h->h_addr, 4); + sin.sin_port = port; + memcpy (&sin.sin_addr, h->h_addr, sizeof (sin.sin_addr)); fd = socket (h->h_addrtype, SOCK_STREAM, 0); if (fd == -1 || -- cgit v1.2.3