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);
        }
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to