report error if input buffer is larger than expected

Let's make the implementation exact and always return TPM_RC_SIZE if
unmarshaling returns success but there are some leftover data.

BUG=chrome-os-partner:43025
TEST=fixed test is described in https://goo.gl/kQnud0, all previously
     passing tests still succeed

Change-Id: I05f9c86d4a2a93bc5cdf73d4e743d56c3d53bdaa
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/307602
Reviewed-by: Utkarsh Sanghi <usanghi@chromium.org>
diff --git a/Marshal_NV_SetBits.c b/Marshal_NV_SetBits.c
index ed24cb6..c57ad5f 100644
--- a/Marshal_NV_SetBits.c
+++ b/Marshal_NV_SetBits.c
@@ -20,6 +20,9 @@
   if (result != TPM_RC_SUCCESS) {
     return result;
   }
+  if ((result == TPM_RC_SUCCESS) && *size) {
+    result = TPM_RC_SIZE;
+  }
   return result;
 }