From 1c6e90b0f8dacb8fd9e62245dd1504c8cc12234a Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Tue, 1 Apr 2014 21:30:54 +0000 Subject: [PATCH] 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 --- lib/libnv/nvlist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libnv/nvlist.c b/lib/libnv/nvlist.c index ba809f53a1c2..929ba4894596 100644 --- a/lib/libnv/nvlist.c +++ b/lib/libnv/nvlist.c @@ -582,7 +582,7 @@ nvlist_check_header(struct nvlist_header *nvlhdrp) 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); }