r21389: give a better error when our parser hasn't consumed all data
authorStefan Metzmacher <metze@samba.org>
Fri, 16 Feb 2007 15:42:22 +0000 (15:42 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:48:24 +0000 (14:48 -0500)
metze

source/librpc/ndr/ndr.c

index 028d66d7b725c7e123747bcca7b12721678481b6..cbd316f403050d81eb62ecc15f0ee7592741e9ed 100644 (file)
@@ -735,8 +735,8 @@ _PUBLIC_ NTSTATUS ndr_pull_struct_blob_all(const DATA_BLOB *blob, TALLOC_CTX *me
        }
        status = fn(ndr, NDR_SCALARS|NDR_BUFFERS, p);
        if (!NT_STATUS_IS_OK(status)) return status;
-       if (ndr->offset != ndr->data_size) {
-               return NT_STATUS_BUFFER_TOO_SMALL;
+       if (ndr->offset < ndr->data_size) {
+               return NT_STATUS_PORT_MESSAGE_TOO_LONG;
        }
        return status;
 }