diff -wruN libntp/audio.c libntp/audio.c
--- libntp/audio.c	2006-06-06 22:16:26.000000000 +0200
+++ libntp/audio.c	2008-10-16 16:30:45.000000000 +0200
@@ -381,7 +381,7 @@
 	r = 0 ; /* setting to zero nicely mutes the channel */
 
 	l |= r << 8;
-        if ( cf_agc )
+        if ( *cf_agc )
           rval = ioctl(ctl_fd, agc, &l);
         else
 	  if (port == 2) {
@@ -401,7 +401,7 @@
 			printf("audio_gain: mongain %d/%d\n", mongain, l);
 # endif
 		l |= r << 8;
-                if ( cf_monitor )
+                if ( *cf_monitor )
                   rval = ioctl(ctl_fd, monitor, &l );
                 else 
 		  rval = ioctl(ctl_fd, SOUND_MIXER_WRITE_VOLUME, &l);

diff -wruN parseutil/dcfd.c parseutil/dcfd.c
--- parseutil/dcfd.c	2006-12-28 13:03:59.000000000 +0100
+++ parseutil/dcfd.c	2008-10-16 15:44:00.000000000 +0200
@@ -587,7 +587,7 @@
 			/*
 			 * invalid character (no consecutive bit sequence)
 			 */
-			dprintf(("parse: cvt_rawdcf: character check for 0x%x@%d FAILED\n", *s, s - buffer));
+			dprintf(("parse: cvt_rawdcf: character check for 0x%x@%ld FAILED\n", *s, s - buffer));
 			*s = (unsigned char)~0;
 			rtc = CVT_FAIL|CVT_BADFMT;
 		}

diff -wruN libisc/inet_ntop.c libisc/inet_ntop.c
--- libisc/inet_ntop.c	2004-02-25 06:58:02.000000000 +0100
+++ libisc/inet_ntop.c	2008-10-16 15:21:28.000000000 +0200
@@ -46,6 +46,8 @@
 			      size_t size);
 #endif
 
+const char *isc_net_ntop(int af, const void *src, char *dst, size_t size);
+
 /* char *
  * isc_net_ntop(af, src, dst, size)
  *	convert a network format address to presentation format.

diff -wruN libisc/inet_pton.c libisc/inet_pton.c
--- libisc/inet_pton.c	2006-06-06 22:16:24.000000000 +0200
+++ libisc/inet_pton.c	2008-10-16 15:21:57.000000000 +0200
@@ -38,6 +38,7 @@
 
 static int inet_pton4(const char *src, unsigned char *dst);
 static int inet_pton6(const char *src, unsigned char *dst);
+int isc_net_pton(int af, const char *src, void *dst);
 
 /* int
  * isc_net_pton(af, src, dst)

diff -wruN util/ntp-keygen.c util/ntp-keygen.c
--- util/ntp-keygen.c	2008-08-17 10:47:31.000000000 +0200
+++ util/ntp-keygen.c	2008-10-16 16:36:33.000000000 +0200
@@ -144,15 +144,15 @@
 void	fslink		P((const char *, const char *));
 int	gen_md5		P((char *));
 #ifdef OPENSSL
-EVP_PKEY *gen_rsa	P((char *));
-EVP_PKEY *gen_dsa	P((char *));
-EVP_PKEY *gen_iff	P((char *));
-EVP_PKEY *gen_gqpar	P((char *));
-EVP_PKEY *gen_gqkey	P((char *, EVP_PKEY *));
-EVP_PKEY *gen_mv	P((char *));
+EVP_PKEY *gen_rsa	P((const char *));
+EVP_PKEY *gen_dsa	P((const char *));
+EVP_PKEY *gen_iff	P((const char *));
+EVP_PKEY *gen_gqpar	P((const char *));
+EVP_PKEY *gen_gqkey	P((const char *, EVP_PKEY *));
+EVP_PKEY *gen_mv	P((const char *));
 int	x509		P((EVP_PKEY *, const EVP_MD *, char *, char *));
 void	cb		P((int, int, void *));
-EVP_PKEY *genkey	P((char *, char *));
+EVP_PKEY *genkey	P((const char *, const char *));
 u_long	asn2ntp		P((ASN1_TIME *));
 #endif /* OPENSSL */
 
@@ -167,8 +167,8 @@
 #endif
 int	nkeys = 0;		/* MV keys */
 time_t	epoch;			/* Unix epoch (seconds) since 1970 */
-char	*hostname;		/* host name (subject name) */
-char	*trustname;		/* trusted host name (issuer name) */
+const char	*hostname;		/* host name (subject name) */
+const char	*trustname;		/* trusted host name (issuer name) */
 char	filename[MAXFILENAME + 1]; /* file name */
 char	*passwd1 = NULL;	/* input private key password */
 char	*passwd2 = NULL;	/* output private key password */
@@ -233,7 +233,7 @@
 	int	gqkey = 0;	/* update GQ keys */
 	int	mvpar = 0;	/* generate MV parameters */
 	int	mvkey = 0;	/* update MV keys */
-	char	*sign = NULL;	/* sign key */
+	const char	*sign = NULL;	/* sign key */
 	EVP_PKEY *pkey = NULL;	/* temp key */
 	const EVP_MD *ectx;	/* EVP digest */
 	char	pathbuf[MAXFILENAME + 1];
@@ -278,7 +278,7 @@
 	hostname = hostbuf;
 #ifdef OPENSSL
 	trustname = hostbuf;
-	passwd1 = hostbuf;
+	passwd1 = strdup(hostbuf);
 #endif
 #ifndef SYS_WINNT
 	gettimeofday(&tv, 0);
@@ -329,10 +329,10 @@
 	    exten = EXT_KEY_PRIVATE;
 
 	if (HAVE_OPT( PVT_PASSWD ))
-	    passwd2 = OPT_ARG( PVT_PASSWD );
+	    passwd2 = strdup(OPT_ARG( PVT_PASSWD ));
 
 	if (HAVE_OPT( GET_PVT_PASSWD ))
-	    passwd1 = OPT_ARG( GET_PVT_PASSWD );
+	    passwd1 = strdup(OPT_ARG( GET_PVT_PASSWD ));
 
 	if (HAVE_OPT( SIGN_KEY ))
 	    sign = OPT_ARG( SIGN_KEY );
@@ -355,7 +355,7 @@
 #endif
 
 	if (passwd1 != NULL && passwd2 == NULL)
-		passwd2 = passwd1;
+		passwd2 = strdup(passwd1);
 #ifdef OPENSSL
 	/*
 	 * Seed random number generator and grow weeds.
@@ -591,6 +591,10 @@
 	if (pkey_mv != NULL)
 		EVP_PKEY_free(pkey_mv);
 #endif /* OPENSSL */
+        if (passwd1)
+                free(passwd1);
+        if (passwd2)
+                free(passwd2);
 	return (rval);
 }
 
@@ -667,7 +671,7 @@
  */
 EVP_PKEY *			/* public/private key pair */
 gen_rsa(
-	char	*id		/* file name id */
+	const char	*id		/* file name id */
 	)
 {
 	EVP_PKEY *pkey;		/* private key */
@@ -720,7 +724,7 @@
  */
 EVP_PKEY *			/* public/private key pair */
 gen_dsa(
-	char	*id		/* file name id */
+	const char	*id		/* file name id */
 	)
 {
 	EVP_PKEY *pkey;		/* private key */
@@ -799,7 +803,7 @@
  */
 EVP_PKEY *			/* DSA cuckoo nest */
 gen_iff(
-	char	*id		/* file name id */
+	const char	*id		/* file name id */
 	)
 {
 	EVP_PKEY *pkey;		/* private key */
@@ -941,7 +945,7 @@
  */
 EVP_PKEY *			/* RSA cuckoo nest */
 gen_gqpar(
-	char	*id		/* file name id */
+	const char	*id		/* file name id */
 	)
 {
 	EVP_PKEY *pkey;		/* private key */
@@ -1006,7 +1010,7 @@
  */
 EVP_PKEY *			/* RSA cuckoo nest */
 gen_gqkey(
-	char	*id,		/* file name id */
+	const char	*id,		/* file name id */
 	EVP_PKEY *gqpar		/* GQ parameters */
 	)
 {
@@ -1178,7 +1182,7 @@
  */
 EVP_PKEY *			/* DSA cuckoo nest */
 gen_mv(
-	char	*id		/* file name id */
+	const char	*id		/* file name id */
 	)
 {
 	EVP_PKEY *pkey, *pkey1;	/* private key */
@@ -1638,10 +1642,10 @@
 	X509_time_adj(X509_get_notAfter(cert), YEAR, &epoch);
 	subj = X509_get_subject_name(cert);
 	X509_NAME_add_entry_by_txt(subj, "commonName", MBSTRING_ASC,
-	    (unsigned char *) hostname, strlen(hostname), -1, 0);
+	    (unsigned const char *) hostname, strlen(hostname), -1, 0);
 	subj = X509_get_issuer_name(cert);
 	X509_NAME_add_entry_by_txt(subj, "commonName", MBSTRING_ASC,
-	    (unsigned char *) trustname, strlen(trustname), -1, 0);
+	    (unsigned const char *) trustname, strlen(trustname), -1, 0);
 	if (!X509_set_pubkey(cert, pkey)) {
 		fprintf(stderr, "Assign key fails\n%s\n",
 		    ERR_error_string(ERR_get_error(), NULL));
@@ -1827,8 +1831,8 @@
  */
 EVP_PKEY *			/* public/private key pair */
 genkey(
-	char	*type,		/* key type (RSA or DSA) */
-	char	*id		/* file name id */
+	const char	*type,		/* key type (RSA or DSA) */
+	const char	*id		/* file name id */
 	)
 {
 	if (type == NULL)
diff -wruN ntpd/ntp_crypto.c ntpd/ntp_crypto.c
--- ntpd/ntp_crypto.c	2008-10-16 16:49:19.000000000 +0200
+++ ntpd/ntp_crypto.c	2008-10-16 15:31:11.000000000 +0200
@@ -392,7 +392,7 @@
 	keyid_t	cookie;		/* crumbles */
 	int	hismode;	/* packet mode */
 	int	rval = XEVNT_OK;
-	u_char	*ptr;
+	const u_char *ptr;
 	u_int32 temp32;
 
 	/*
@@ -1646,13 +1646,13 @@
 	tstamp_t tstamp;	/* NTP timestamp */
 	u_int32	temp32;
 	u_int	len;
-	u_char	*ptr;
+	const u_char	*ptr;
 
 	/*
 	 * Extract the public key from the request.
 	 */
 	len = ntohl(ep->vallen);
-	ptr = (u_char *)ep->pkt;
+	ptr = (const u_char *)ep->pkt;
 	pkey = d2i_PublicKey(EVP_PKEY_RSA, NULL, &ptr, len);
 	if (pkey == NULL) {
 		msyslog(LOG_ERR, "crypto_encrypt %s\n",
@@ -3019,7 +3019,7 @@
 	BIO	*bp;
 	X509V3_EXT_METHOD *method;
 	char	pathbuf[MAXFILENAME];
-	u_char	*uptr;
+	const u_char	*uptr;
 	char	*ptr;
 	int	temp, cnt, i;
 
@@ -3223,7 +3223,8 @@
 	EVP_MD_CTX ctx;		/* message digest context */
 	tstamp_t tstamp;	/* NTP timestamp */
 	u_int	len;
-	u_char	*ptr;
+	const u_char	*ptr;
+	u_char	*ptr1;
 	int	i, temp;
 
 	/*
@@ -3238,7 +3239,7 @@
 	if (tstamp < cinfo->first || tstamp > cinfo->last)
 		return (XEVNT_PER);
 
-	ptr = (u_char *)ep->pkt;
+	ptr = (const u_char *)ep->pkt;
 	if ((req = d2i_X509(NULL, &ptr, ntohl(ep->vallen))) == NULL) {
 		msyslog(LOG_ERR, "cert_sign %s\n",
 		    ERR_error_string(ERR_get_error(), NULL));
@@ -3302,8 +3303,8 @@
 	vp->fstamp = ep->fstamp;
 	vp->vallen = htonl(len);
 	vp->ptr = emalloc(len);
-	ptr = vp->ptr;
-	i2d_X509(cert, &ptr);
+	ptr1 = vp->ptr;
+	i2d_X509(cert, &ptr1);
 	vp->siglen = 0;
 	vp->sig = emalloc(sign_siglen);
 	EVP_SignInit(&ctx, sign_digest);
@@ -3338,7 +3339,7 @@
 	)
 {
 	X509	*cert;		/* X509 certificate */
-	u_char	*ptr;
+	const u_char	*ptr;
 
 	if (cinf->flags & CERT_SIGN)
 		return (XEVNT_OK);
@@ -3904,14 +3905,13 @@
 		exit (-1);
 	}
 	if ((bytes = RAND_load_file(rand_file, -1)) == 0) {
-		int m_buff = 0;
 		RAND_write_file(rand_file);
 
 		msyslog(LOG_ERR,
 		    "crypto_setup: random seed file %s not found - created one\n",
 		    rand_file);
 		crypto_setup();
-		return ( 0 );
+		return;
 //		exit (-1);
 	}
 	get_systime(&seed);
diff -wruN ntpd/ntp_filegen.c ntpd/ntp_filegen.c
--- ntpd/ntp_filegen.c	2006-06-06 22:16:39.000000000 +0200
+++ ntpd/ntp_filegen.c	2008-10-16 15:38:39.000000000 +0200
@@ -62,12 +62,12 @@
  */
 
 static void
-filegen_init(char *prefix, const char *basename, FILEGEN *fp)
+filegen_init(char *prefix, const char *base_name, FILEGEN *fp)
 {
 	fp->fp       = NULL;
 	fp->prefix   = prefix;		/* Yes, this is TOTALLY lame! */
-	fp->basename = (char*)emalloc(strlen(basename) + 1);
-	strcpy(fp->basename, basename);
+	fp->basename = (char*)emalloc(strlen(base_name) + 1);
+	strcpy(fp->basename, base_name);
 	fp->id       = 0;
 	fp->type     = FILEGEN_DAY;
 	fp->flag     = FGEN_FLAG_LINK; /* not yet enabled !!*/
@@ -76,7 +76,7 @@
 
 /*
  * open a file generation according to the current settings of gen
- * will also provide a link to basename if requested to do so
+ * will also provide a link to base_name if requested to do so
  */
 
 static void
@@ -86,30 +86,30 @@
 	)
 {
 	char *filename;
-	char *basename;
+	char *base_name;
 	u_int len;
 	FILE *fp;
 	struct calendar cal;
 
 	len = strlen(gen->prefix) + strlen(gen->basename) + 1;
-	basename = (char*)emalloc(len);
-	sprintf(basename, "%s%s", gen->prefix, gen->basename);
+	base_name = (char*)emalloc(len);
+	sprintf(base_name, "%s%s", gen->prefix, gen->basename);
   
 	switch(gen->type) {
 	    default:
 		msyslog(LOG_ERR, "unsupported file generations type %d for \"%s\" - reverting to FILEGEN_NONE",
-			gen->type, basename);
+			gen->type, base_name);
 		gen->type = FILEGEN_NONE;
       
 		/*FALLTHROUGH*/
 	    case FILEGEN_NONE:
 		filename = (char*)emalloc(len);
-		sprintf(filename,"%s", basename);
+		sprintf(filename,"%s", base_name);
 		break;
 
 	    case FILEGEN_PID:
 		filename = (char*)emalloc(len + 1 + 1 + 10);
-		sprintf(filename,"%s%c#%ld", basename, SUFFIX_SEP, newid);
+		sprintf(filename,"%s%c#%ld", base_name, SUFFIX_SEP, newid);
 		break;
       
 	    case FILEGEN_DAY:
@@ -120,7 +120,7 @@
 		caljulian(newid,&cal);
 		filename = (char*)emalloc(len + 1 + 4 + 2 + 2);
 		sprintf(filename, "%s%c%04d%02d%02d",
-			basename, SUFFIX_SEP, cal.year, cal.month, cal.monthday);
+			base_name, SUFFIX_SEP, cal.year, cal.month, cal.monthday);
 		break;
       
 	    case FILEGEN_WEEK:
@@ -133,25 +133,25 @@
 		caljulian(newid,&cal);
 		filename = (char*)emalloc(len + 1 + 4 + 1 + 2);
 		sprintf(filename, "%s%c%04dw%02d",
-			basename, SUFFIX_SEP, cal.year, cal.yearday / 7);
+			base_name, SUFFIX_SEP, cal.year, cal.yearday / 7);
 		break;
 
 	    case FILEGEN_MONTH:
 		caljulian(newid,&cal);
 		filename = (char*)emalloc(len + 1 + 4 + 2);
 		sprintf(filename, "%s%c%04d%02d",
-			basename, SUFFIX_SEP, cal.year, cal.month);
+			base_name, SUFFIX_SEP, cal.year, cal.month);
 		break;
 
 	    case FILEGEN_YEAR:
 		caljulian(newid,&cal);
 		filename = (char*)emalloc(len + 1 + 4);
-		sprintf(filename, "%s%c%04d", basename, SUFFIX_SEP, cal.year);
+		sprintf(filename, "%s%c%04d", base_name, SUFFIX_SEP, cal.year);
 		break;
 
 	    case FILEGEN_AGE:
 		filename = (char*)emalloc(len + 1 + 2 + 10);
-		sprintf(filename, "%s%ca%08ld", basename, SUFFIX_SEP, newid);
+		sprintf(filename, "%s%ca%08ld", base_name, SUFFIX_SEP, newid);
 		break;
 	}
   
@@ -170,7 +170,7 @@
 #ifndef	S_ISREG
 #define	S_ISREG(mode)	(((mode) & S_IFREG) == S_IFREG)
 #endif
-		if (stat(basename, &stats) == 0) {
+		if (stat(base_name, &stats) == 0) {
 			/* Hm, file exists... */
 			if (S_ISREG(stats.st_mode)) {
 				if (stats.st_nlink <= 1)	{
@@ -179,12 +179,12 @@
 					 */
 					char *savename = (char*)emalloc(len + 1 + 1 + 10 + 10);
 					sprintf(savename, "%s%c%dC%lu",
-						basename,
+						base_name,
 						SUFFIX_SEP,
 						(int) getpid(),
 						(u_long)conflicts++);
-					if (rename(basename, savename) != 0)
-					    msyslog(LOG_ERR," couldn't save %s: %m", basename);
+					if (rename(base_name, savename) != 0)
+					    msyslog(LOG_ERR," couldn't save %s: %m", base_name);
 					free(savename);
 				} else {
 					/*
@@ -194,27 +194,27 @@
 					 */
 					if (
 #if !defined(VMS)
-						unlink(basename) != 0
+						unlink(base_name) != 0
 #else
-						delete(basename) != 0
+						delete(base_name) != 0
 #endif
 						)
-					    msyslog(LOG_ERR, "couldn't unlink %s: %m", basename);
+					    msyslog(LOG_ERR, "couldn't unlink %s: %m", base_name);
 				}
 			} else {
 				/*
 				 * Ehh? Not a regular file ?? strange !!!!
 				 */
 				msyslog(LOG_ERR, "expected regular file for %s (found mode 0%lo)",
-					basename, (unsigned long)stats.st_mode);
+					base_name, (unsigned long)stats.st_mode);
 			}
 		} else {
 			/*
 			 * stat(..) failed, but it is absolutely correct for
-			 * 'basename' not to exist
+			 * 'base_name' not to exist
 			 */
 			if (errno != ENOENT)
-			    msyslog(LOG_ERR,"stat(%s) failed: %m", basename);
+			    msyslog(LOG_ERR,"stat(%s) failed: %m", base_name);
 		}
 	}
 
@@ -250,7 +250,7 @@
 
 		if (gen->flag & FGEN_FLAG_LINK) {
 			/*
-			 * need to link file to basename
+			 * need to link file to base_name
 			 * have to use hardlink for now as I want to allow
 			 * gen->basename spanning directory levels
 			 * this would make it more complex to get the correct
@@ -267,14 +267,14 @@
 #elif defined(VMS)
 			errno = 0; /* On VMS, don't support FGEN_FLAG_LINK */
 #else  /* not (VMS) / VXWORKS / WINNT ; DO THE LINK) */
-			if (link(filename, basename) != 0)
+			if (link(filename, base_name) != 0)
 			    if (errno != EEXIST)
-				msyslog(LOG_ERR, "can't link(%s, %s): %m", filename, basename);
+				msyslog(LOG_ERR, "can't link(%s, %s): %m", filename, base_name);
 #endif /* SYS_WINNT || VXWORKS */
 		}		/* flags & FGEN_FLAG_LINK */
 	}			/* else fp == NULL */
 	
-	free(basename);
+	free(base_name);
 	free(filename);
 	return;
 }
@@ -371,7 +371,7 @@
 void
 filegen_config(
 	FILEGEN *gen,
-	char    *basename,
+	char    *base_name,
 	u_int   type,
 	u_int   flag
 	)
@@ -379,7 +379,7 @@
 	/*
 	 * if nothing would be changed...
 	 */
-	if ((basename == gen->basename || strcmp(basename,gen->basename) == 0) &&
+	if ((base_name == gen->basename || strcmp(base_name,gen->basename) == 0) &&
 	    type == gen->type &&
 	    flag == gen->flag)
 	    return;
@@ -387,7 +387,7 @@
 	/*
 	 * validate parameters
 	 */
-	if (!valid_fileref(gen->prefix,basename))
+	if (!valid_fileref(gen->prefix,base_name))
 	    return;
   
 	if (gen->fp != NULL)
@@ -396,12 +396,12 @@
 #ifdef DEBUG
 	if (debug > 2)
 	    printf("configuring filegen:\n\tprefix:\t%s\n\tbasename:\t%s -> %s\n\ttype:\t%d -> %d\n\tflag: %x -> %x\n",
-		   gen->prefix, gen->basename, basename, gen->type, type, gen->flag, flag);
+		   gen->prefix, gen->basename, base_name, gen->type, type, gen->flag, flag);
 #endif
-	if (gen->basename != basename || strcmp(gen->basename, basename) != 0) {
+	if (gen->basename != base_name || strcmp(gen->basename, base_name) != 0) {
 		free(gen->basename);
-		gen->basename = (char*)emalloc(strlen(basename) + 1);
-		strcpy(gen->basename, basename);
+		gen->basename = (char*)emalloc(strlen(base_name) + 1);
+		strcpy(gen->basename, base_name);
 	}
 	gen->type = (u_char) type;
 	gen->flag = (u_char) flag;
@@ -422,13 +422,13 @@
 
 
 /*
- * check whether concatenating prefix and basename
+ * check whether concatenating prefix and base_name
  * yields a legal filename
  */
 static int
 valid_fileref(
 	char *prefix,
-	char *basename
+	char *base_name
 	)
 {
 	/*
@@ -444,7 +444,7 @@
 	 *		has to be ensured by other means
 	 * (however, it would be possible to perform some checks here...)
 	 */
-	register char *p = basename;
+	register char *p = base_name;
   
 	/*
 	 * Just to catch, dumb errors opening up the world...
@@ -452,10 +452,10 @@
 	if (prefix == NULL || *prefix == '\0')
 	    return 0;
 
-	if (basename == NULL)
+	if (base_name == NULL)
 	    return 0;
   
-	for (p = basename; p; p = strchr(p, '/')) {
+	for (p = base_name; p; p = strchr(p, '/')) {
 		if (*p == '.' && *(p+1) == '.' && (*(p+2) == '\0' || *(p+2) == '/'))
 		    return 0;
 	}

diff -wruN ntpd/ntp_request.c ntpd/ntp_request.c
--- ntpd/ntp_request.c	2008-08-10 13:02:41.000000000 +0200
+++ ntpd/ntp_request.c	2008-10-16 15:40:01.000000000 +0200
@@ -2674,6 +2674,7 @@
 
 	memset((char *)&addr, 0, sizeof addr);
 	memset((char *)&clock_stat, 0, sizeof clock_stat);
+	memset((char *)&tmp_clock, 0, sizeof tmp_clock);
 	items = INFO_NITEMS(inpkt->err_nitems);
 	cf = (struct conf_fudge *) inpkt->data;
 

diff -wruN ntpq/ntpq.c ntpq/ntpq.c
--- ntpq/ntpq.c	2008-08-17 10:47:31.000000000 +0200
+++ ntpq/ntpq.c	2008-10-16 15:43:12.000000000 +0200
@@ -1975,8 +1975,8 @@
 {
 	if (*str == '0') {
 		if (*(str+1) == 'x' || *(str+1) == 'X')
-		    return hextoint(str+2, val);
-		return octtoint(str, val);
+	                return hextoint(str+2, (u_long *)val);
+		return octtoint(str, (u_long *)val);
 	}
 	return atoint(str, val);
 }

diff -wruN sntp/socket.c sntp/socket.c
--- sntp/socket.c	2006-12-28 13:04:08.000000000 +0100
+++ sntp/socket.c	2008-10-16 15:17:40.000000000 +0200
@@ -281,7 +281,7 @@
 #else
     struct sockaddr_in scratch, *ptr;
 #endif
-    int n;
+    socklen_t n;
     int k;
 
 /* Under normal circumstances, set up a timeout. */
@@ -336,7 +336,7 @@
 #else
     struct sockaddr_in scratch;
 #endif
-    int n;
+    socklen_t n;
     char buffer[256];
     int flags, count = 0, total = 0, k;
 

diff -N -ur ntpd/ntp_request.c ntp-4.2.4p5/ntpd/ntp_request.c
--- ntpd/ntp_request.c	2008-08-10 13:02:41.000000000 +0200
+++ ntpd/ntp_request.c	2008-10-08 12:41:47.000000000 +0200
@@ -509,8 +509,8 @@
 		return;
 	}
 	if ((proc->sizeofitem != 0) &&
-	    ((temp_size * INFO_NITEMS(inpkt->err_nitems)) >
-	    (rbufp->recv_length - REQ_LEN_HDR))) {
+            ((unsigned) temp_size * INFO_NITEMS(inpkt->err_nitems)) >
+	    (rbufp->recv_length - REQ_LEN_HDR)) {
 #ifdef DEBUG
 		if (debug > 2)
 			printf("process_private: not enough data\n");
