Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Feb 2014 02:00:31 +0000 (UTC)
From:      Eitan Adler <eadler@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r261502 - head/lib/libc/net
Message-ID:  <201402050200.s1520VvQ074916@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: eadler
Date: Wed Feb  5 02:00:31 2014
New Revision: 261502
URL: http://svnweb.freebsd.org/changeset/base/261502

Log:
  libc/net: fix a portability issue
  
  * POSIX does not require socklen_t to be  unsigned
  
  Submitted by:	bde
  MFC After:	1 week (with r261454)

Modified:
  head/lib/libc/net/ip6opt.c

Modified: head/lib/libc/net/ip6opt.c
==============================================================================
--- head/lib/libc/net/ip6opt.c	Wed Feb  5 00:26:11 2014	(r261501)
+++ head/lib/libc/net/ip6opt.c	Wed Feb  5 02:00:31 2014	(r261502)
@@ -382,7 +382,7 @@ inet6_opt_init(void *extbuf, socklen_t e
 	struct ip6_ext *ext = (struct ip6_ext *)extbuf;
 
 	if (ext) {
-		if (extlen == 0 || (extlen % 8))
+		if (extlen <= 0 || (extlen % 8))
 			return(-1);
 		ext->ip6e_len = (extlen >> 3) - 1;
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201402050200.s1520VvQ074916>