From 912f6ae500122ac6480529f0b0cd2323ebd0f1ea Mon Sep 17 00:00:00 2001 From: Olga Kornievskaia Date: Wed, 24 Aug 2011 16:59:02 -0400 Subject: [PATCH] need to check valid opcode value before refcounting state and root --- daemon/upcall.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/daemon/upcall.c b/daemon/upcall.c index 09ec86b..5169b5c 100644 --- a/daemon/upcall.c +++ b/daemon/upcall.c @@ -110,16 +110,15 @@ int upcall_parse( upcall->status = status = NFSD_VERSION_MISMATCH; goto out; } - if (upcall->root_ref != INVALID_HANDLE_VALUE) - nfs41_root_ref(upcall->root_ref); - if (upcall->state_ref != INVALID_HANDLE_VALUE) - nfs41_open_state_ref(upcall->state_ref); - if (upcall->opcode >= g_upcall_op_table_size) { status = ERROR_NOT_SUPPORTED; eprintf("unrecognized upcall opcode %d!\n", upcall->opcode); goto out; } + if (upcall->root_ref != INVALID_HANDLE_VALUE) + nfs41_root_ref(upcall->root_ref); + if (upcall->state_ref != INVALID_HANDLE_VALUE) + nfs41_open_state_ref(upcall->state_ref); /* parse the operation's arguments */ op = g_upcall_op_table[upcall->opcode];