diff options
author | jilles <jilles@FreeBSD.org> | 2014-04-01 21:30:54 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2014-04-01 21:30:54 +0000 |
commit | 925e49a64ac40852e851e5593ba199e0f59f05f2 (patch) | |
tree | f5df74ed5696a9162c3b742de24a792b2e5bc862 /lib/libnv | |
parent | 99e9c66846b2e9db802523c030537cd646ad0446 (diff) | |
download | FreeBSD-src-925e49a64ac40852e851e5593ba199e0f59f05f2.zip FreeBSD-src-925e49a64ac40852e851e5593ba199e0f59f05f2.tar.gz |
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
Diffstat (limited to 'lib/libnv')
-rw-r--r-- | lib/libnv/nvlist.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libnv/nvlist.c b/lib/libnv/nvlist.c index ba809f5..929ba48 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); } |