xdr: another sanity check for operation count in reply

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
This commit is contained in:
Casey Bodley 2010-10-06 10:07:22 -04:00
parent 9dcf4021ba
commit 7d9b32cd78

View file

@ -3132,6 +3132,13 @@ bool_t nfs_decode_compound(
eprintf("reply with %u operations, only sent %u!\n", eprintf("reply with %u operations, only sent %u!\n",
res->resarray_count, expected_count); res->resarray_count, expected_count);
return FALSE; 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++) for (i = 0; i < res->resarray_count; i++)