Remove instances of calling marshal functions with NULL pointer.

In the code scraped from the TCG TPM2.0 Library specification, there
are several instances where the intent is to marshal data into a buffer,
but NULL pointer is passed in as size.

Part 4 section 4.2.3.1 states: "If size is a NULL pointer, then no
data is marshaled and the routine will compute the size of the memory
required to marshal the indicated type."

Implying these usages are bugs. This CL removes all instances of passing
in NULL as size to a Marshal function when the intent is to marshal data.

TEST=$ sudo emerge tpm2
     builds libtpm2.a. Currently this is the only test we have for the
     scraped code.
BUG=none

Change-Id: If7b2a60f6a8e875b4a6eceab513dc22325bf4999
Reviewed-on: https://chromium-review.googlesource.com/289647
Reviewed-by: Utkarsh Sanghi <usanghi@chromium.org>
Commit-Queue: Jocelyn Bohr <bohr@chromium.org>
Tested-by: Jocelyn Bohr <bohr@chromium.org>
diff --git a/Ticket.c b/Ticket.c
index 0494251..0f8b7f1 100644
--- a/Ticket.c
+++ b/Ticket.c
@@ -29,12 +29,14 @@
       TPM_GENERATED        valueToCompare = TPM_GENERATED_VALUE;
       BYTE                 bufferToCompare[sizeof(valueToCompare)];
       BYTE                 *marshalBuffer;
+      INT32                bufferSize;
       // If the buffer size is less than the size of TPM_GENERATED_VALUE, assume
       // it is not safe to generate a ticket
       if(buffer->size < sizeof(valueToCompare))
           return FALSE;
       marshalBuffer = bufferToCompare;
-   TPM_GENERATED_Marshal(&valueToCompare, &marshalBuffer, NULL);
+      bufferSize = sizeof(valueToCompare);
+   TPM_GENERATED_Marshal(&valueToCompare, &marshalBuffer, &bufferSize);
    if(MemoryEqual(buffer->buffer, bufferToCompare, sizeof(valueToCompare)))
        return FALSE;
    else