svn commit: r264021 - head/lib/libnv

Jilles Tjoelker jilles at FreeBSD.org
Tue Apr 1 21:30:54 UTC 2014


Author: jilles
Date: Tue Apr  1 21:30:54 2014
New Revision: 264021
URL: http://svnweb.freebsd.org/changeset/base/264021

Log:
  libnv: Don't lose big-endian flag when receiving a message.
  
  A bug caused the "big endian" flag to be lost when receiving a message. As a
  result, the bits are interpreted as little endian and an extremely large
  allocation is attempted.
  
  This change fixes ping(8)'s communication to casperd(8) on big-endian
  architectures.
  
  Reported by:	Anton Shterenlikht
  Tested by:	danfe

Modified:
  head/lib/libnv/nvlist.c

Modified: head/lib/libnv/nvlist.c
==============================================================================
--- head/lib/libnv/nvlist.c	Tue Apr  1 21:13:05 2014	(r264020)
+++ head/lib/libnv/nvlist.c	Tue Apr  1 21:30:54 2014	(r264021)
@@ -582,7 +582,7 @@ nvlist_check_header(struct nvlist_header
 		errno = EINVAL;
 		return (false);
 	}
-	if ((nvlhdrp->nvlh_flags &= ~NV_FLAG_ALL_MASK) != 0) {
+	if ((nvlhdrp->nvlh_flags & ~NV_FLAG_ALL_MASK) != 0) {
 		errno = EINVAL;
 		return (false);
 	}


More information about the svn-src-head mailing list