From 7d9b32cd78d52bacebbb1dd89bf2ae72677714ed Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Wed, 6 Oct 2010 10:07:22 -0400 Subject: [PATCH] xdr: another sanity check for operation count in reply Signed-off-by: Casey Bodley --- daemon/nfs41_xdr.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/daemon/nfs41_xdr.c b/daemon/nfs41_xdr.c index 1ce8cdf..7e1dfe0 100644 --- a/daemon/nfs41_xdr.c +++ b/daemon/nfs41_xdr.c @@ -3132,6 +3132,13 @@ bool_t nfs_decode_compound( eprintf("reply with %u operations, only sent %u!\n", res->resarray_count, expected_count); return FALSE; + } else if (res->resarray_count < expected_count && + res->status == NFS4_OK) { + /* illegal for a server to reply with less operations, + * unless one of them fails */ + eprintf("successful reply with only %u operations, sent %u!\n", + res->resarray_count, expected_count); + return FALSE; } for (i = 0; i < res->resarray_count; i++)